@@ -9,25 +9,29 @@ jupyter:
9
9
10
10
11
11
The interlinks filter allows you to provide crossreferences within and between documentation.
12
- It requires of two parts :
12
+ It consists of three pieces :
13
13
14
- 1 . Specifying sphinx inventories for the filter to use in your quarto configuration.
15
- 2 . Generating sphinx inventories for the filter to use.
14
+ 1 . ** Install** : adding the extension to your quarto project.
15
+ 1 . ** Configure** : specifying sphinx inventories for the filter to use in your ` _quarto.yml ` config.
16
+ 2 . ** Run** : Generating sphinx inventories for the filter to use.
16
17
17
- ## What is a sphinx inventory file?
18
-
19
- Sphinx inventory files provide information about where the documentation for
20
- functions live on a website.
18
+ ## Installing
21
19
22
- Most sphinx sites name them ` object.inv ` :
20
+ Use the [ quarto add command] ( https://quarto.org/docs/extensions/filters.html#distribution )
21
+ to install the interlinks filter:
23
22
24
- * numpy: https://numpy.org/doc/stable/objects.inv
25
- * python: https://docs.python.org/3/objects.inv
23
+ ``` bash
24
+ quarto add machow/quartodoc
25
+ ```
26
26
27
+ :::{.callout-note}
28
+ The code for the filter can be found in quartodoc's
29
+ [ _ extension folder] ( https://github.com/machow/quartodoc/tree/main/_extensions/interlinks )
30
+ :::
27
31
28
32
## Configuring the interlinks filter
29
33
30
- Configure the filter in ` _quarto.yml ` or on specific pages:
34
+ Configure the filter in ` _quarto.yml ` or on specific pages, by adding these sections :
31
35
32
36
``` yaml
33
37
filters :
@@ -41,16 +45,17 @@ interlinks:
41
45
url : https://docs.python.org/3/
42
46
` ` `
43
47
44
- Notice 3 important pieces in this config:
48
+ Notice 2 important pieces in this config:
45
49
46
50
* The ` numpy` and `python` fields indicate that we're getting inventories for the
47
51
library numpy, and python builtin libraries.
48
52
* The `url` fields indicate where inventory files can be found.
49
- * The `fallback` field indicates where we should save the file, so we don't need
50
- to download it repeatedly.
51
53
54
+ By default, downloaded inventory files will be saved in the `_inv` folder of your
55
+ documentation directory.
52
56
53
- # # Generating sphinx inventories
57
+
58
+ # # Running the interlinks filter
54
59
55
60
First, build the reference for your own site, which includes an objects.json inventory :
56
61
@@ -127,6 +132,20 @@ For example, python.org has two entries for the name `print`.
127
132
| py | function | [ `` [](:py:function:`print`) `` ] ( :py:function:`print` ) |
128
133
129
134
135
+ ## What is a sphinx inventory file?
136
+
137
+ Sphinx inventory files provide information about where the documentation for
138
+ functions live on a website.
139
+
140
+ Most sphinx sites name them ` object.inv ` :
141
+
142
+ * numpy: https://numpy.org/doc/stable/objects.inv
143
+ * python: https://docs.python.org/3/objects.inv
144
+
145
+ See the [ sphobjinv docs] ( https://sphobjinv.readthedocs.io/en/stable/ ) for thorough
146
+ details on these files, and how they're used in sphinx.
147
+
148
+
130
149
## More information
131
150
132
151
Under the hood, quarto doc generates sphinx inventories for an API e using [ create_inventory] ( /api/#sec-create_inventory ) ,
0 commit comments