Skip to main content

Sphinx extension to add a global table of contents to JSON output files.

Project description

sphinxcontrib-jsonglobaltoc

This Sphinx extension extends JSONHTMLBuilder from sphinxcontrib-serializinghtml to add a globaltoc key to each .fjson file produced. globaltoc will contain the HTML for the global table of contents for the entire set of documentation.

Getting It

You can get sphinxcontrib-jsonglobaltoc by using pip:

pip install sphinxcontrib-jsonglobaltoc

If you want to install it from source, grab the git repository from GitHub and run setup.py:

git clone git://github.com/caltechads/sphinxcontrib-jsonglobaltoc.git
cd sphinxcontrib-jsonglobaltoc
python setup.py install

Installing It

To enable sphinxcontrib-jsonglobaltoc in your Sphinx project, you need to add it to extensions list in your conf.py:

extensions = [
    ...
    'sphinx_json_globaltoc',
    ...
]

Using It

In your Sphinx docs folder, produce your jsonhtml output like so:

make json

Now if you open one of your .ftjson files and examine it, you should see a globaltoc key. For example:

>>> import json
>>> with open('build/json/index.fjson', encoding='utf-8') as index:
...     data = json.load(index)
>>> index['globaltoc']

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

sphinxcontrib-jsonglobaltoc-0.1.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

sphinxcontrib_jsonglobaltoc-0.1.0-py2.py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 2 Python 3

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