Invisible link to canonical for Microformats

path (slug)


slug.path

slug.path - path utilities

Small helpers for path composition and normalization.

TOC

Functions

abs(path)

fn slug.path#abs(path:str):str

Returns a normalized absolute path.

Parameter Type Default
path str

cwd()

fn slug.path#cwd():str

Returns the current process working directory.


join(parts)

fn slug.path#join(...parts):str

Joins path elements using the platform-specific separator.

Parameter Type Default
parts  

libRoot()

fn slug.path#libRoot():str

Returns the library root of the current module namespace.


localize(path)

fn slug.path#localize(path:str|nil):str|nil

If path starts with ‘project/’, ‘library/’ or ‘module/’ returns path new path with substitution, useful for config.

Parameter Type Default
path str | nil

moduleDir()

fn slug.path#moduleDir():str

Returns the directory of the current module file.


projectRoot()

fn slug.path#projectRoot():str

Returns the entry module directory.