diff --git a/.github/workflows/docs_test.yml b/.github/workflows/docs_test.yml index 24e1ca536..52c66bc0c 100644 --- a/.github/workflows/docs_test.yml +++ b/.github/workflows/docs_test.yml @@ -39,4 +39,25 @@ jobs: - name: Build the docs working-directory: docs - run: make html \ No newline at end of file + run: make html + + - name: Run Python snippets + run: | + python -c ' + from docutils.core import publish_doctree + from docutils import nodes + from docutils.parsers.rst import roles + + def dummy_role(name, rawtext, text, lineno, inliner, options=None, content=None): + return [nodes.Text(text)], [] + + roles.register_local_role("doc", dummy_role) + + rst = open("docs/source/user/first_mcdc.rst").read() + + for node in publish_doctree(rst).findall(nodes.literal_block): + if node.get("classes") == ["code", "python3"]: + print(node.astext()) + ' > tmp.py + cat -n tmp.py + python tmp.py \ No newline at end of file diff --git a/docs/source/user/first_mcdc.rst b/docs/source/user/first_mcdc.rst index 5c1d1ad92..ed76bd50f 100644 --- a/docs/source/user/first_mcdc.rst +++ b/docs/source/user/first_mcdc.rst @@ -207,7 +207,7 @@ and GPUs (AMD and Nvidia) and supports threading with MPI (Python or compiled mo Other guides are included to execute in these modes but for the sake of this first MC/DC simulation we will simply execute in Python mode (slower, no acceleration) simply with -.. code-block:: python3 +.. code-block:: bash python input.py