Skip to main content

Module path

Module path 

Source
Expand description

Path resolution (§3.2): a ./ or ../ target against the source document’s directory, and the canonical (no leading /) repo path.

Functions§

canonical_path
One leading / stripped (resolveDocPath’s path.replace(/^\//, "")).
doc_dir
The directory of a repo path: everything up to and including the last / ("a/b/" for a/b/c.md, "" at the root). The reference’s path.replace(/[^/]*$/, "").
resolve_relative
§3.2 (resolveRelativePath): a target starting with ./ or ../ is joined to doc_dir and normalized segment-wise — . and empty segments dropped, .. pops (past the root it is simply dropped); any other target is returned as is.