How to use rst2html5 - 3 common examples

To help you get started, we’ve selected a few rst2html5 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 mgaitan / waliki_flask / waliki / __init__.py View on Github external
def _rst2html(self, source, source_path=None,
                  source_class=docutils.io.StringInput,
                  destination_path=None, reader=None, reader_name='standalone',
                  parser=None, parser_name='restructuredtext', writer=None,
                  writer_name=None, settings=None, settings_spec=None,
                  settings_overrides=None, config_section=None,
                  enable_exit_status=None):

        if not writer:
            writer = HTML5Writer()

        # Taken from Nikola
        # http://bit.ly/14CmQyh
        output, pub = docutils.core.publish_programmatically(
            source=source, source_path=source_path, source_class=source_class,
            destination_class=docutils.io.StringOutput,
            destination=None, destination_path=destination_path,
            reader=reader, reader_name=reader_name,
            parser=parser, parser_name=parser_name,
            writer=writer, writer_name=writer_name,
            settings=settings, settings_spec=settings_spec,
            settings_overrides=settings_overrides,
            config_section=config_section,
            enable_exit_status=enable_exit_status)
        return pub.writer.parts['body']
github everydo / zcms / zcms / utils.py View on Github external
'halt_level':6,
        'input_encoding':'UTF-8',
        'output_encoding':'UTF-8',
        'initial_header_level':1,
        'file_insertion_enabled':1,
        'raw_enabled':1,
        'writer_name':'html',
        'language_code':'zh_cn',
        'context':context,
        'request':request
    }

    parts = publish_parts(
        rst,
        source_path = path,
        writer=rst2html5.HTML5Writer(),
        settings_overrides = settings
    )
    return parts['body']
github mgaitan / waliki_flask / waliki / markup.py View on Github external
def _rst2html(self, source, source_path=None,
                  source_class=docutils.io.StringInput,
                  destination_path=None, reader=None, reader_name='standalone',
                  parser=None, parser_name='restructuredtext', writer=None,
                  writer_name=None, settings=None, settings_spec=None,
                  settings_overrides=None, config_section=None,
                  enable_exit_status=None):

        if not writer:
            writer = HTML5Writer()

        # Taken from Nikola
        # http://bit.ly/14CmQyh
        output, pub = docutils.core.publish_programmatically(
            source=source, source_path=source_path, source_class=source_class,
            destination_class=docutils.io.StringOutput,
            destination=None, destination_path=destination_path,
            reader=reader, reader_name=reader_name,
            parser=parser, parser_name=parser_name,
            writer=writer, writer_name=writer_name,
            settings=settings, settings_spec=settings_spec,
            settings_overrides=settings_overrides,
            config_section=config_section,
            enable_exit_status=enable_exit_status)
        return pub.writer.parts['body']

rst2html5

Generates (X)HTML5 documents from standalone reStructuredText sources

MIT
Latest version published 12 months ago

Package Health Score

53 / 100
Full package analysis

Popular rst2html5 functions