Module

PuduLangDocgen.References

View source

Unique identities and exchanged cross-reference maps

Functions

Name Description
registry References by identity: page identities first, then external maps. A page identity declared twice is an error; an external identity already known is skipped.
toYaml A cross-reference map as YAML, sorted by identity. Relative destinations are relative to the site root, which `baseUrl` names when it is not empty.
toJson A cross-reference map as JSON with the same fields as the YAML form.
parse References read from a YAML or JSON cross-reference map. Relative destinations resolve against the map's `baseUrl`, or else against the address the map was read from.
ofPages References of published pages that declare an identity.

registry

fn registry(own: &Array[Docgen.Reference], external: &Array[Docgen.Reference]) -> (Map[Str, Docgen.Reference], Array[Docgen.Diagnostic])

References by identity: page identities first, then external maps. A page identity declared twice is an error; an external identity already known is skipped.

Parameters

own
&Array[Docgen.Reference]
external
&Array[Docgen.Reference]

Returns

(Map[Str, Docgen.Reference], Array[Docgen.Diagnostic])

View source

toYaml

fn toYaml(references: &Array[Docgen.Reference], baseUrl: Str) -> Str

A cross-reference map as YAML, sorted by identity. Relative destinations are relative to the site root, which baseUrl names when it is not empty.

Parameters

references
&Array[Docgen.Reference]
baseUrl
Str

Returns

Str

View source

toJson

fn toJson(references: &Array[Docgen.Reference], baseUrl: Str) -> Str

A cross-reference map as JSON with the same fields as the YAML form.

Parameters

references
&Array[Docgen.Reference]
baseUrl
Str

Returns

Str

View source

parse

fn parse(origin: Str, text: Str) -> Result[Array[Docgen.Reference], Str]

References read from a YAML or JSON cross-reference map. Relative destinations resolve against the map's baseUrl, or else against the address the map was read from.

Parameters

origin
Str
text
Str

Returns

Result[Array[Docgen.Reference], Str]

View source

ofPages

fn ofPages(pages: &Array[Docgen.Page]) -> Array[Docgen.Reference]

References of published pages that declare an identity.

Parameters

pages
&Array[Docgen.Page]

Returns

Array[Docgen.Reference]

View source