Generate this documentation

See Generating the documention with pyquickhelper.

Configuration:

import sys
import os


source_path = os.path.normpath(
    os.path.join(
        os.path.abspath(
            os.path.split(__file__)[0])))

try:
    from conf_base import *
except ImportError:
    sys.path.append(source_path)
    from conf_base import *

Extensions to install

Tips

Module pyquickhelper defines sphinx command runpython which generates from a python script included in the documentation itself. The following snippet produces a table.

<<<

from pyquickhelper.pandashelper import df2rst
import pandas
df = pandas.DataFrame([{"x": 3, "y": 4}, {"x": 3.5, "y": 5}])
print(df2rst(df))

>>>

x y
3.0 4.0
3.5 5.0

The next one is more complex. The code produces titles, label and references. It requires Sphinx engine to be processed.

<<<

rows = []
list_title = ["T1", "T2", "T3"]
back = None
for t in list_title:
    rows.append("")
    rows.append(".. _l-fake_title-" + t + ":")
    rows.append("")
    rows.append(t * 3)
    rows.append("^" * len(t * 3))
    rows.append("")
    if back:
        rows.append("link :ref:`l-fake_title-" + back + "`")
    else:
        rows.append("no link")
    rows.append("")
    back = t
print("\n".join(rows))

>>>

T1T1T1

no link

T2T2T2

link T1T1T1

T3T3T3

link T2T2T2

Raw


.. _l-fake_title-T1:

T1T1T1
^^^^^^

no link


.. _l-fake_title-T2:

T2T2T2
^^^^^^

link :ref:`l-fake_title-T1`


.. _l-fake_title-T3:

T3T3T3
^^^^^^

link :ref:`l-fake_title-T2`