Ejemplo n.º 1
0
def setup(app):
    from balanced_docs import dcode

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]['cache'] = 'dcode.cache'
    dcode.DCodeDefaultDirective.registry['scenario'].update({
        'script':
        'scripts/lang-scenario.py -d scenarios -c scenario.cache',
        'section-chars':
        '~^',
        'lang': ['python', 'ruby', 'php', 'node', 'java'],
    })
    dcode.DCodeDefaultDirective.registry['endpoint'].update(
        {'script': 'scripts/rst.py endpoint'})
    dcode.DCodeDefaultDirective.registry['enum'].update(
        {'script': 'scripts/rst.py enum'})
    dcode.DCodeDefaultDirective.registry['error'].update(
        {'script': 'scripts/rst.py error'})
    dcode.DCodeDefaultDirective.registry['form'].update(
        {'script': 'scripts/rst.py form'})
    dcode.DCodeDefaultDirective.registry['view'].update(
        {'script': 'scripts/rst.py view'})

    app.add_directive('dcode-default', dcode.DCodeDefaultDirective)
    app.add_directive('dcode', dcode.DCodeDirective)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer('node', pygments.lexers.web.JavascriptLexer())

    app.connect('html-page-context', html_page_context)

    patch_admonition()
Ejemplo n.º 2
0
def setup(app):
    from balanced_docs import dcode

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]["cache"] = "dcode.cache"
    dcode.DCodeDefaultDirective.registry["scenario"].update(
        {
            "script": "scripts/lang-scenario.py -d clients/{0}/curl -c scenario.cache".format(
                os.environ.get("BALANCED_REV", "rev0")
            ),
            "section-chars": "~^",
            # TODO: remove when clients have been updated with scenarios for rev1
            "lang": ["python", "ruby", "php", "java"] if os.environ.get("BALANCED_REV", "rev0") == "rev0" else [],
        }
    )
    dcode.DCodeDefaultDirective.registry["endpoint"].update({"script": "scripts/rst.py endpoint"})
    dcode.DCodeDefaultDirective.registry["enum"].update({"script": "scripts/rst.py enum"})
    dcode.DCodeDefaultDirective.registry["error"].update({"script": "scripts/rst.py error"})
    dcode.DCodeDefaultDirective.registry["form"].update({"script": "scripts/rst.py form"})
    dcode.DCodeDefaultDirective.registry["view"].update({"script": "scripts/rst.py view"})

    app.add_directive("dcode-default", dcode.DCodeDefaultDirective)
    app.add_directive("dcode", dcode.DCodeDirective)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer("node", pygments.lexers.web.JavascriptLexer())

    app.connect("html-page-context", html_page_context)

    patch_admonition()
Ejemplo n.º 3
0
def setup(app):
    from balanced_docs import dcode
    from balanced_docs import lang_snippet

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]['cache'] = 'dcode.cache'
    dcode.DCodeDefaultDirective.registry['scenario'].update({
        'script': "scripts/lang-scenario.py -d clients/{0}/curl -c scenario.cache".format(os.environ.get('BALANCED_REV', 'rev1')),
        'section-include': ['request'],
        'section-filter-class': 'LangSectionFilter',
        # TODO: remove when clients have been updated with scenarios for rev1
        #'lang': ['python', 'ruby'],
    })
    dcode.DCodeDefaultDirective.registry['endpoint'].update({
        'script': 'scripts/rst.py endpoint'
    })
    dcode.DCodeDefaultDirective.registry['enum'].update({
        'script': 'scripts/rst.py enum'
    })
    dcode.DCodeDefaultDirective.registry['error'].update({
        'script': 'scripts/rst.py error'
    })
    dcode.DCodeDefaultDirective.registry['form'].update({
        'script': 'scripts/rst.py form'
    })
    dcode.DCodeDefaultDirective.registry['view'].update({
        'script': 'scripts/rst.py view'
    })
    
    lang_snippet.LangSnippet.langs = ['curl', 'python', 'ruby', 'java', 'csharp', 'php', 'node']
    lang_snippet.LangSnippet.client_dir = os.path.join(os.path.abspath('.'), 'clients')
    
    app.add_directive('dcode-default', dcode.DCodeDefaultDirective)
    app.add_directive('dcode', dcode.DCodeDirective)
    app.add_directive('snippet', lang_snippet.LangSnippet)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(ReadMoreWidget.name, ReadMoreWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer('android', pygments.lexers.jvm.JavaLexer())
    app.add_lexer('node', pygments.lexers.web.JavascriptLexer())
    app.add_lexer('objc', pygments.lexers.compiled.ObjectiveCLexer())
    app.add_lexer('csharp', pygments.lexers.dotnet.CSharpLexer())
    app.add_lexer('ruby-nohide', pygments.lexers.agile.RubyLexer())

    app.connect('html-page-context', html_page_context)

    patch_admonition()
Ejemplo n.º 4
0
def setup(app):
    from balanced_docs import dcode

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]['cache'] = 'dcode.cache'
    dcode.DCodeDefaultDirective.registry['scenario'].update({
        'script': "scripts/lang-scenario.py -d clients/{0}/curl -c scenario.cache".format(os.environ.get('BALANCED_REV', 'rev1')),
        'section-chars': '~^',
        'lang': ['ruby', 'python', 'node', 'java', 'php', 'csharp']
    })
    dcode.DCodeDefaultDirective.registry['endpoint'].update({
        'script': 'scripts/rst.py endpoint'
    })
    dcode.DCodeDefaultDirective.registry['enum'].update({
        'script': 'scripts/rst.py enum'
    })
    dcode.DCodeDefaultDirective.registry['query'].update({
        'script': 'scripts/rst.py query'
    })
    dcode.DCodeDefaultDirective.registry['error'].update({
        'script': 'scripts/rst.py error'
    })
    dcode.DCodeDefaultDirective.registry['form'].update({
        'script': 'scripts/rst.py form'
    })
    dcode.DCodeDefaultDirective.registry['view'].update({
        'script': 'scripts/rst.py view'
    })

    app.add_directive('dcode-default', dcode.DCodeDefaultDirective)
    app.add_directive('dcode', dcode.DCodeDirective)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer('node', pygments.lexers.web.JavascriptLexer())

    app.connect('html-page-context', html_page_context)

    patch_admonition()
Ejemplo n.º 5
0
def setup(app):
    from balanced_docs import dcode

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]['cache'] = 'dcode.cache'
    dcode.DCodeDefaultDirective.registry['scenario'].update({
        'script': "scripts/lang-scenario.py -d clients/{0}/curl -c scenario.cache".format(os.environ.get('BALANCED_REV', 'rev0')),
        'section-include': ['request'],
        'section-filter-class': 'LangSectionFilter',
        # TODO: remove when clients have been updated with scenarios for rev1
        'lang': ['python', 'ruby', 'php', 'java'] if os.environ.get('BALANCED_REV', 'rev0') == 'rev0' else [],
    })
    dcode.DCodeDefaultDirective.registry['endpoint'].update({
        'script': 'scripts/rst.py endpoint'
    })
    dcode.DCodeDefaultDirective.registry['enum'].update({
        'script': 'scripts/rst.py enum'
    })
    dcode.DCodeDefaultDirective.registry['error'].update({
        'script': 'scripts/rst.py error'
    })
    dcode.DCodeDefaultDirective.registry['form'].update({
        'script': 'scripts/rst.py form'
    })
    dcode.DCodeDefaultDirective.registry['view'].update({
        'script': 'scripts/rst.py view'
    })


    app.add_directive('dcode-default', dcode.DCodeDefaultDirective)
    app.add_directive('dcode', dcode.DCodeDirective)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer('node', pygments.lexers.web.JavascriptLexer())

    app.connect('html-page-context', html_page_context)

    patch_admonition()
Ejemplo n.º 6
0
def setup(app):
    from balanced_docs import dcode

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]['cache'] = 'dcode.cache'
    dcode.DCodeDefaultDirective.registry['scenario'].update({
        'script': 'scripts/lang-scenario.py -d scenarios -c scenario.cache',
        'section-include': ['request'],
        'section-filter-class': 'LangSectionFilter',
        'lang': ['python', 'ruby', 'php', 'node', 'java'],
    })
    dcode.DCodeDefaultDirective.registry['endpoint'].update({
        'script': 'scripts/rst.py endpoint'
    })
    dcode.DCodeDefaultDirective.registry['enum'].update({
        'script': 'scripts/rst.py enum'
    })
    dcode.DCodeDefaultDirective.registry['error'].update({
        'script': 'scripts/rst.py error'
    })
    dcode.DCodeDefaultDirective.registry['form'].update({
        'script': 'scripts/rst.py form'
    })
    dcode.DCodeDefaultDirective.registry['view'].update({
        'script': 'scripts/rst.py view'
    })


    app.add_directive('dcode-default', dcode.DCodeDefaultDirective)
    app.add_directive('dcode', dcode.DCodeDirective)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer('node', pygments.lexers.web.JavascriptLexer())

    app.connect('html-page-context', html_page_context)

    patch_admonition()
Ejemplo n.º 7
0
def setup(app):
    from balanced_docs import dcode

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]['cache'] = 'dcode.cache'
    dcode.DCodeDefaultDirective.registry['scenario'].update({
        'script':
        "scripts/lang-scenario.py -d clients/{0}/curl -c scenario.cache".
        format(os.environ.get('BALANCED_REV', 'rev0')),
        'section-include': ['request'],
        'section-filter-class':
        'LangSectionFilter',
        # TODO: remove when clients have been updated with scenarios for rev1
        'lang': ['python', 'ruby', 'php', 'java'] if os.environ.get(
            'BALANCED_REV', 'rev0') == 'rev0' else [],
    })
    dcode.DCodeDefaultDirective.registry['endpoint'].update(
        {'script': 'scripts/rst.py endpoint'})
    dcode.DCodeDefaultDirective.registry['enum'].update(
        {'script': 'scripts/rst.py enum'})
    dcode.DCodeDefaultDirective.registry['error'].update(
        {'script': 'scripts/rst.py error'})
    dcode.DCodeDefaultDirective.registry['form'].update(
        {'script': 'scripts/rst.py form'})
    dcode.DCodeDefaultDirective.registry['view'].update(
        {'script': 'scripts/rst.py view'})

    app.add_directive('dcode-default', dcode.DCodeDefaultDirective)
    app.add_directive('dcode', dcode.DCodeDirective)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer('node', pygments.lexers.web.JavascriptLexer())

    app.connect('html-page-context', html_page_context)

    patch_admonition()
Ejemplo n.º 8
0
def setup(app):
    from balanced_docs import dcode

    # dcode directive default registrations
    dcode.DCodeDefaultDirective.registry[None]["cache"] = "dcode.cache"
    dcode.DCodeDefaultDirective.registry["scenario"].update(
        {
            "script": "scripts/lang-scenario.py -d clients/{0}/curl -c scenario.cache".format(
                os.environ.get("BALANCED_REV", "rev1")
            ),
            "section-include": ["request"],
            "section-filter-class": "LangSectionFilter",
            # TODO: remove when clients have been updated with scenarios for rev1
            #'lang': ['python', 'ruby'],
        }
    )
    dcode.DCodeDefaultDirective.registry["endpoint"].update({"script": "scripts/rst.py endpoint"})
    dcode.DCodeDefaultDirective.registry["enum"].update({"script": "scripts/rst.py enum"})
    dcode.DCodeDefaultDirective.registry["error"].update({"script": "scripts/rst.py error"})
    dcode.DCodeDefaultDirective.registry["form"].update({"script": "scripts/rst.py form"})
    dcode.DCodeDefaultDirective.registry["view"].update({"script": "scripts/rst.py view"})

    app.add_directive("dcode-default", dcode.DCodeDefaultDirective)
    app.add_directive("dcode", dcode.DCodeDirective)
    app.add_directive(IconBoxWidget.name, IconBoxWidget)
    app.add_directive(ReadMoreWidget.name, ReadMoreWidget)
    app.add_directive(Span.name, Span)
    app.add_directive(Clear.name, Clear)
    app.add_directive(Gist.name, Gist)

    app.add_lexer("android", pygments.lexers.jvm.JavaLexer())
    app.add_lexer("node", pygments.lexers.web.JavascriptLexer())
    app.add_lexer("objc", pygments.lexers.compiled.ObjectiveCLexer())
    app.add_lexer("ruby-nohide", pygments.lexers.agile.RubyLexer())

    app.connect("html-page-context", html_page_context)

    patch_admonition()