Module
PuduLangDocgen.Navigation.Resolve
Tables of contents bound to published pages
Types
| Name | Description |
|---|---|
Links |
Where a table of contents may point |
Candidate |
A published table of contents competing to govern pages |
Functions
| Name | Description |
|---|---|
resolve |
Items of the table of contents at a project-relative path with every destination made root-relative to the published site. Folder links and links to other tables of contents bring in those items as children. |
outputOf |
The published path of a table of contents: its source path ending in `toc.json`. |
governing |
The table of contents governing a page, or the empty text. Tables that link the page win, lower `order` first and then the nearest folder; otherwise the nearest table in a folder holding the page is used, again preferring lower `order`. |
pagesOf |
Local pages a tree links, without fragments. |
trail |
The items from the top of a tree down to the deepest one linking a page; a group that links its first page yields to that page's own item. |
neighbors |
The pages before and after a page in reading order, when it is listed. |
readingOrder |
Local pages in the order a reader meets them, each listed once. |
resolve
fn resolve(path: Str, links: &Links) -> (Array[Docgen.TocItem], Array[Docgen.Diagnostic])
Items of the table of contents at a project-relative path with every destination made root-relative to the published site. Folder links and links to other tables of contents bring in those items as children.
Parameters
pathStrlinks&Links
Returns
(Array[Docgen.TocItem], Array[Docgen.Diagnostic])
outputOf
fn outputOf(path: Str) -> Str
The published path of a table of contents: its source path ending in toc.json.
Parameters
pathStr
Returns
Str
governing
The table of contents governing a page, or the empty text. Tables that link the page win,
lower order first and then the nearest folder; otherwise the nearest table in a folder
holding the page is used, again preferring lower order.
Parameters
pageStrcandidates&Array[Candidate]
Returns
Str
pagesOf
fn pagesOf(items: &Array[Docgen.TocItem]) -> Array[Str]
Local pages a tree links, without fragments.
Parameters
items&Array[Docgen.TocItem]
Returns
Array[Str]
trail
fn trail(items: &Array[Docgen.TocItem], page: Str) -> Array[Docgen.TocItem]
The items from the top of a tree down to the deepest one linking a page; a group that links its first page yields to that page's own item.
Parameters
items&Array[Docgen.TocItem]pageStr
Returns
Array[Docgen.TocItem]
neighbors
fn neighbors(items: &Array[Docgen.TocItem], page: Str) -> (Option[Docgen.TocItem], Option[Docgen.TocItem])
The pages before and after a page in reading order, when it is listed.
Parameters
items&Array[Docgen.TocItem]pageStr
Returns
(Option[Docgen.TocItem], Option[Docgen.TocItem])
readingOrder
fn readingOrder(items: &Array[Docgen.TocItem]) -> Array[Docgen.TocItem]
Local pages in the order a reader meets them, each listed once.
Parameters
items&Array[Docgen.TocItem]
Returns
Array[Docgen.TocItem]