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’spath.replace(/^\//, "")). - doc_dir
- The directory of a repo path: everything up to and including the last
/("a/b/"fora/b/c.md,""at the root). The reference’spath.replace(/[^/]*$/, ""). - resolve_
relative - §3.2 (
resolveRelativePath): a target starting with./or../is joined todoc_dirand normalized segment-wise —.and empty segments dropped,..pops (past the root it is simply dropped); any other target is returned as is.