Module

PuduLangDocgen.Paths

View source

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

path
Str

Returns

Bool

View source

remote

fn remote(destination: Str) -> Bool

Whether a destination leaves the site: HTTP, HTTPS, or mail.

Parameters

destination
Str

Returns

Bool

View source

href

fn href(destination: Str) -> Bool

Whether a browser destination avoids executable schemes and ambiguous separators.

Parameters

destination
Str

Returns

Bool

View source

pathOf

fn pathOf(destination: Str) -> Str

The path of a destination without its query and fragment.

Parameters

destination
Str

Returns

Str

View source

suffixOf

fn suffixOf(destination: Str) -> Str

The query and fragment a destination carries after its path, including the separator.

Parameters

destination
Str

Returns

Str

View source

slug

fn slug(text: Str) -> Str

A stable lowercase fragment; text with no letters or digits answers section.

Parameters

text
Str

Returns

Str

View source

output

fn output(source: Str) -> Str

The published path of a source: Markdown and model files become pages, others keep their path.

Parameters

source
Str

Returns

Str

View source

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

source
Str
destination
Str

Returns

Result[Str, Str]

View source

directoryOf

fn directoryOf(path: Str) -> Str

The directory part of a relative path; a top-level file answers the empty text.

Parameters

path
Str

Returns

Str

View source

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

directory
Str
path
Str

Returns

Result[Str, Str]

View source

between

fn between(from: Str, to: Str) -> Str

The browser path from one published page to another root-relative destination.

Parameters

from
Str
to
Str

Returns

Str

View source

rootOf

fn rootOf(page: Str) -> Str

The ../ prefix leading from a published page back to the site root.

Parameters

page
Str

Returns

Str

View source

escape

fn escape(text: Str) -> Str

Text escaped for HTML content and quoted attributes.

Parameters

text
Str

Returns

Str

View source