Processes docstrings with Sphinx. Can also be used as a commandline script:
python sphinxify.py <text>
AUTHORS:
Generates a Sphinx configuration in directory.
INPUT:
EXAMPLES:
sage: from sagenb.misc.sphinxify import generate_configuration
sage: import tempfile, os
sage: tmpdir = tempfile.mkdtemp()
sage: generate_configuration(tmpdir)
sage: open(os.path.join(tmpdir, 'conf.py')).read()
'\n...extensions =...templates_path...source = False\n...'
Returns whether a string that contains Sphinx-style ReST markup.
INPUT:
OUTPUT:
Runs Sphinx on a docstring, and outputs the processed documentation.
INPUT:
OUTPUT:
EXAMPLES:
sage: from sagenb.misc.sphinxify import sphinxify
sage: sphinxify('A test')
'<div class="docstring">\n \n <p>A test</p>\n\n\n</div>'
sage: sphinxify('**Testing**\n`monospace`')
'<div class="docstring"...<strong>Testing</strong>\n<span class="math"...</p>\n\n\n</div>'
sage: sphinxify('`x=y`')
'<div class="docstring">\n \n <p><span class="math">x=y</span></p>\n\n\n</div>'
sage: sphinxify('`x=y`', format='text')
'x=y\n'
sage: sphinxify(':math:`x=y`', format='text')
'x=y\n'