From 72486b77b10c806a715f82b53abb833853d47952 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 4 Oct 2012 18:38:59 -0400 Subject: [PATCH 1/2] More cross linking cleanup fixing intersphinx links --- .../use-cases/metadata-and-asset-management.txt | 5 +++-- source/use-cases/product-catalog.txt | 17 ++++++++++------- source/use-cases/storing-log-data.txt | 10 ++++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/source/use-cases/metadata-and-asset-management.txt b/source/use-cases/metadata-and-asset-management.txt index 9c7599c9057..31241e58d11 100644 --- a/source/use-cases/metadata-and-asset-management.txt +++ b/source/use-cases/metadata-and-asset-management.txt @@ -150,7 +150,8 @@ Procedure ````````` The most common operations inside of a CMS center on creating and -editing content. Consider the following :py:meth:`` +editing content. Consider the following +:py:meth:`insert() ` operation: .. code-block:: python @@ -265,7 +266,7 @@ upon the basic update procedure: Because uploading the photo spans multiple documents and is a non-atomic operation, you must "lock" the file during upload by -writing :py:class:`datetime.utcnow() ` in the +writing :py:meth:`datetime.utcnow() ` in the record. This helps when there are multiple concurrent editors and lets the application detect stalled file uploads. This operation assumes that, for photo upload, the last update will succeed: diff --git a/source/use-cases/product-catalog.txt b/source/use-cases/product-catalog.txt index 0db11551d73..897245227db 100644 --- a/source/use-cases/product-catalog.txt +++ b/source/use-cases/product-catalog.txt @@ -525,24 +525,27 @@ per-connection or per-operation basis. In :api:`PyMongo `, set the :py:attr:`read_preference ` argument. -The :py:class:`SECONDARY ` property in -the following example, permits reads from a :term:`secondary` (as well -as a primary) for the entire connection . +The +:py:attr:`SECONDARY ` +property in the following example, permits reads from a +:term:`secondary` (as well as a primary) for the entire connection . .. code-block:: python conn = pymongo.Connection(read_preference=pymongo.SECONDARY) -Conversely, the :py:class:`SECONDARY_ONLY -` read preference means that the +Conversely, the +:py:attr:`SECONDARY_ONLY ` +read preference means that the client will only send read operation only to the secondary member .. code-block:: python conn = pymongo.Connection(read_preference=pymongo.SECONDARY_ONLY) -You can also specify :py:attr:`read_preference -` for specific queries, +You can also specify +:py:attr:`read_preference ` +for specific queries, as follows: .. code-block:: python diff --git a/source/use-cases/storing-log-data.txt b/source/use-cases/storing-log-data.txt index c5c7dc2a118..9033c887bb9 100644 --- a/source/use-cases/storing-log-data.txt +++ b/source/use-cases/storing-log-data.txt @@ -409,7 +409,8 @@ following command: >>> db.events.ensure_index([('time', 1), ('host', 1)]) To analyze the performance for the above query using this index, issue -the :py:meth:`q_events.explain() ` +the +:py:meth:`q_events.explain() ` method in a Python console. This will return something that resembles: .. code-block:: pycon @@ -437,7 +438,8 @@ index using the following operation: >>> db.events.ensure_index([('host', 1), ('time', 1)]) -Use the :py:meth:`q_events.explain() ` +Use the +:py:meth:`q_events.explain() ` operation to test the performance: .. code-block:: pycon @@ -489,9 +491,9 @@ Aggregation The :term:`aggregation framework` provides the capacity for queries that select, process, and aggregate results from large numbers of -documents. The :method:`aggregate()` (and :dbcommand:`aggregate` +documents. The :method:`aggregate() ` (and :dbcommand:`aggregate` :term:`command `) offers greater flexibility, -capacity with less complexity than the existing :dbcommand:`mapreduce` +capacity with less complexity than the existing :dbcommand:`mapReduce ` and :dbcommand:`group` aggregation. Consider the following aggregation :term:`pipeline`: [#sql-aggregation-equivalents]_ From 3b1b9e97e63c65390018d5ee72d9c6f29cb76ccc Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 5 Oct 2012 10:06:32 -0400 Subject: [PATCH 2/2] add nitpick option to makefile, add intersphinx mappings to conf.py --- conf.py | 5 ++++- makefile | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 2c5a4d66c4d..e6d68320718 100644 --- a/conf.py +++ b/conf.py @@ -97,7 +97,10 @@ 'hardlink' : ( 'http://docs.mongodb.org/' + current_git_branch + '/%s', '') } -intersphinx_mapping = {'pymongo': ('http://api.mongodb.org/python/current/', None)} +intersphinx_mapping = { + 'pymongo': ('http://api.mongodb.org/python/current/', None), + 'python' : ('http://docs.python.org/', None) + } # -- Options for HTML output --------------------------------------------------- diff --git a/makefile b/makefile index 55d059c6358..db093f3a1b4 100644 --- a/makefile +++ b/makefile @@ -35,6 +35,13 @@ endif # Sphinx variables. SPHINXOPTS = -c ./ SPHINXBUILD = sphinx-build + +ifdef NITPICK +timestamp := $(shell date +%Y%m%d%H%M) +SPHINXOPTS += -n +SPHINXOPTS += -w $(branch-output)/build.$(timestamp).log +endif + PAPER = letter PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter