Files
odoo_source/doc/_extensions/autojsdoc/ext/__init__.py
T
Xavier Morel 313f69e948 [ADD] doc: JS document extraction system
* Fix a bunch of ill-documented/incomplete/incorrect method docs
* add start of Sphinx extension to extract & integrate jsdoc into
  Sphinx documentation:

  - parse JS files (and don't blow up), uses a fork of pyjsparser as
    the project currently does not parse comments
  - extract cross-module dependency information
  - parse JsDoc comments using pyjsdoc and infer structure from code &
    jsdoc
  - ``ast`` CLI printing a simplified AST of the input files
  - ``dependencies`` creating a dependency graph of either all modules
    in the provided input files or the modules matching the specified
    filters (warning: will not work if missing dependencies),
    generates a .dot file
  - ``extractor`` generating a plain text module documentation (mix of
    rst and markdown styles, not anything formal)
* sphinx extension with an "automodule" directive taking a module name
  and generating the documentation for it
2017-09-18 11:54:36 +02:00

14 lines
488 B
Python

# -*- coding: utf-8 -*-
from .directives import automodule_bound, autodirective_bound
from .extractor import _get_roots
def setup(app):
app.add_config_value('js_roots', _get_roots, 'env')
modules = {}
app.add_directive_to_domain('js', 'automodule', automodule_bound(app, modules)
)
autodirective = autodirective_bound(app, modules)
for n in ['autonamespace', 'automixin', 'autoclass', 'autofunction']:
app.add_directive_to_domain('js', n, autodirective)