Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malept/js-sphinx-inventory
Sphinx inventory generator for JavaScript & its popular libraries
https://github.com/malept/js-sphinx-inventory
Last synced: 4 days ago
JSON representation
Sphinx inventory generator for JavaScript & its popular libraries
- Host: GitHub
- URL: https://github.com/malept/js-sphinx-inventory
- Owner: malept
- License: apache-2.0
- Created: 2014-04-10T03:21:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-21T15:25:05.000Z (over 7 years ago)
- Last Synced: 2024-10-24T16:08:34.695Z (14 days ago)
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
=========================================================
Sphinx Inventory Generator for MDN's JavaScript Reference
=========================================================Uses the `Sphinx Inventory Writer`_ to generate a Sphinx inventory file for the
`Mozilla Developer Network`_'s `JavaScript Reference`_... _Sphinx Inventory Writer: https://github.com/malept/sphinx-inventory
.. _Mozilla Developer Network: https://developer.mozilla.org/
.. _JavaScript Reference: https://developer.mozilla.org/docs/Web/JavaScript/ReferenceRequirements
------------* CPython 2.7/3.3+ or PyPy
* The ``sphinx_inventory`` module (`Installation instructions`_)
.. _Installation instructions: https://github.com/malept/sphinx-inventory#installation
Usage
-----Make sure you're connected to the Internet, then run:
.. code-block:: shell-session
user@host:mdn-js-sphinx-inventory$ ./generate-inventory.py FILENAME
Where ``FILENAME`` is the path to the output file, like ``js-objects.inv``.
Once it's generated, you can use it in Sphinx-generated documentation via the
`intersphinx extension`_. Here is an example snippet of a Sphinx project's
``conf.py``:.. code-block:: python
# Inventory file location
mdn_inv = '/path/to/mdn-js-objects.inv'
# base URL
mdn_url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/'intersphinx_mapping = {
'mdn': (mdn_url, mdn_inv),
}In that project, JS objects/functions/etc., can be prefixed with ``mdn`` to be
recognized by the mapping. Example:.. code-block:: rst
.. js:function:: foo.bar([options])
:param options: Kind of like ``**kwargs`` in Python.
:type options: :mdn:class:`Object`.. _intersphinx extension: http://sphinx-doc.org/ext/intersphinx.html