Module:Path/doc
![]() | This is a documentation subpage for Module:Path. It may contain usage information, categories and other content that is not part of the original module page. |
This module offers utilities to convert paths into different formats.
Functions
Note: In all functions the |1=
argument can indifferently be a relative (i.e. beginning with ./
or ../
or /
) or an absolute path.
abs
The abs
function parses the |1=
argument and returns it as an absolute path.
Examples
- <syntaxhighlight lang="wikitext" inline>Module:Path/doc/example</syntaxhighlight>
- ↳ Module:Path/doc/example
- <syntaxhighlight lang="wikitext" inline>Module:Path/doc</syntaxhighlight>
- ↳ Module:Path/doc
- <syntaxhighlight lang="wikitext" inline>Wikipedia:Lua</syntaxhighlight>
- ↳ Wikipedia:Lua
- <syntaxhighlight lang="wikitext" inline>Module:Path/doc</syntaxhighlight>
- ↳ Module:Path/doc
rel
The rel
function parses the |1=
argument and returns it as a relative path.
Examples
- <syntaxhighlight lang="wikitext" inline>../example</syntaxhighlight>
- ↳ ../example
- <syntaxhighlight lang="wikitext" inline>..</syntaxhighlight>
- ↳ ..
- <syntaxhighlight lang="wikitext" inline>Wikipedia:Lua</syntaxhighlight>
- ↳ Wikipedia:Lua
- <syntaxhighlight lang="wikitext" inline>.</syntaxhighlight>
- ↳ .
- <syntaxhighlight lang="wikitext" inline>../example</syntaxhighlight>
- ↳ ../example
- See also {{Relative link}}
- ↳ ../example
sub
The sub
function parses the |1=
argument and returns it as a partial path with only the subpages shown.
Examples
- <syntaxhighlight lang="wikitext" inline>example</syntaxhighlight>
- ↳ example
- <syntaxhighlight lang="wikitext" inline></syntaxhighlight>
- ↳
- <syntaxhighlight lang="wikitext" inline>Wikipedia:Lua</syntaxhighlight>
- ↳ Wikipedia:Lua
- <syntaxhighlight lang="wikitext" inline></syntaxhighlight>
- ↳
- <syntaxhighlight lang="wikitext" inline>example</syntaxhighlight>
- ↳ example
- See also {{Relative link implicit}}
- ↳ example