Skip to content

Commit ed5d639

Browse files
authored
add reference to myst redirect in notebook (#127)
1 parent c96cada commit ed5d639

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

{{cookiecutter.project_name}}/docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
"numpy": ("https://numpy.org/doc/stable/", None),
9292
}
9393

94-
9594
# List of patterns, relative to source directory, that match files and
9695
# directories to ignore when looking for source files.
9796
# This pattern also affects html_static_path and html_extra_path.

{{cookiecutter.project_name}}/docs/notebooks/example.ipynb

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@
2727
"adata = AnnData(np.random.normal(size=(20, 10)))"
2828
]
2929
},
30+
{
31+
"cell_type": "markdown",
32+
"metadata": {},
33+
"source": [
34+
"With myst it is possible to link in the text cell of a notebook such as this one the documentation of a function or a class.\n",
35+
"\n",
36+
"Let's take as an example the function {func}`{{cookiecutter.package_name}}.pp.basic_preproc`. \n",
37+
"You can see that by clicking on the text, the link redirects to the API documentation of the function. \n",
38+
"Check the raw markdown of this cell to understand how this is specified.\n",
39+
"\n",
40+
"This works also for any package listed by `intersphinx`. Go to `docs/conf.py` and look for the `intersphinx_mapping` variable. \n",
41+
"There, you will see a list of packages (that this package is dependent on) for which this functionality is supported. \n",
42+
"\n",
43+
"For instance, we can link to the class {class}`anndata.AnnData`, to the attribute {attr}`anndata.AnnData.obs` or the method {meth}`anndata.AnnData.write`.\n",
44+
"\n",
45+
"Again, check the raw markdown of this cell to see how each of these links are specified.\n",
46+
"\n",
47+
"You can read more about this in the [intersphinx page](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) and the [myst page](https://myst-parser.readthedocs.io/en/v0.15.1/syntax/syntax.html#roles-an-in-line-extension-point)."
48+
]
49+
},
3050
{
3151
"cell_type": "code",
3252
"execution_count": 3,
@@ -57,7 +77,7 @@
5777
],
5878
"metadata": {
5979
"kernelspec": {
60-
"display_name": "Python 3",
80+
"display_name": "Python 3.9.12 ('squidpy39')",
6181
"language": "python",
6282
"name": "python3"
6383
},
@@ -71,7 +91,12 @@
7191
"name": "python",
7292
"nbconvert_exporter": "python",
7393
"pygments_lexer": "ipython3",
74-
"version": "3.8.13"
94+
"version": "3.9.12"
95+
},
96+
"vscode": {
97+
"interpreter": {
98+
"hash": "ae6466e8d4f517858789b5c9e8f0ed238fb8964458a36305fca7bddc149e9c64"
99+
}
75100
}
76101
},
77102
"nbformat": 4,

0 commit comments

Comments
 (0)