diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 1fabdde6..00000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Debian 9 ships with Python 3.5 which is not usable with mut -# (https://jira.mongodb.org/browse/DOP-1301, fixed by -# https://github.com/p-mongo/mut/commit/5beefc1c9ac2a9afabb86d918bfe598477b927e1). -# Debian 10 ships with Python 3.7 which is supposed to work but it doesn't -# per https://jira.mongodb.org/browse/DOP-1303. -# Use Debian 9 with the patch. -FROM debian:9 - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && \ - apt-get -y install make git python-pip python3-pip \ - ruby yard pkg-config libxml2-dev && \ - python -m pip install giza && \ - python3 -m pip install mut - -# Apply the fix in -# https://github.com/p-mongo/mut/commit/5beefc1c9ac2a9afabb86d918bfe598477b927e1 -RUN git clone https://github.com/p-mongo/mut && \ - cd mut && \ - python3 setup.py install - -WORKDIR /app - -COPY . . - -ENTRYPOINT ["./entrypoint.sh"] diff --git a/Makefile b/Makefile deleted file mode 100644 index a6b19a5b..00000000 --- a/Makefile +++ /dev/null @@ -1,112 +0,0 @@ -# Makefile for Mongoid docs - -GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) -USER=$(shell whoami) -STAGING_URL="https://docs-mongodborg-staging.corp.mongodb.com" -PRODUCTION_URL="https://docs.mongodb.com" - -STAGING_BUCKET=docs-mongodb-org-prd-staging -PRODUCTION_BUCKET=docs-mongodb-org-prd - -SEARCH_INDEX_BUCKET=docs-search-indexes-test - -PROJECT=mongoid -PREFIX=mongoid -TARGET_DIR=source-${GIT_BRANCH} - -SOURCE_FILE_DIR=build/mongoid-${GIT_BRANCH} -DOTCOM_STAGING_URL="https://mongodbcom-cdn.website.staging.corp.mongodb.com" -DOTCOM_STAGING_BUCKET=docs-mongodb-org-dotcomstg -DOTCOM_PRODUCTION_URL="https://mongodb.com" -DOTCOM_PRODUCTION_BUCKET=docs-mongodb-org-dotcomprd -DOTCOM_PREFIX=docs/mongoid -DOTCOM_STGPREFIX=docs-qa/mongoid - -# Parse our published-branches configuration file to get the name of -# the current "stable" branch. This is weird and dumb, yes. -STABLE_BRANCH=`grep 'manual' build/docs-tools/data/${PROJECT}-published-branches.yaml | cut -d ':' -f 2 | grep -Eo '[0-9a-z.]+'` - -.PHONY: help stage fake-deploy deploy deploy-search-index api-docs get-assets migrate clean - -help: ## Show this help message - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' - @echo - @echo 'Variables' - @printf " \033[36m%-18s\033[0m %s\n" 'ARGS' 'Arguments to pass to mut-publish' - -html: migrate ## Builds this branch's HTML under build//html - giza make html - -## Migrate the files from the driver repo and build the dirhtml for publishing -## In course of building, will use yard to build API docs (takes a while) -# you must install yard -# generate the api docs from the mongoid project and output to the build dir - -debug: - @echo ${DOTCOM_PRODUCTION_BUCKET} - -publish: migrate ## Builds this branch's publishable HTML and other artifacts under build/public - giza make publish - @echo "Making api directory in /build/public/${GIT_BRANCH}" - if [ -d build/public/${GIT_BRANCH}/api ]; then rm -rf build/public/${GIT_BRANCH}/api ; fi; - mkdir build/public/${GIT_BRANCH}/api - - yard doc ${SOURCE_FILE_DIR} --exclude ${SOURCE_FILE_DIR}/spec --exclude ${SOURCE_FILE_DIR}/perf --readme ${SOURCE_FILE_DIR}/README.md -o build/public/${GIT_BRANCH}/api/ - if [ ${GIT_BRANCH} = master ]; then mut-redirects config/redirects -o build/public/.htaccess; fi - -stage: ## Host online for review - mut-publish build/${GIT_BRANCH}/html ${DOTCOM_STAGING_BUCKET} --prefix=${DOTCOM_STGPREFIX} --stage ${ARGS} - @echo "Hosted at ${DOTCOM_STAGING_URL}/${DOTCOM_STGPREFIX}/${USER}/${GIT_BRANCH}/index.html" - - - -fake-deploy: build/public/${GIT_BRANCH} ## Create a fake deployment in the staging bucket - mut-publish build/public ${DOTCOM_STAGING_BUCKET} --prefix=${DOTCOM_STGPREFIX} --deploy --verbose ${ARGS} - @echo "Hosted at ${DOTCOM_STAGING_URL}/${DOTCOM_STGPREFIX}/${GIT_BRANCH}/index.html" - - - -deploy: build/public/${GIT_BRANCH} ## Deploy to the production bucket - mut-publish build/public/ ${DOTCOM_PRODUCTION_BUCKET} --prefix=${DOTCOM_PREFIX} --deploy --redirects build/public/.htaccess ${ARGS} - @echo "Hosted at ${DOTCOM_PRODUCTION_URL}/${DOTCOM_PREFIX}/${GIT_BRANCH}" - - $(MAKE) deploy-search-index - -deploy-search-index: ## Update the search index for this branch - @echo "Building search index" - if [ ${STABLE_BRANCH} = ${GIT_BRANCH} ]; then \ - mut-index upload build/public/${GIT_BRANCH} -o ${PROJECT}-${GIT_BRANCH}.json -u ${PRODUCTION_URL}/${PROJECT}/${GIT_BRANCH} -b ${SEARCH_INDEX_BUCKET} -p search-indexes/prd -g -s --exclude build/public/${GIT_BRANCH}/api; \ - else \ - mut-index upload build/public/${GIT_BRANCH} -o ${PROJECT}-${GIT_BRANCH}.json -u ${PRODUCTION_URL}/${PROJECT}/${GIT_BRANCH} -b ${SEARCH_INDEX_BUCKET} -p search-indexes/prd -s --exclude build/public/${GIT_BRANCH}/api; \ - fi - -# in case you want to just generate the api-docs -# generate the api docs -# you must install yard -# generate the api docs from the mongoid project and output to the build dir - -api-docs: - @echo "Making api directory in /build/public/${GIT_BRANCH}" - if [ -d build/public/${GIT_BRANCH}/api ]; then rm -rf build/public/${GIT_BRANCH}/api ; fi; - mkdir build/public/${GIT_BRANCH}/api - - yard doc ${SOURCE_FILE_DIR} --exclude ${SOURCE_FILE_DIR}/spec --exclude ${SOURCE_FILE_DIR}/perf --readme ${SOURCE_FILE_DIR}/README.md -o build/public/${GIT_BRANCH}/api/ - - -migrate: get-assets - @echo "Making target source directory" - if [ -d ${TARGET_DIR} ]; then rm -rf ${TARGET_DIR} ; fi; - mkdir ${TARGET_DIR} - - - @echo "Copying over mongoid doc files" - cp -r ${SOURCE_FILE_DIR}/docs/* ${TARGET_DIR}/ - -# This gets the docs-tools and the mongoid docs from the mongoid repo. -# the assets are defined in the config/build_conf.yaml - -get-assets: - giza generate assets - -clean: - rm -rf build giza.log source-master diff --git a/conf-sitemap.xml b/conf-sitemap.xml deleted file mode 100644 index 1be77f4c..00000000 --- a/conf-sitemap.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 023892ed..00000000 --- a/entrypoint.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -ex - -if test -n "$1"; then - exec "$@" -else - make publish -fi diff --git a/snooty.toml b/snooty.toml index 07458bfa..ca122e1b 100644 --- a/snooty.toml +++ b/snooty.toml @@ -6,11 +6,16 @@ intersphinx = [ "https://www.mongodb.com/docs/manual/objects.inv", ] toc_landing_pages = [ - "/quick-start" + "/quick-start-sinatra" ] [constants] rails-6-version = 6.0 rails-7-version = 7.1 odm = "Mongoid" +version = "9.0" +full-version = "{+version+}.2" ruby-driver = "Ruby driver" +language = "Ruby" +quickstart-sinatra-app-name = "my-sinatra-app" +feedback-widget-title = "Feedback" diff --git a/source/Makefile b/source/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/source/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/source/README.md b/source/README.md deleted file mode 100644 index a3e415fa..00000000 --- a/source/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Mongoid Documentation -================================= - -This subdirectory contains the high-level driver documentation, including -tutorials and the reference. - -To build the documentation locally for review, install `sphinx` and -`sphinx-book-theme`, then execute `make html` in this directory: - - pip install 'sphinx<4.3' sphinx-book-theme - make html - -Note: sphinx 4.3 is currently breaking when trying to render Mongoid -documentation. diff --git a/source/conf.py b/source/conf.py deleted file mode 100644 index b634583a..00000000 --- a/source/conf.py +++ /dev/null @@ -1,57 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - - -# -- Project information ----------------------------------------------------- - -project = 'Mongoid' -copyright = '2021, MongoDB' - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'alabaster' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -source_suffix = { - '.txt': 'restructuredtext', -} - -html_theme = 'sphinx_book_theme' diff --git a/source/includes/quick-start/troubleshoot.rst b/source/includes/quick-start/troubleshoot.rst new file mode 100644 index 00000000..f23e5e43 --- /dev/null +++ b/source/includes/quick-start/troubleshoot.rst @@ -0,0 +1,6 @@ +.. note:: + + If you run into issues, ask for help in the + :community-forum:`MongoDB Community Forums <>` or submit feedback by using + the :guilabel:`{+feedback-widget-title+}` button in the upper right + corner of the page. diff --git a/source/index.txt b/source/index.txt index 282139a0..244c7194 100644 --- a/source/index.txt +++ b/source/index.txt @@ -12,7 +12,7 @@ MongoDB in Ruby. To work with {+odm+} from the command line using .. toctree:: :titlesonly: - /quick-start + /quick-start-sinatra installation-configuration tutorials schema-configuration diff --git a/source/meta/404.txt b/source/meta/404.txt deleted file mode 100644 index 4143ded8..00000000 --- a/source/meta/404.txt +++ /dev/null @@ -1,7 +0,0 @@ -:orphan: - -************** -File not found -************** - -The URL you requested does not exist or has been removed. diff --git a/source/quick-start.txt b/source/quick-start-sinatra.txt similarity index 59% rename from source/quick-start.txt rename to source/quick-start-sinatra.txt index 1ab513c0..60f5bd32 100644 --- a/source/quick-start.txt +++ b/source/quick-start-sinatra.txt @@ -1,8 +1,8 @@ -.. _mongoid-quick-start: +.. _mongoid-quick-start-sinatra: -=========== -Quick Start -=========== +===================== +Quick Start (Sinatra) +===================== .. facet:: :name: genre @@ -20,7 +20,7 @@ Quick Start Overview -------- -This guide shows you how to use {+odm+} in a new web application, +This guide shows you how to use {+odm+} in a new Sinatra web application, connect to a MongoDB cluster hosted on MongoDB Atlas, and perform read and write operations on the data in your cluster. @@ -34,6 +34,12 @@ read and write operations on the data in your cluster. Ruby. By using {+odm+}, you can easily interact with your data and create flexible data models. +Sinatra is a domain-specific language (DSL) for creating web +applications in {+language+}. Sinatra applications are simple to set up +and can provide faster request processing than other frameworks. + +.. TODO .. tip:: If you prefer to use Rails as your web framework, see the Quick Start (Rails) guide. + MongoDB Atlas is a fully managed cloud database service that hosts your MongoDB deployments. You can create your own free (no credit card required) MongoDB Atlas deployment by following the steps in this guide. @@ -48,11 +54,11 @@ that connects to a MongoDB deployment. .. toctree:: - /quick-start/download-and-install/ + /quick-start-sinatra/download-and-install/ -.. /quick-start/create-a-deployment/ -.. /quick-start/create-a-connection-string/ -.. /quick-start/configure-mongodb/ -.. /quick-start/view-data/ -.. /quick-start/write-data/ -.. /quick-start/next-steps/ +.. /quick-start-sinatra/create-a-deployment/ +.. /quick-start-sinatra/create-a-connection-string/ +.. /quick-start-sinatra/configure-mongodb/ +.. /quick-start-sinatra/view-data/ +.. /quick-start-sinatra/write-data/ +.. /quick-start-sinatra/next-steps/ diff --git a/source/quick-start-sinatra/download-and-install.txt b/source/quick-start-sinatra/download-and-install.txt new file mode 100644 index 00000000..2aff7826 --- /dev/null +++ b/source/quick-start-sinatra/download-and-install.txt @@ -0,0 +1,112 @@ +.. _mongoid-qs-download-and-install: + +==================== +Download and Install +==================== + +.. facet:: + :name: genre + :values: tutorial + +.. meta:: + :keywords: ruby framework, odm, code example + +Prerequisites +------------- + +To create the Quick Start application by using Sinatra, you need the +following software installed in your development environment: + +- `Ruby `__. +- `RubyGems package manager `__. +- A terminal app and shell. For MacOS users, use Terminal or a similar app. + For Windows users, use PowerShell. + +Download and Install the {+odm+} and Framework Gems +--------------------------------------------------- + +In {+language+}, packages are called **gems**. + +Complete the following steps to install and add the {+odm+} and Sinatra +gems to your web application. + +.. procedure:: + :style: connected + + .. step:: Install {+odm+} + + Ensure that the version of {+odm+} you install is compatible with the + version of {+language+} installed on your operating system. To + learn which versions are compatible, see the + :ref:`mongoid-compatibility` page. + + Run the following command to install the {+odm+} gem: + + .. code-block:: bash + + gem install mongoid + + When the installation completes, the command outputs the following + message: + + .. code-block:: none + :copyable: false + + Successfully installed mongoid-{+full-version+} + Parsing documentation for mongoid-{+full-version+} + Installing ri documentation for mongoid-{+full-version+} + Done installing documentation for mongoid after 1 seconds + 1 gem installed + + .. step:: Create a Quick Start application directory + + Run the following commands to generate a new directory + called ``{+quickstart-sinatra-app-name+}`` and enter it: + + .. code-block:: bash + + mkdir {+quickstart-sinatra-app-name+} + cd {+quickstart-sinatra-app-name+} + + .. step:: Create a ``Gemfile`` and add gems + + All {+language+} applications must have a ``Gemfile`` that lists + the required gems. Run the following command to create a + ``Gemfile`` in your application: + + .. code-block:: bash + + touch Gemfile + + Paste the following content into the ``Gemfile`` to add the + required gems: + + .. code-block:: ruby + + source 'https://rubygems.org' + + gem 'sinatra' + gem 'mongoid' + gem 'rackup' + + The ``rackup`` gem provides a web server interface for your + application. + + .. step:: Install gems + + Run the following command to install the specified gems into your + application: + + .. code-block:: bash + + gem install bundler + bundle install + + When the command runs successfully, the output in your + shell contains a ``Bundle complete!`` message and describes the + number of new gems installed. + + After completing these steps, you have a new Sinatra web application with + {+odm+} installed. + +.. include:: /includes/quick-start/troubleshoot.rst diff --git a/source/reference/compatibility.txt b/source/reference/compatibility.txt index 5fa7e60c..659fae45 100644 --- a/source/reference/compatibility.txt +++ b/source/reference/compatibility.txt @@ -1,10 +1,8 @@ -.. _compatibility: +.. _mongoid-compatibility: -************* +============= Compatibility -************* - -.. default-domain:: mongodb +============= .. contents:: On this page :local: @@ -13,7 +11,7 @@ Compatibility :class: singlecol Ruby MongoDB Driver Compatibility -================================= +--------------------------------- The following compatibility table specifies the versions of `Ruby driver for MongoDB `_ @@ -53,7 +51,7 @@ specified Mongoid versions. Ruby Compatibility -================== +------------------ The following compatibility table specifies the versions of Ruby interpreters supported by Mongoid. "D" in a column means support for that Ruby version @@ -216,7 +214,7 @@ is deprecated. MongoDB Server Compatibility -============================ +---------------------------- The following compatibility table specifies the recommended version(s) of Mongoid for use with a specific version of MongoDB server. @@ -309,7 +307,7 @@ and will be removed in a next version. .. _rails-compatibility: Rails Compatibility -=================== +------------------- The following compatibility table specifies which versions of Ruby on Rails are supported by Mongoid. @@ -428,7 +426,7 @@ are supported by Mongoid. .. include:: /includes/unicode-ballot-x.rst Rails Frameworks Support ------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~ Ruby on Rails is comprised of a number of frameworks, which Mongoid attempts to provide compatibility with wherever possible. diff --git a/worker.sh b/worker.sh deleted file mode 100644 index c615eb59..00000000 --- a/worker.sh +++ /dev/null @@ -1 +0,0 @@ -"build-and-stage-next-gen"