29. Convert doc strings the web pages¶
sasmodels.rst2html
¶
Convert a restructured text document to html.
Inline math markup can uses the math directive, or it can use latex style $expression$. Math can be rendered using simple html and unicode, or with mathjax.
-
sasmodels.rst2html.
can_use_qt
() → bool¶ Return True if QWebView exists.
Checks first in PyQt5 then in PyQt4
-
sasmodels.rst2html.
load_rst_as_html
(filename: str) → str¶ Load rst from file and convert to html
-
sasmodels.rst2html.
main
() → None¶ Command line interface to rst or html viewer.
-
sasmodels.rst2html.
qtview
(html: str, url: str = '') → QWebView¶ View HTML in a Qt dialog
-
sasmodels.rst2html.
replace_compact_fraction
(content)¶ Convert frac12 to frac{1}{2} for broken latex parsers
-
sasmodels.rst2html.
replace_dollar
(content)¶ Convert dollar signs to inline math markup in rst.
-
sasmodels.rst2html.
rst2html
(rst, part='whole', math_output='mathjax')¶ Convert restructured text into simple html.
Valid math_output formats for formulas include: - html - mathml - mathjax See http://docutils.sourceforge.net/docs/user/config.html#math-output for details.
The following part choices are available: - whole: the entire html document - html_body: document division with title and contents and footer - body: contents only
There are other parts, but they don’t make sense alone:
subtitle, version, encoding, html_prolog, header, meta, html_title, title, stylesheet, html_subtitle, html_body, body, head, body_suffix, fragment, docinfo, html_head, head_prefix, body_prefix, footer, body_pre_docinfo, whole
-
sasmodels.rst2html.
suppress_html_errors
()¶ Context manager for keeping error reports out of the generated HTML.
Within the context, system message nodes in the docutils parse tree will be ignored. After the context, the usual behaviour will be restored.
-
sasmodels.rst2html.
test_dollar
()¶ Test substitution of dollar signs with equivalent RST math markup
-
sasmodels.rst2html.
view_help
(filename: str, qt: bool = False) → None¶ View rst or html file. If qt use q viewer, otherwise use wx.
-
sasmodels.rst2html.
view_html
(html: str, url: str = '') → None¶ HTML viewer app in Qt
-
sasmodels.rst2html.
view_html_qtapp
(html: str, url: str = '') → None¶ HTML viewer app in Qt
-
sasmodels.rst2html.
view_html_wxapp
(html: str, url: str = '') → None¶ HTML viewer app in wx
-
sasmodels.rst2html.
view_url_qtapp
(url: str) → None¶ URL viewer app in Qt
-
sasmodels.rst2html.
view_url_wxapp
(url: str) → None¶ URL viewer app in wx
-
sasmodels.rst2html.
wxview
(html: str, url: str = '', size: Tuple[int, int] = (850, 540)) → 'wx.Frame'¶ View HTML in a wx dialog