Skip to main content

relfn2path

Function relfn2path 

Source
pub fn relfn2path(uri: &str, docname: &str, srcdir: &Path) -> PathBuf
Expand description

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.

Shared home (wave 4.5): the image dependency collector (crate::env::dependencies) and the include directive’s sphinx-mode path rewrite (sphinx/directives/other.py:413-416) both resolve through this port.