Skip to main content

Generate fake Intersphinx inventory

Project description

Sometimes we create libraries so tiny that we don’t need write docs using Sphinx for them, but at the same time we may want to link them from other docs written using Sphinx.

This utility helps us to generate a fake objects.inv file (it’s also known as Sphinx inventory) so that other Sphinx docs can link it though the Intersphinx extension.

Installation

It’s uploaded to PyPI, so you can install it using pip:

$ pip install sphinx-fakeinv

Usage

Suppose you’ve just written a tiny module named foobar. You can generate a fake objects.inv for it by the following command:

$ sphinx-fakeinv foobar > objects.inv

The shinx-fakeinv program automatically scans the submodules, subpackages, and classes/functions/exceptions/variables in all of scanned modules/packages. (Note that it’s aware of __all__ list if there’s one.)

If you want to link it from other Sphinx docs, you need to manually add the url of it (of course you need to upload the generated fake objects.inv somewhere like gh-pages) to intersphinx_mapping configuration:

intersphinx_mapping = {
    'foobar': (
        'https://github.com/example/foobar',            # The project website
        'https://example.github.io/foobar/objects.inv'  # The fake inventory
    ),
}

That’s done! If you make references to foobar e.g.:

If :mod:`foobar` module is available at runtime this function will uses
internally :func:`foobar.baz()`.

Links in the above example like foobar and foobar.baz() will refer to https://github.com/example/foobar.

Author and license

Written by Hong Minhee. Distributed under GPLv3 or later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx-fakeinv-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

sphinx_fakeinv-1.0.0-py2.py3-none-any.whl (8.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sphinx-fakeinv-1.0.0.tar.gz.

File metadata

File hashes

Hashes for sphinx-fakeinv-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a97800b2ba4c57b31eb44636445b3a1a60f63606d371869efcbc83fdd2255183
MD5 1cb65864e5f674e78589d0d23ae3f0ce
BLAKE2b-256 82dc36e915fde5afdf91d0f5f26c2de25acb845e9e91e4f170ca3e27b8151bcd

See more details on using hashes here.

File details

Details for the file sphinx_fakeinv-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_fakeinv-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b8a75be5368056308867e4da1f3b5ec758a1dc172109d5d87c3ec2bc3fc49bdc
MD5 d2c2ca20101c3936c9dd67486535879f
BLAKE2b-256 1a04bf3ea9fac1857fce99d833081ee5aed76568c97f529c178c11ecfab906de

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page