@@ -5,14 +5,15 @@ runpython
55Description
66===========
77
8- Location: :py: class: `RunPythonDirective <sphinx_runpython.runpython.sphinx_runpython_extension.RunPythonDirective> `.
8+ Location: :class: `RunPythonDirective <sphinx_runpython.runpython.sphinx_runpython_extension.RunPythonDirective> `.
99
1010In *conf.py *:
1111
1212::
1313
1414 extensions = [ ...
15- 'sphinx_runpython.runpython.sphinxext_runpython_extension']
15+ 'sphinx_runpython.runpython',
16+ ]
1617
1718Documentation means many examples which needs to be updated when a change
1819happen unless the documentation runs the example itself and update its output.
@@ -55,7 +56,8 @@ modules.
5556
5657 for i, mod in [sphinx, pandas, numpy]:
5758 print("* version of *{0}*: *{1}*".format(
58- getattr(mod, "__name__"), getattr(mod, "__version__"))
59+ getattr(mod, "__name__"), getattr(mod, "__version__"
60+ ))
5961
6062.. runpython ::
6163 :rst:
@@ -100,7 +102,7 @@ Applied to images...
100102 ax.plot([0, 1], [0, 1], '--')
101103 fig.savefig(os.path.join(__WD__, "oo.png"))
102104
103- text = ".. image:: oo.png\\\\n :width: 202px "
105+ text = ".. image:: oo.png"
104106 print(text)
105107
106108The image needs to be save in the same folder than
@@ -114,7 +116,7 @@ the *rst* file.
114116 ax.plot([0, 1], [0, 1], '--')
115117 fig.savefig(os.path.join(__WD__, "oo.png"))
116118
117- text = ".. image:: oo.png\\\\ n :width: 201px"
119+ text = ".. image:: oo.png\n :width: 201px"
118120 print(text)
119121
120122Option ``:toggle: `` can hide the code or the output or both
@@ -182,4 +184,11 @@ hide the source and a couple of other options.
182184Interesting functions
183185=====================
184186
185- .. autofunction :: sphinx_runpython.runpython.run_cmd
187+ .. autofunction :: sphinx_runpython.runpython.run_cmd
188+
189+ .. autofunction :: sphinx_runpython.runpython.sphinx_runpython_extension.remove_extra_spaces_and_pep8
190+
191+ Directive
192+ =========
193+
194+ .. autoclass :: sphinx_runpython.runpython.sphinx_runpython_extension.RunPythonDirective
0 commit comments