Exemplo n.º 1
0
def setup(builder):
    global html_formatter
    style = get_style_by_name(builder.config.root_get("modules.pygments.style"))
    html_formatter = HtmlFormatter(style=style)
    directives.register_directive("code-block", CodeBlock)
    directives.register_directive("sourcecode", CodeBlock)
    before_file_processed.connect(inject_stylesheet)
    before_build_finished.connect(write_stylesheet)
Exemplo n.º 2
0
def setup(builder):
    global html_formatter
    style = get_style_by_name(builder.config.root_get('modules.pygments.style'))
    html_formatter = HtmlFormatter(style=style)
    directives.register_directive('code-block', CodeBlock)
    directives.register_directive('sourcecode', CodeBlock)
    before_file_processed.connect(inject_stylesheet)
    before_build_finished.connect(write_stylesheet)
Exemplo n.º 3
0
def setup(builder):
    global html_formatter, css_filename
    style = get_style_by_name(builder.config.root_get('modules.pygments.style'))
    html_formatter = HtmlFormatter(style=style)
    directives.register_directive('code-block', CodeBlock)
    directives.register_directive('sourcecode', CodeBlock)
    css_filename = builder.config.root_get('modules.pygments.css_filename', css_filename)
    before_file_processed.connect(inject_stylesheet)
    before_build_finished.connect(write_stylesheet)
Exemplo n.º 4
0
def setup(builder):
    global html_formatter

    lexers_config = builder.config.root_get('modules.pygments.lexers', {})
    for config in lexers_config:
        language = config.keys()[0];
        CodeBlock.lexers_config[language] = config[language]

    style = get_style_by_name(builder.config.root_get('modules.pygments.style'))
    html_formatter = HtmlFormatter(style=style)
    directives.register_directive('code-block', CodeBlock)
    directives.register_directive('sourcecode', CodeBlock)
    before_file_processed.connect(inject_stylesheet)
    before_build_finished.connect(write_stylesheet)
Exemplo n.º 5
0
def setup(builder):
    global html_formatter

    lexers_config = builder.config.root_get('modules.pygments.lexers', {})
    for config in lexers_config:
        language = config.keys()[0]
        CodeBlock.lexers_config[language] = config[language]

    style = get_style_by_name(
        builder.config.root_get('modules.pygments.style'))
    html_formatter = HtmlFormatter(style=style)
    directives.register_directive('code-block', CodeBlock)
    directives.register_directive('sourcecode', CodeBlock)
    before_file_processed.connect(inject_stylesheet)
    before_build_finished.connect(write_stylesheet)