Expand description
Fuzzy path resolution and relative URL computation.
Wraps ContentGraph::resolve_path with typed results and provides
relative_url for generating correct relative links between files
using pretty URL format (directory-based).
Enums§
- Resolved
Ref - The result of resolving a reference against the content graph.
Functions§
- percent_
decode_ path - Percent-decode
%XXbyte sequences back to the on-disk name. The inverse ofpercent_encode_path_segments, and it lives next to it so the pair cannot drift. - percent_
encode_ path_ segments - Percent-encode a path, segment by segment, preserving
/as the separator. - percent_
encode_ url - URL-aware sibling of
percent_encode_path_segments. Splits at the first?or#, runs the segment encoder on the path portion, and re-attaches the query/fragment verbatim. Use this for any string that flows into an HTMLsrc=/href=attribute or a markdown[alt](url)link, where the caller cannot guarantee the value is a pure path. - relative_
asset_ path - Compute a relative URL from
from_path’s parent directory toto_path, preserving the target filename and extension. Each path segment is percent-encoded so spaces and non-ASCII characters round-trip safely through the markdown parser and HTML attribute boundaries. - relative_
url - Compute the relative URL from one file to another using pretty URL format.
- resolve_
reference - Resolve a reference string against the content graph.
- split_
url_ path - Split a URL into its path portion and any
?query/#fragmentsuffix. The split happens at the first occurrence of?or#(whichever appears first); if neither is present the suffix is empty. The suffix is returned verbatim, including the leading?/#.