module cli.simplified_fct

Short summary

module pyquickhelper.cli.simplified_fct

Simplified function versions.

source on GitHub

Functions

function

truncated documentation

sphinx_rst

Converts a string from RST to HTML or RST format.

Documentation

Simplified function versions.

source on GitHub

pyquickhelper.cli.simplified_fct.sphinx_rst(input='', writer='html', keep_warnings=False, directives=None, language='en', layout='sphinx', output='output')[source]

Converts a string from RST to HTML or RST format.

Parameters:
  • input – text of filename

  • writer'html' for HTML format, 'rst' for RST format, 'md' for MD format, 'elatex' for latex format, 'doctree' to get the doctree, writer can also be a tuple for custom formats and must be like ('buider_name', builder_class).

  • keep_warnings – keep_warnings in the final HTML

  • directives – new directives to add, comma separated values

  • language – language

  • layout'docutils', 'sphinx', 'sphinx_body', see below.

  • output – document name, the function adds the extension

Returns:

output

Convert RST document into HTML

Converts RST documents into HTML or even RST.

<<<

python -m pyquickhelper sphinx_rst --help

>>>

usage: sphinx_rst [-h] [-i INPUT] [-w WRITER] [-k KEEP_WARNINGS]
                  [-d DIRECTIVES] [-l LANGUAGE] [-la LAYOUT] [-o OUTPUT]

Converts a string from *RST* to *HTML* or *RST* format.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        text of filename (default: )
  -w WRITER, --writer WRITER
                        ``'html'`` for `HTML` format, ``'rst'`` for `RST`
                        format, ``'md'`` for `MD` format, ``'elatex'`` for
                        `latex` format, ``'doctree'`` to get the doctree,
                        *writer* can also be a tuple for custom formats and
                        must be like ``('buider_name', builder_class)``.
                        (default: html)
  -k KEEP_WARNINGS, --keep_warnings KEEP_WARNINGS
                        keep_warnings in the final HTML (default: False)
  -d DIRECTIVES, --directives DIRECTIVES
                        new directives to add, comma separated values
                        (default: )
  -l LANGUAGE, --language LANGUAGE
                        language (default: en)
  -la LAYOUT, --layout LAYOUT
                        ``'docutils'``, ``'sphinx'``, ``'sphinx_body'``, see
                        below. (default: sphinx)
  -o OUTPUT, --output OUTPUT
                        document name, the function adds the extension
                        (default: output)

source on GitHub