How to use the recommonmark.transform.AutoStructify function in recommonmark

To help you get started, we’ve selected a few recommonmark examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pvcaptest / pvcaptest / docs / conf.py View on Github external
def setup(app):
    app.add_config_value('recommonmark_config', {
            'url_resolver': lambda url: github_doc_root + url,
            'auto_toc_tree_section': 'Contents',
            }, True)
    app.add_transform(AutoStructify)
github OpenJij / OpenJij / docs / source / conf.py View on Github external
def setup(app):
    app.add_config_value('recommonmark_config', {
            'url_resolver': lambda url: github_doc_root + url,
            'auto_toc_tree_section': 'Contents',
            }, True)
    app.add_transform(AutoStructify)
github ondratu / formiko / formiko / renderer.py View on Github external
try:
    from docutils_tinyhtml import Writer as TinyWriter
except ImportError:
    TinyWriter = None

try:
    from docutils_html5 import Writer as Html5Writer
except ImportError:
    Html5Writer = None

try:
    from recommonmark.parser import CommonMarkParser
    from recommonmark.transform import AutoStructify, DummyStateMachine

    class StringStructify(AutoStructify):
        """Support AutoStructify for publish_string function."""
        def apply(self):
            """Apply the transformation by configuration."""
            file_name = self.document.settings.file_name

            self.url_resolver = self.config['url_resolver']
            assert callable(self.url_resolver)

            self.state_machine = DummyStateMachine()
            self.current_level = 0
            self.file_dir = abspath(dirname(file_name))
            self.root_dir = self.file_dir
            self.traverse(self.document)

    class ExtendCommonMarkParser(CommonMarkParser):
        """CommonMarkParser with working AutoStructify."""
github timkpaine / aat / docs / conf.py View on Github external
def setup(app):
    app.add_config_value('recommonmark_config', {
        'auto_toc_tree_section': 'Contents',
    }, True)
    app.add_transform(AutoStructify)
    app.connect('builder-inited', run_copyreadme)
    app.connect('builder-inited', run_apidoc)
github hyperledger / indy-plenum / docs / source / conf.py View on Github external
def setup(app):
    app.add_config_value('recommonmark_config', {
            'auto_toc_tree_section': 'Contents',
            }, True)
    app.add_transform(AutoStructify)
github bittremieux / spectrum_utils / docs / conf.py View on Github external
def setup(app):
    app.add_config_value('recommonmark_config', {
        'auto_toc_tree_section': 'Contents'}, True)
    app.add_transform(AutoStructify)
github dephell / dephell / docs / conf.py View on Github external
def setup(app):
    config = {
        # 'url_resolver': lambda url: github_doc_root + url,
        'auto_toc_tree_section': 'Contents',
        'enable_eval_rst': True,
    }
    app.add_config_value('recommonmark_config', config, True)
    app.add_transform(AutoStructify)
github humu / heapprof / docs_src / conf.py View on Github external
def setup(app):
    app.add_config_value(
        'recommonmark_config',
        {'enable_auto_toc_tree': True, 'auto_toc_tree_section': 'Contents'},
        True,
    )
    app.add_transform(AutoStructify)
github apache / incubator-tvm / nnvm / docs / conf.py View on Github external
def setup(app):
    # Add hook for building doxygen xml when needed
    # no c++ API for now
    app.connect("builder-inited", generate_doxygen_xml)
    app.add_config_value('recommonmark_config', {
        'url_resolver': lambda url: github_doc_root + url,
        'auto_doc_ref': True
            }, True)
    app.add_transform(AutoStructify)
github riptideio / pymodbus / doc / conf.py View on Github external
def setup(app):
    app.add_config_value('recommonmark_config', {
            'url_resolver': lambda url: github_doc_root + url,
            'auto_toc_tree_section': 'Contents',
            }, True)
    app.add_transform(AutoStructify)