发布于 2015-09-16 15:43:19 | 188 次阅读 | 评论: 0 | 来源: 网络整理

New in version 0.5.

This extension can generate automatic links to the documentation of objects in other projects.

Usage is simple: whenever Sphinx encounters a cross-reference that has no matching target in the current documentation set, it looks for targets in the documentation sets configured in :confval:`intersphinx_mapping`. A reference like :py:class:`zipfile.ZipFile` can then link to the Python documentation for the ZipFile class, without you having to specify where it is located exactly.

When using the “new” format (see below), you can even force lookup in a foreign set by prefixing the link target appropriately. A link like :ref:`comparison manual <python:comparisons>` will then link to the label “comparisons” in the doc set “python”, if it exists.

Behind the scenes, this works as follows:

  • Each Sphinx HTML build creates a file named objects.inv that contains a mapping from object names to URIs relative to the HTML set’s root.
  • Projects using the Intersphinx extension can specify the location of such mapping files in the :confval:`intersphinx_mapping` config value. The mapping will then be used to resolve otherwise missing references to objects into links to the other documentation.
  • By default, the mapping file is assumed to be at the same location as the rest of the documentation; however, the location of the mapping file can also be specified individually, e.g. if the docs should be buildable without Internet access.

To use intersphinx linking, add 'sphinx.ext.intersphinx' to your :confval:`extensions` config value, and use these new config values to activate linking:

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务