Module
PuduLangDocgen.Paths
Publication paths and browser destinations share one policy
Functions
| Name | Description |
|---|---|
relative |
Whether a path names a confined, portable relative output. |
remote |
Whether a destination leaves the site: HTTP, HTTPS, or mail. |
href |
Whether a browser destination avoids executable schemes and ambiguous separators. |
pathOf |
The path of a destination without its query and fragment. |
suffixOf |
The query and fragment a destination carries after its path, including the separator. |
slug |
A stable lowercase fragment; text with no letters or digits answers `section`. |
output |
The published path of a source: Markdown and model files become pages, others keep their path. |
resolve |
A local destination resolved from a source file to a root-relative published path. Remote destinations pass through; escaping the root or naming an unsafe path is refused. |
directoryOf |
The directory part of a relative path; a top-level file answers the empty text. |
join |
A relative path joined under a directory, collapsing dot segments without leaving the root. |
between |
The browser path from one published page to another root-relative destination. |
rootOf |
The `../` prefix leading from a published page back to the site root. |
escape |
Text escaped for HTML content and quoted attributes. |
relative
fn relative(path: Str) -> Bool
Whether a path names a confined, portable relative output.
Parameters
pathStr
Returns
Bool
remote
fn remote(destination: Str) -> Bool
Whether a destination leaves the site: HTTP, HTTPS, or mail.
Parameters
destinationStr
Returns
Bool
href
fn href(destination: Str) -> Bool
Whether a browser destination avoids executable schemes and ambiguous separators.
Parameters
destinationStr
Returns
Bool
pathOf
fn pathOf(destination: Str) -> Str
The path of a destination without its query and fragment.
Parameters
destinationStr
Returns
Str
suffixOf
fn suffixOf(destination: Str) -> Str
The query and fragment a destination carries after its path, including the separator.
Parameters
destinationStr
Returns
Str
slug
fn slug(text: Str) -> Str
A stable lowercase fragment; text with no letters or digits answers section.
Parameters
textStr
Returns
Str
output
fn output(source: Str) -> Str
The published path of a source: Markdown and model files become pages, others keep their path.
Parameters
sourceStr
Returns
Str
resolve
fn resolve(source: Str, destination: Str) -> Result[Str, Str]
A local destination resolved from a source file to a root-relative published path. Remote destinations pass through; escaping the root or naming an unsafe path is refused.
Parameters
sourceStrdestinationStr
Returns
Result[Str, Str]
directoryOf
fn directoryOf(path: Str) -> Str
The directory part of a relative path; a top-level file answers the empty text.
Parameters
pathStr
Returns
Str
join
fn join(directory: Str, path: Str) -> Result[Str, Str]
A relative path joined under a directory, collapsing dot segments without leaving the root.
Parameters
directoryStrpathStr
Returns
Result[Str, Str]
between
fn between(from: Str, to: Str) -> Str
The browser path from one published page to another root-relative destination.
Parameters
fromStrtoStr
Returns
Str
rootOf
fn rootOf(page: Str) -> Str
The ../ prefix leading from a published page back to the site root.
Parameters
pageStr
Returns
Str
escape
fn escape(text: Str) -> Str
Text escaped for HTML content and quoted attributes.
Parameters
textStr
Returns
Str