{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example notebook" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from anndata import AnnData\n", "import cell2module" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "adata = AnnData(np.random.normal(size=(20, 10)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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", "\n", "Let's take as an example the function {func}`cell2module.pp.basic_preproc`. \n", "You can see that by clicking on the text, the link redirects to the API documentation of the function. \n", "Check the raw markdown of this cell to understand how this is specified.\n", "\n", "This works also for any package listed by `intersphinx`. Go to `docs/conf.py` and look for the `intersphinx_mapping` variable. \n", "There, you will see a list of packages (that this package is dependent on) for which this functionality is supported. \n", "\n", "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", "\n", "Again, check the raw markdown of this cell to see how each of these links are specified.\n", "\n", "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)." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Implement a preprocessing function here." ] }, { "data": { "text/plain": [ "0" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cell2module.pp.basic_preproc(adata)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.9.12 ('squidpy39')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" }, "vscode": { "interpreter": { "hash": "ae6466e8d4f517858789b5c9e8f0ed238fb8964458a36305fca7bddc149e9c64" } } }, "nbformat": 4, "nbformat_minor": 4 }