This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Attention!

Currently in early development stage

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:

extensions = ['sphinxcontrib.autoanysrc', ]

Example of usage:

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

Note

directive argument ‘blabla’ not used now, but it required by autodoc behaviour

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.

Custom analyzer

autoanysrc allow define custom analyzers.

Define custom analyzer (conf.py):

# make conf.py importtable
sys.path.insert(0, os.path.abspath('.'))

from sphinxcontrib.autoanysrc import analyzers

class CustomAnalyzer(analyzers.BaseAnalyzer):

    def process(self, content):
        """
        Must process content line by line

        :param content: processing file content
        :returns: generator of pairs docs line and line number
        """
        for lineno, srcline in enumerate(content.split('\n')):
            yield 'some parsed doc line from content', lineno


# put analyzer to the autonaysrc setting
autoanysrc_analyzers = {
    'my-custom': 'conf.CustomAnalyzer',
}

And use it:

.. autoanysrc:: blabla
    :src: ../src/*.js
    :analyzer: my-custom

Default analyzers

JSAnalyzer

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

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

Where 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
  • generate signatures like ext.autodoc…
Release History

Release History

0.0.3-20141120

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2-20141119

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1-20141119

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1-20141114

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1dev-20141025

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1dev-20141023

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sphinxcontrib-autoanysrc-0.0.3-20141120.tar.gz (10.8 kB) Copy SHA256 Checksum SHA256 Source Nov 20, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting