Jump to content

Module:Path/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
{{Module rating|alpha}} → {{Module rating|beta}}
No edit summary
Line 31: Line 31:
* <syntaxhighlight lang="wikitext" inline>[[Module:Path/example|{{#invoke:path|rel|Module:Path/example}}]]</syntaxhighlight>
* <syntaxhighlight lang="wikitext" inline>[[Module:Path/example|{{#invoke:path|rel|Module:Path/example}}]]</syntaxhighlight>
*: ↳ [[Module:Path/example|{{#invoke:path|rel|Module:Path/example}}]]
*: ↳ [[Module:Path/example|{{#invoke:path|rel|Module:Path/example}}]]
*:* See also {{tl|Subpage link}}


=== <code>sub</code> ===
=== <code>sub</code> ===
Line 46: Line 47:
* <syntaxhighlight lang="wikitext" inline>[[Module:Path/example|{{#invoke:path|sub|Module:Path/example}}]]</syntaxhighlight>
* <syntaxhighlight lang="wikitext" inline>[[Module:Path/example|{{#invoke:path|sub|Module:Path/example}}]]</syntaxhighlight>
*: ↳ [[Module:Path/example|{{#invoke:path|sub|Module:Path/example}}]]
*: ↳ [[Module:Path/example|{{#invoke:path|sub|Module:Path/example}}]]
*:* See also {{tl|Subpage link implicit}}


== See also ==
== See also ==

Revision as of 16:50, 5 September 2024

This module offers utilities to convert paths into different formats.

Functions

abs

This function converts the |1= argument into an absolute path.

Examples

  • {{#invoke:path|abs|./example}}
    ↳ Module:Path/doc/example
  • {{#invoke:path|abs|.}}
    ↳ Module:Path/doc
  • {{#invoke:path|abs|Wikipedia:Lua}}
    ↳ Wikipedia:Lua
  • {{#invoke:path|abs}}
    ↳ Module:Path/doc

rel

This function converts the |1= argument into a relative path.

Examples

  • {{#invoke:path|rel|Module:Path/example}}
    ↳ ../example
  • {{#invoke:path|rel|Module:Path}}
    ↳ ..
  • {{#invoke:path|rel|Wikipedia:Lua}}
    ↳ Wikipedia:Lua
  • {{#invoke:path|rel}}
    ↳ .
  • [[Module:Path/example|{{#invoke:path|rel|Module:Path/example}}]]
    ../example

sub

This function converts the |1= argument into a partial path with only the subpages shown.

Examples

  • {{#invoke:path|sub|Module:Path/example}}
    ↳ example
  • {{#invoke:path|sub|Module:Path}}
  • {{#invoke:path|sub|Wikipedia:Lua}}
    ↳ Wikipedia:Lua
  • {{#invoke:path|sub}}
  • [[Module:Path/example|{{#invoke:path|sub|Module:Path/example}}]]
    example

See also