Skip to main content

Sphinx extension with some autodoc features for any sources

Project description

Extension for gathering reST documentation from any files. This is a documenter from ext.autodoc.

In current state this extension will only insert reST docs from files to target documentation project without auto generation definitions and signatures.

But it simple and clean to make documentation for API and store documentation strings in the source code.

Install

pip install sphinxcontrib-autoanysrc

Usage

Add autoanysrc to extensions list:

extenstion = ['sphinx.ext.autodoc', 'sphinxcontrib.autoanysrc', ]

Example of usage:

.. autoanysrc:: directives
    :src: app/**/*.js
    :analyzer: js

Where:

  • src option is the pattern to list source files where docs are stored

  • analyzer option to determine witch analyzer must be used for processing this files

Directive will iterate over app/**/*.js files and process it line by line.

JSAnalyzer

Search comments blocks starts by /*””” and ends by */ (inspired by Nuulogic/sphinx-jsapidoc).

For example services.js:

/*"""
Services
````````

The function :func:`someService` does a some function.
*/

function someService(href, callback, errback) {
/*"""
.. function:: someService(href, callback[, errback])

    :param string href: An URI to the location of the resource.
    :param callback: Gets called with the object.
    :throws SomeError: For whatever reason in that case.
    :returns: Something.
*/
    return 'some result';
};

TODO

  • encoding option

  • allow internal indent in comment block

  • registering custom analyzers from settings

  • generate signatures like ext.autodoc…

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-autoanysrc-0.0.1dev-20141025.tar.gz (9.6 kB view details)

Uploaded Source

File details

Details for the file sphinxcontrib-autoanysrc-0.0.1dev-20141025.tar.gz.

File metadata

File hashes

Hashes for sphinxcontrib-autoanysrc-0.0.1dev-20141025.tar.gz
Algorithm Hash digest
SHA256 1acb1b0d7de2c70f104abe682dcb435808c8ef19a03f67b3dbce29a97f620eaa
MD5 2c5d3b27bc229a42e6d169ed0dea533a
BLAKE2b-256 c62ba6a6d9a4d74e5159d9f2f98754c92f00e85f7d3e01209b2e5677bdabe421

See more details on using hashes here.

Supported by

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