|
| 1 | +# Navigation |
| 2 | + |
| 3 | +## File Navigation types |
| 4 | + |
| 5 | +### Isolated builds |
| 6 | + |
| 7 | +When building a signle repository's documentation, we are building the table of contents defined in `docset.yml` the root of which is represented by  `DocumentationSetNavigation` |
| 8 | + |
| 9 | +The table of contents is composed of a number of `NavigationItem`s. |
| 10 | + |
| 11 | +- `folder:`  `FolderNavigation` |
| 12 | +- `file:`  `FileNavigationLeaf` |
| 13 | + |
| 14 | +`docset.yml` may break up it's table of contents into multiple sub navigation's using nested `toc.yml` files. |
| 15 | + |
| 16 | +- `toc:`  TableOfContentsNavigation |
| 17 | + |
| 18 | +### Assembler builds |
| 19 | + |
| 20 | +The assembler build takes multiple `Isolated Build` navigations and recomposes it into a single  `SiteNavigation` navigation. |
| 21 | + |
| 22 | +This navigation is defined in [`navigation.yml`](https://github.com/elastic/docs-builder/blob/main/config/navigation.yml) |
| 23 | + |
| 24 | +An assembler build can only reference: |
| 25 | + |
| 26 | +-  `DocumentationSetNavigation` (using `<repository>://` crosslink) |
| 27 | +-  `TableOfContentsNavigation` (using `<repository>://<path/toc/folder>` crosslink) |
| 28 | + |
| 29 | +A new special root is created for asssembler builds: |
| 30 | + |
| 31 | +-  `SiteNavigation` |
| 32 | + |
| 33 | +## A Visual Example |
| 34 | + |
| 35 | +### Isolated builds |
| 36 | + |
| 37 | +Imagine we have the following `docset.yml` that defines two nested `toc.yml` files. |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +### Assembler builds |
| 42 | + |
| 43 | +Now we can break that navigation up into multiple sections of the wider site navigation. |
| 44 | + |
| 45 | +- `docs-content://api` |
| 46 | + - **`elastic-project://api`** |
| 47 | +- `docs-content://guides` |
| 48 | + - **`elastic-project://guides`** |
| 49 | +-  `elastic-client://` |
| 50 | + -  `elastic-client-node://` |
| 51 | + -  `elastic-client-dotnet://` |
| 52 | + -  `elastic-client-java://` |
| 53 | + |
| 54 | + |
| 55 | + `DocumentationSetNavigation` may arbitrary nest other |
| 56 | + `TableOfContentsNavigation` and visa versa. |
| 57 | + |
| 58 | +The only requirement is that each node in the navigation **MUST** define a unique `path_prefix`. |
| 59 | + |
| 60 | +#### A fully resolved navigation. |
| 61 | + |
| 62 | +When resolving the navigation, all the child navigation items will be included and the url will dynamically be `re-homed` to the root  `DocumentationSetNavigation` or  `TableOfContentsNavigation` that defines it. |
| 63 | + |
| 64 | + |
| 65 | + |
0 commit comments