Skip to content

Commit b182e2f

Browse files
committed
start on navigation documentation
1 parent 1c7917a commit b182e2f

11 files changed

+233
-0
lines changed
Lines changed: 101 additions & 0 deletions
Loading
110 KB
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 49 additions & 0 deletions
Loading
41.9 KB
Loading
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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](images/bullet-documentation-set-navigation.svg) `DocumentationSetNavigation`
8+
9+
The table of contents is composed of a number of `NavigationItem`s.
10+
11+
- `folder:` ![FolderNavigation](images/bullet-folder-navigation.svg) `FolderNavigation`
12+
- `file:` ![FileNavigationLeaf](images/bullet-file-navigation-leaf.svg) `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](images/bullet-table-of-contents-navigation.svg) TableOfContentsNavigation
17+
18+
### Assembler builds
19+
20+
The assembler build takes multiple `Isolated Build` navigations and recomposes it into a single ![SiteNavigation](images//bullet-site-navigation.svg) `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](images/bullet-documentation-set-navigation.svg) `DocumentationSetNavigation` (using `<repository>://` crosslink)
27+
- ![TableOfContentsNavigation](images/bullet-table-of-contents-navigation.svg) `TableOfContentsNavigation` (using `<repository>://<path/toc/folder>` crosslink)
28+
29+
A new special root is created for asssembler builds:
30+
31+
- ![SiteNavigation](images//bullet-site-navigation.svg) `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+
![Isolated Build](images/isolated-build-tree.svg)
40+
41+
### Assembler builds
42+
43+
Now we can break that navigation up into multiple sections of the wider site navigation.
44+
45+
- ![TableOfContentsNavigation](images/bullet-table-of-contents-navigation.svg)`docs-content://api`
46+
- ![TableOfContentsNavigation](images/bullet-table-of-contents-navigation.svg)**`elastic-project://api`**
47+
- ![TableOfContentsNavigation](images/bullet-table-of-contents-navigation.svg)`docs-content://guides`
48+
- ![TableOfContentsNavigation](images/bullet-table-of-contents-navigation.svg)**`elastic-project://guides`**
49+
- ![DocumentationSetNavigation](images/bullet-documentation-set-navigation.svg) `elastic-client://`
50+
- ![DocumentationSetNavigation](images/bullet-documentation-set-navigation.svg) `elastic-client-node://`
51+
- ![DocumentationSetNavigation](images/bullet-documentation-set-navigation.svg) `elastic-client-dotnet://`
52+
- ![DocumentationSetNavigation](images/bullet-documentation-set-navigation.svg) `elastic-client-java://`
53+
54+
55+
![DocumentationSetNavigation](images/bullet-documentation-set-navigation.svg) `DocumentationSetNavigation` may arbitrary nest other
56+
![TableOfContentsNavigation](images/bullet-table-of-contents-navigation.svg) `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](images/bullet-documentation-set-navigation.svg) `DocumentationSetNavigation` or ![TableOfContentsNavigation](images/bullet-table-of-contents-navigation.svg) `TableOfContentsNavigation` that defines it.
63+
64+
![Assembler Build](images/assembler-build-tree.svg)
65+

0 commit comments

Comments
 (0)