|
| 1 | +(xref-reference)= |
| 2 | +# MyST `xref` reference |
| 3 | + |
| 4 | +This page provides serves some reference information about JupyterBook 2 / MyST xref usage in our documentation ecosystem. |
| 5 | +Specifically, this page includes: |
| 6 | + * our approach for avoiding circularity of xrefs (e.g., if book 1 and book 2 xref each other, and both have updates, the build order can potentially impact the freshness of the content that shows up in each) |
| 7 | + * canonical labels and links used for our most common `xrefs`. |
| 8 | + |
| 9 | +# `xref` "levels" |
| 10 | + |
| 11 | +A resource at a given "level" (listed below) should only xref to resources at numerically lower levels. |
| 12 | +For example, Level 2 resources should only xref to resources in Levels 0 or 1. |
| 13 | + |
| 14 | +This information is used when documentation is rebuilt. |
| 15 | +Builds are performed in numeric order of the levels - so first all Level 0 resources build, then all Level 1 resources, and so on. |
| 16 | +This is particularly important for xref-embedded content: it ensures that most recent version of content is embedded in a Level N resource from a Level N-1 resource when the Level N resource is built. |
| 17 | +An example of this is the glossary, which is [embedded in *Using QIIME 2*](https://github.com/rachis-org/using-qiime2/blob/main/book/back-matter/glossary.md?plain=1) and [in amplicon-docs](https://github.com/qiime2/amplicon-docs/blob/main/docs/back-matter/glossary.md?plain=1) through an xref to content in [*Rachis News*](https://github.com/rachis-org/news.rachis.org/blob/main/blog/glossary.md?plain=1). |
| 18 | + |
| 19 | +Build order within a level is not important. |
| 20 | + |
| 21 | +## Level 0: unversioned resources |
| 22 | + |
| 23 | +| Name | Description | Target | URL | |
| 24 | +| ---- | ----------- | ------ | --- | |
| 25 | +| `rachis` news | glossary source (and potentially other broadly referenced source content in the future) | `rachis-news-target` | <https://news.rachis.org/en/latest/> | |
| 26 | +| library | plugin references | `rachis-library-target` | <https://library.qiime2.org> | |
| 27 | + |
| 28 | +## Level 1: framework references |
| 29 | + |
| 30 | +| Name | Description | Target | URL | |
| 31 | +| ---- | ----------- | ------ | --- | |
| 32 | +| Developing with QIIME 2 | developer manual | `developing-with-rachis-target` | <https://develop.qiime2.org/en/latest/> | |
| 33 | +| Using QIIME 2 | rachis user manual | `using-rachis-target` | <https://use.qiime2.org/en/latest/> | |
| 34 | + |
| 35 | +## Level 2: data-set focused tutorials |
| 36 | + |
| 37 | +| Name | Description | Target | URL | |
| 38 | +| ---- | ----------- | ------ | --- | |
| 39 | +| Gut-to-soil tutorial | user-focused QIIME 2 tutorial | `gut-to-soil-target` | <https://gut-to-soil-tutorial.readthedocs.io/en/latest/> | |
| 40 | +| Moving pictures tutorial | user-focused QIIME 2 tutorial | `moving-pictures-target` | <https://moving-pictures-tutorial.readthedocs.io/en/latest/> | |
| 41 | + |
| 42 | +## Level 3: Examples of distribution and plugin documentation |
| 43 | + |
| 44 | +At this moment, this is the highest level of xref, so nothing xrefs into these. |
| 45 | +For that reason, canonical targets aren't yet defined. |
| 46 | + |
| 47 | +| Name | Description | Target | URL | |
| 48 | +| ---- | ----------- | ------ | --- | |
| 49 | +| amplicon-docs | QIIME 2 user manual | *no target defined* | <https://amplicon-docs.qiime2.org/en/latest/> | |
| 50 | +| moshpit docs | MOSHPIT user manual | *no target defined* | <https://moshpit.qiime2.org/en/latest/> | |
| 51 | +| genome-sampler docs | `genome-sampler` documentation | *no target defined* | <https://genome-sampler.readthedocs.io/en/latest/> | |
| 52 | +| q2-fmt docs | `q2-fmt` documentation | *no target defined* | <https://q2-fmt.readthedocs.io/en/latest/> | |
| 53 | + |
| 54 | + |
| 55 | +# Miscellaneous notes |
| 56 | + |
| 57 | + * Remember that anchors can be found in the `myst.xref.json` at the top-level of the target's URL, for example: <https://news.rachis.org/en/latest/myst.xref.json>. |
| 58 | + * [MyST xref docs](https://mystmd.org/guide/website-metadata#myst-xref-json) |
| 59 | + * [MyST cross-referencing docs](https://mystmd.org/guide/cross-references) |
0 commit comments