Skip to content

Commit 01163ad

Browse files
committed
Add intersphinx example
1 parent dd1e0fa commit 01163ad

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/_toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ chapters:
88
- file: notebooks
99
- file: markdown-notebooks
1010
- file: sphinx-hoverxref
11+
- file: intersphinx

docs/intersphinx.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Intersphinx
2+
3+
Behind the built-in Sphinx extension `intersphinx` is a powerful tool to reference sections in other Sphinx and Jupyter Book documentation projects.
4+
5+
You can configure mappings to external Sphinx projects in your Jupyter Book configuration, the `_config.yml` file. In this example project, we have configured `ebp` to reference `https://executablebooks.org/en/latest/`. In the following code examples, we refer to the configured `ebp` mapping and link directly to a section called `tools`.
6+
7+
```{tab} MyST (Markdown)
8+
9+
```{example}
10+
We can link to pages in other documentation projects.
11+
This is a link to the
12+
[Executable Book project's list of tools they build](ebp:tools)
13+
```
14+
15+
16+
```{tab} reStructuredText
17+
18+
```{example}
19+
20+
```{eval-rst}
21+
We can link to pages in other documentation projects.
22+
This is a link to the
23+
:doc:`Executable Book project's list of tools they build <ebp:tools>`
24+
```
25+
26+
```{note}
27+
In the above `reStructuredText` example, we use `{eval-rst}` to write reST inside a `.md` file (i.e. the one you are reading now). You only need to use this directive if you are writing reST code in a `.md` file.
28+
```

0 commit comments

Comments
 (0)