Skip to content

Commit 732b7e7

Browse files
authored
Merge pull request #15 from machow/docs-interlinks
docs: flesh out interlinks page
2 parents 7f17155 + f6267c5 commit 732b7e7

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

docs/get-started/interlinks.qmd

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,46 @@ jupyter:
77
name: python3
88
---
99

10-
Coming soon!
10+
Coming soon! See the [interlinks folder](https://github.com/machow/quartodoc/tree/main/interlinks), which defines a WIP quarto filter for providing crossrefs.
1111

12-
See the [interlinks folder](https://github.com/machow/quartodoc/tree/main/interlinks), which defines a WIP quarto filter for providing crossrefs.
12+
The interlinks filter allows you to provide crossreferences within and between documentation.
13+
It requires of two parts:
14+
15+
1. Generating a sphinx inventory for your own docs.
16+
2. Specifying sphinx inventories for the filter to use in your quarto configuration.
17+
18+
## Generating a sphinx inventory
19+
20+
A sphinx inventory file, generated by [create_inventory](/api/#sec-create_inventory),
21+
and then dumped to JSON using [convert_inventory](/api/#sec-convert_inventory).
22+
23+
For an overview of the sphinx inventory format, see [the sphobjinv docs](https://sphobjinv.readthedocs.io)
24+
25+
## Configuring the interlinks filter
26+
27+
Configure the filter in `_quarto.yml` or on specific pages:
28+
29+
```
30+
filters:
31+
- interlinks
32+
interlinks:
33+
sources:
34+
numpy:
35+
url: https://numpy.org/doc/stable/
36+
inv: null
37+
fallback: objects_numpy.json
38+
python:
39+
url: https://docs.python.org/3/
40+
inv: null
41+
fallback: objects_python.json
42+
```
43+
44+
Where files like `objects_numpy.json` and `objects_python.json` are their inventories converted to JSON, using the functions from the section above.
45+
46+
`objects.inv` live at the root of sphinx project urls:
47+
48+
* numpy: https://numpy.org/doc/stable/objects.inv
49+
* python: https://docs.python.org/3/objects.inv
50+
51+
The rough idea is that this plugin will behave similar to [jupyterbook linking](https://jupyterbook.org/en/stable/content/references.html),
52+
which supports both some intersphinx syntax, but also markdown syntax.

docs/get-started/overview.qmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ jupyter:
77
name: python3
88
---
99

10+
::: {.callout-warning}
11+
quartodoc is work in progress! For a basic implementation, take a look at the [docs folder](https://github.com/machow/quartodoc/tree/main/docs) for this site,
12+
including [this script](https://github.com/machow/quartodoc/blob/main/docs/1_generate_api.py) used to generate API pages.
13+
:::
14+
1015
Coming soon!
1116

1217
## Goals

docs/index.qmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
title: "quartodoc"
33
---
44

5+
::: {.callout-warning}
6+
quartodoc is work in progress! For a basic implementation, take a look at the [docs folder](https://github.com/machow/quartodoc/tree/main/docs) for this site,
7+
including [this script](https://github.com/machow/quartodoc/blob/main/docs/1_generate_api.py) used to generate API pages.
8+
:::
9+
510
For users:
611

712
* Read and interact with docstrings.

0 commit comments

Comments
 (0)