Skip to content

Commit 331a2ac

Browse files
authored
Connect markdown and raw cell documentation regarding sphinx roles (#631)
1 parent 531f550 commit 331a2ac

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

doc/markdown-cells.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,20 @@
623623
"[example_python_function()](a-normal-rst-file.rst#example_python_function)\n",
624624
"```\n",
625625
"\n",
626-
"This is especially useful for use with the Sphinx [autodoc](https://www.sphinx-doc.org/en/master/ext/autodoc.html) extension!"
626+
"This is especially useful for use with the Sphinx [autodoc](https://www.sphinx-doc.org/en/master/ext/autodoc.html) extension!\n",
627+
"\n",
628+
"In some situations, you might prefer to have the default Sphinx formatting and checking in place when linking to domain objects.\n",
629+
"In such a case,\n",
630+
"[raw cells in \"reST\" format](raw-cells.ipynb#reST)\n",
631+
"could be an alternative worthwhile considering.\n",
632+
"They allow one to use any kind of Sphinx roles and directives inside a Jupyter Notebook."
627633
]
628634
}
629635
],
630636
"metadata": {
631637
"celltoolbar": "Raw Cell Format",
632638
"kernelspec": {
633-
"display_name": "Python 3",
639+
"display_name": "Python 3 (ipykernel)",
634640
"language": "python",
635641
"name": "python3"
636642
},
@@ -644,7 +650,7 @@
644650
"name": "python",
645651
"nbconvert_exporter": "python",
646652
"pygments_lexer": "ipython3",
647-
"version": "3.9.5"
653+
"version": "3.8.8"
648654
}
649655
},
650656
"nbformat": 4,

doc/raw-cells.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@
6161
"source": [
6262
"### reST\n",
6363
"\n",
64-
"Raw cells in \"reST\" format are interpreted as reStructuredText and parsed by Sphinx. The result is visible in both HTML and LaTeX output. "
64+
"Raw cells in \"reST\" format are interpreted as reStructuredText and parsed by Sphinx.\n",
65+
"Thus, you can e.g. use its\n",
66+
"[cross-referencing abilities](https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects)\n",
67+
"for automatically creating/updating links to the definition of modules, classes, functions, and similar.\n",
68+
"The result is visible in both HTML and LaTeX output."
6569
]
6670
},
6771
{
@@ -72,6 +76,8 @@
7276
"source": [
7377
"\"**I'm** a *raw cell* in reST_ format.\"\n",
7478
"\n",
79+
"I can contain Sphinx roles such as a link to :func:`example_python_function`.\n",
80+
"\n",
7581
".. _reST: https://www.sphinx-doc.org/rest.html"
7682
]
7783
},
@@ -152,7 +158,7 @@
152158
"metadata": {
153159
"celltoolbar": "Raw Cell Format",
154160
"kernelspec": {
155-
"display_name": "Python 3",
161+
"display_name": "Python 3 (ipykernel)",
156162
"language": "python",
157163
"name": "python3"
158164
},
@@ -166,7 +172,7 @@
166172
"name": "python",
167173
"nbconvert_exporter": "python",
168174
"pygments_lexer": "ipython3",
169-
"version": "3.5.1+"
175+
"version": "3.8.8"
170176
}
171177
},
172178
"nbformat": 4,

0 commit comments

Comments
 (0)