std::fs::canonicalize with the Windows verbatim prefix taken back
off (simplify_verbatim) — the spelling every path comparison,
display and %r in this crate speaks.
os.path.normpath over a posix-separated relative path: . and inner
.. collapse; a leading .. stays and walks out of the tree (a path
that simply will not exist).
Project.path2doc (sphinx/project.py:114-128) against Sphinx’s
defaultsource_suffix — {'.rst': 'restructuredtext'}
(config.py:243): the docname a source file under srcdir maps to, or
None for anything else.
urllib.parse.quote(s) with its default safe='/': every byte of the
UTF-8 encoding outside A-Za-z0-9, _.-~ and / becomes %XX
(upper-case hex). StandaloneHTMLBuilder.get_target_uri applies it to
a docname before appending the link suffix, so my page links as
my%20page.html and reads back as one token in an inventory line.
BuildEnvironment.relfn2path (environment/__init__.py:454-478): a
filename written in a document resolves relative to that document’s
directory, unless it is written absolute (/pic.png), in which case it
is relative to the source directory. The result is normalized (. and
.. collapsed, Sphinx’s os.path.normpath) and joined onto srcdir.
The srcdir-relative half of relfn2path: the normalized posix path
(relative to the source directory) that uri written in docname
refers to. Sphinx’s rel_fn return value.