Namespaces
Variants
Views
Actions

Difference between revisions of "Template:rl/doc"

From cppreference.com
(Added the documentation of {{l2tf}}. (Oops, the 'args' parameter of {{ltf}} was previously hidden due to forgetting to escape the = by using {{=}}.))
m (Grammar fix.)
Line 22: Line 22:
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size()|std::vector<T>}}}} results in the link: {{l2tt|cpp/container/vector/size|size()|std::vector<T>}}.
 
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size()|std::vector<T>}}}} results in the link: {{l2tt|cpp/container/vector/size|size()|std::vector<T>}}.
  
{{tl|l2tf|''page''|''title1'' {{mark optional}}|''title2'' {{mark optional}}|args{{=}}''arguments'' {{mark optional}}|suffix{{=}}''suffix'' {{mark optional}}}} - makes a link to a page using absolute path. The title is formed from the two last parts of the path with {{ttb|::}} be inserted between them. Each of these parts can be overridden by ''title1'' and ''title2''.  Link font is {{tt|teletype}}. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments'' and is followed by the optional ''suffix''.
+
{{tl|l2tf|''page''|''title1'' {{mark optional}}|''title2'' {{mark optional}}|args{{=}}''arguments'' {{mark optional}}|suffix{{=}}''suffix'' {{mark optional}}}} - makes a link to a page using absolute path. The title is formed from the two last parts of the path with {{ttb|::}} be inserted between them. Each of these parts can be overridden by ''title1'' and ''title2''.  Link font is {{tt|teletype}}. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments'' and are followed by the optional ''suffix''.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size}}}} results in the link: {{l2tf|cpp/container/vector/size}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size}}}} results in the link: {{l2tf|cpp/container/vector/size}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size|suffix=const}}}} results in the link: {{l2tf|cpp/container/vector/size|suffix=const}}.
 
: Example: {{tt|1={{l2tf{{!}}cpp/container/vector/size|suffix=const}}}} results in the link: {{l2tf|cpp/container/vector/size|suffix=const}}.

Revision as of 08:03, 22 January 2023

This is one of templates used to make links

Absolute links

{{lt|path|title (optional)}} - link to a page using absolute path. The default title is only the last part of the path. The link appears in normal font.

Example: {{lt|cpp/language/statements}} results in the link: statements.
Example: {{lt|cpp/language/statements|Labeled statements}} results in the link: Labeled statements.
Note: the previous example is just another way to create the same link using the standard template
[[cpp/language/statements|Labeled statements]], which also results in Labeled statements.

{{ltt|path|title (optional)}} - link to a page using absolute path. The default title is only the last part of the path. Link font is teletype.

Example: {{ltt|cpp/language/switch}} results in the link: switch.
Example: {{ltt|cpp/language/switch|switch(expr)}} results in the link: switch(expr).

{{ltf|path|title (optional)|args=arguments (optional)}} - link to a page using absolute path. The default title is only the last part of the path. Link font is teletype. Parentheses indicating function are appended, which enclose the optional arguments.

Example: {{ltf|cpp/error/terminate}} results in the link: terminate().
Example: {{ltf|cpp/error/terminate|std::terminate}} results in the link: std::terminate().
Example: {{ltf|cpp/error/set_terminate|std::set_terminate|args=nullptr}} results in the link: std::set_terminate(nullptr).

{{l2tt|page|title1 (optional)|title2 (optional)}} - makes a link to a page using absolute path. The title is formed from the two last parts of the path with :: be inserted between them. Each of these parts can be overridden by title1 and title2. Link font is teletype.

Example: {{l2tt|cpp/container/vector/size}} results in the link: vector::size.
Example: {{l2tt|cpp/container/vector/size|size() const}} results in the link: vector::size() const.
Example: {{l2tt|cpp/container/vector/size|size()|std::vector<T>}} results in the link: std::vector<T>::size().

{{l2tf|page|title1 (optional)|title2 (optional)|args=arguments (optional)|suffix=suffix (optional)}} - makes a link to a page using absolute path. The title is formed from the two last parts of the path with :: be inserted between them. Each of these parts can be overridden by title1 and title2. Link font is teletype. Parentheses indicating function are appended, which enclose the optional arguments and are followed by the optional suffix.

Example: {{l2tf|cpp/container/vector/size}} results in the link: vector::size().
Example: {{l2tf|cpp/container/vector/size|suffix=const}} results in the link: vector::size() const.
Example: {{l2tf|cpp/container/vector/size|size|std::vector<T>}} results in the link: std::vector<T>::size().

Relative links

{{rl|page|title (optional)}} - makes a link to a page relative to this page. The link appears in normal font.

{{rlp|page|title (optional)}} - makes a link to a page relative to the parent page. The link appears in normal font.

{{rlp|/|title}} - makes a link to the parent page. The link appears in normal font.

{{rlt|page|title (optional)}} - makes a link to a page relative to this page. The link appears in teletype font.

{{rlpt|page|title (optional)}} - makes a link to a page relative to the parent page. The link appears in teletype font.

{{rlpt|/|title}} - makes a link to the parent page. The link appears in teletype font.