Skip to content

DOCS-576 fix intersphinx linking, add nitpick option to build #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------

Expand Down
7 changes: 7 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions source/use-cases/metadata-and-asset-management.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ Procedure
`````````

The most common operations inside of a CMS center on creating and
editing content. Consider the following :py:meth:`<pymongo:pymongo.collection.Collection.insert>`
editing content. Consider the following
:py:meth:`insert() <pymongo:pymongo.collection.Collection.insert>`
operation:

.. code-block:: python
Expand Down Expand Up @@ -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() <python:datetime.utcnow>` in the
writing :py:meth:`datetime.utcnow() <python:datetime.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:
Expand Down
17 changes: 10 additions & 7 deletions source/use-cases/product-catalog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -525,24 +525,27 @@ per-connection or per-operation basis. In :api:`PyMongo
<python/current>`, set the :py:attr:`read_preference
<pymongo.collection.Collection.read_preference>` argument.

The :py:class:`SECONDARY <pymongo:pymongo.ReadPreference>` property in
the following example, permits reads from a :term:`secondary` (as well
as a primary) for the entire connection .
The
:py:attr:`SECONDARY <pymongo:pymongo.connection.Connection.read_preference>`
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
<pymongo:pymongo.ReadPreference>` read preference means that the
Conversely, the
:py:attr:`SECONDARY_ONLY <pymongo:pymongo.connection.Connection.read_preference>`
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
<pymongo.collection.Collection.read_preference>` for specific queries,
You can also specify
:py:attr:`read_preference <pymongo.collection.Collection.read_preference>`
for specific queries,
as follows:

.. code-block:: python
Expand Down
10 changes: 6 additions & 4 deletions source/use-cases/storing-log-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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() <pymongo:pymongo.collection.Collection.explain>`
the
:py:meth:`q_events.explain() <pymongo:pymongo.cursor.Cursor.explain>`
method in a Python console. This will return something that resembles:

.. code-block:: pycon
Expand Down Expand Up @@ -437,7 +438,8 @@ index using the following operation:

>>> db.events.ensure_index([('host', 1), ('time', 1)])

Use the :py:meth:`q_events.explain() <pymongo:pymongo.collection.Collection.explain>`
Use the
:py:meth:`q_events.explain() <pymongo:pymongo.cursor.Cursor.explain>`
operation to test the performance:

.. code-block:: pycon
Expand Down Expand Up @@ -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() <db.collection.aggregate()>` (and :dbcommand:`aggregate`
:term:`command <database command>`) offers greater flexibility,
capacity with less complexity than the existing :dbcommand:`mapreduce`
capacity with less complexity than the existing :dbcommand:`mapReduce <mapReduce>`
and :dbcommand:`group` aggregation.

Consider the following aggregation :term:`pipeline`: [#sql-aggregation-equivalents]_
Expand Down