Difference between revisions of "Template:rl/doc"
m (→Decorated links: +'_') |
m (→Absolute links: 1) Added documentation for {{lsd}}; 2) Applied {{tl params}}.) |
||
Line 2: | Line 2: | ||
====Absolute links==== | ====Absolute links==== | ||
− | {{tl|lt| | + | {{tl params|lt|path,title?}} - creates a 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: {{tt|1={{lt{{!}}cpp/language/statements}}}} results in the link: {{lt|cpp/language/statements}}. | : Example: {{tt|1={{lt{{!}}cpp/language/statements}}}} results in the link: {{lt|cpp/language/statements}}. | ||
: Example: {{tt|1={{lt{{!}}cpp/language/statements|Labeled statements}}}} results in the link: {{lt|cpp/language/statements|Labeled statements}}. | : Example: {{tt|1={{lt{{!}}cpp/language/statements|Labeled statements}}}} results in the link: {{lt|cpp/language/statements|Labeled statements}}. | ||
Line 8: | Line 8: | ||
: {{tt|[}}{{tt|1=[cpp/language/statements{{!}}Labeled statements}}{{tt|1=]]}}, which also results in [[cpp/language/statements|Labeled statements]]. | : {{tt|[}}{{tt|1=[cpp/language/statements{{!}}Labeled statements}}{{tt|1=]]}}, which also results in [[cpp/language/statements|Labeled statements]]. | ||
− | {{tl|ls| | + | {{tl params|ls|2=path,section,title?}} - creates a link to a ''section'' (or an anchor) in the page given by absolute ''path''. If ''title'' is not provided (which is the primary usage scenario), the ''section'' text is used as the title. The link appears in normal font. |
: Example: {{tt|1={{ls{{!}}cpp/language/function template{{!}}Abbreviated function template}}}} results in the link: {{ls|cpp/language/function template|Abbreviated function template}}. | : Example: {{tt|1={{ls{{!}}cpp/language/function template{{!}}Abbreviated function template}}}} results in the link: {{ls|cpp/language/function template|Abbreviated function template}}. | ||
: Example: {{tt|1={{ls{{!}}cpp/language/function template{{!}}Abbreviated function template{{!}}AFT}}}} results in the link: {{ls|cpp/language/function template|Abbreviated function template|AFT}}. | : Example: {{tt|1={{ls{{!}}cpp/language/function template{{!}}Abbreviated function template{{!}}AFT}}}} results in the link: {{ls|cpp/language/function template|Abbreviated function template|AFT}}. | ||
− | {{tl| | + | {{tl params|lsd|path,section}} ("lsd" stands for "Link to Section De-capitalized") - almost the same as {{tl|ls}} except it de-capitalizes the displayed section name. |
+ | : Example: {{tt|1={{lsd{{!}}cpp/language/array{{!}}Arrays of unknown bound}}}} results in the link: {{lsd|cpp/language/array|Arrays of unknown bound}}. | ||
+ | |||
+ | {{tl params|ltt|path,title?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}. | ||
: Example: {{tt|1={{ltt{{!}}cpp/language/switch}}}} results in the link: {{ltt|cpp/language/switch}}. | : Example: {{tt|1={{ltt{{!}}cpp/language/switch}}}} results in the link: {{ltt|cpp/language/switch}}. | ||
: Example: {{tt|1={{ltt{{!}}cpp/language/switch|switch(expr)}}}} results in the link: {{ltt|cpp/language/switch|switch(expr)}}. | : Example: {{tt|1={{ltt{{!}}cpp/language/switch|switch(expr)}}}} results in the link: {{ltt|cpp/language/switch|switch(expr)}}. | ||
− | {{tl|lti| | + | {{tl params|lti|path,title?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}} in ''italic''. |
: Example: {{tt|1={{lti{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{lti|cpp/concepts/boolean-testable}}. | : Example: {{tt|1={{lti{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{lti|cpp/concepts/boolean-testable}}. | ||
− | {{tl|ltf| | + | {{tl params|ltf|2=path,title?,args=arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}. Parentheses indicating ''function'' are appended, which enclose the optional ''arguments''. |
: Example: {{tt|1={{ltf{{!}}cpp/error/terminate}}}} results in the link: {{ltf|cpp/error/terminate}}. | : Example: {{tt|1={{ltf{{!}}cpp/error/terminate}}}} results in the link: {{ltf|cpp/error/terminate}}. | ||
: Example: {{tt|1={{ltf{{!}}cpp/error/terminate|std::terminate}}}} results in the link: {{ltf|cpp/error/terminate|std::terminate}}. | : Example: {{tt|1={{ltf{{!}}cpp/error/terminate|std::terminate}}}} results in the link: {{ltf|cpp/error/terminate|std::terminate}}. | ||
: Example: {{tt|1={{ltf{{!}}cpp/error/set_terminate|std::set_terminate|args=nullptr}}}} results in the link: {{ltf|cpp/error/set_terminate|std::set_terminate|args=nullptr}}. | : Example: {{tt|1={{ltf{{!}}cpp/error/set_terminate|std::set_terminate|args=nullptr}}}} results in the link: {{ltf|cpp/error/set_terminate|std::set_terminate|args=nullptr}}. | ||
− | {{tl|ltp| | + | {{tl params|ltp|2=path,title?,targs=template arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''. |
: Example: {{tt|1={{ltp{{!}}cpp/container/vector}}}} results in the link: {{ltp|cpp/container/vector}}. | : Example: {{tt|1={{ltp{{!}}cpp/container/vector}}}} results in the link: {{ltp|cpp/container/vector}}. | ||
: Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=int}}}} results in the link: {{ltp|cpp/container/vector|targs=int}}. | : Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=int}}}} results in the link: {{ltp|cpp/container/vector|targs=int}}. | ||
: Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=std::size_t}}}} results in the link: {{ltp|cpp/container/vector|targs=std::size_t}}. | : Example: {{tt|1={{ltp{{!}}cpp/container/vector|targs=std::size_t}}}} results in the link: {{ltp|cpp/container/vector|targs=std::size_t}}. | ||
− | {{tl|ltpi| | + | {{tl params|ltpi|2=path,title?,targs=template arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}, and the template name is in ''italic''. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''. |
: Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable}}. | : Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable}}. | ||
: Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable|targs=int}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable|targs=int}}. | : Example: {{tt|1={{ltpi{{!}}cpp/concepts/boolean-testable|targs=int}}}} results in the link: {{ltpi|cpp/concepts/boolean-testable|targs=int}}. | ||
− | {{tl|ltpf| | + | {{tl params|ltpf|2=path,title?,targs=template arguments?,args=arguments?}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is {{tt|teletype}}. Angle brackets indicating ''template'' are appended, which enclose the optional ''template arguments''. After that, parentheses indicating ''function'' are appended, which enclose the optional ''arguments''. |
: Example: {{tt|1={{ltpf{{!}}cpp/container/vector/vector|targs=int|args=5}}}} results in the link: {{ltpf|cpp/container/vector/vector|targs=int|args=5}}. | : Example: {{tt|1={{ltpf{{!}}cpp/container/vector/vector|targs=int|args=5}}}} results in the link: {{ltpf|cpp/container/vector/vector|targs=int|args=5}}. | ||
: Example: {{tt|1={{ltpf{{!}}cpp/locale/use_facet|targs=Facet|args=loc}}}} results in the link: {{ltpf|cpp/locale/use_facet|targs=Facet|args=loc}}. | : Example: {{tt|1={{ltpf{{!}}cpp/locale/use_facet|targs=Facet|args=loc}}}} results in the link: {{ltpf|cpp/locale/use_facet|targs=Facet|args=loc}}. | ||
− | {{tl|l2tt| | + | {{tl params|l2tt|page,title1?,title2?}} - creates 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}}. |
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size}}}} results in the link: {{l2tt|cpp/container/vector/size}}. | : Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size}}}} results in the link: {{l2tt|cpp/container/vector/size}}. | ||
: Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size() const}}}} results in the link: {{l2tt|cpp/container/vector/size|size() const}}. | : Example: {{tt|1={{l2tt{{!}}cpp/container/vector/size|size() const}}}} results in the link: {{l2tt|cpp/container/vector/size|size() const}}. | ||
: 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| | + | {{tl params|l2tf|2=page,title1?,title2?,args=arguments?,suffix=suffix?}} - creates 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:20, 12 September 2023
Contents |
This is one of templates used to make links
Absolute links
{{lt|path |title (optional)}} - creates a 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.
{{ls|path |section |title (optional)}} - creates a link to a section (or an anchor) in the page given by absolute path. If title is not provided (which is the primary usage scenario), the section text is used as the title. The link appears in normal font.
- Example:
{{ls|cpp/language/function template|Abbreviated function template}}
results in the link: no section name. - Example:
{{ls|cpp/language/function template|Abbreviated function template|AFT}}
results in the link: no section name.
{{lsd|path |section }} ("lsd" stands for "Link to Section De-capitalized") - almost the same as {{ls}} except it de-capitalizes the displayed section name.
- Example:
{{lsd|cpp/language/array|Arrays of unknown bound}}
results in the link: no section name.
{{ltt|path |title (optional)}} - creates a 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).
{{lti|path |title (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is teletype
in italic.
- Example:
{{lti|cpp/concepts/boolean-testable}}
results in the link: boolean-testable.
{{ltf|path |title (optional)|args=arguments (optional)}} - creates a 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).
{{ltp|path |title (optional)|targs=template arguments (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is teletype
. Angle brackets indicating template are appended, which enclose the optional template arguments.
- Example:
{{ltp|cpp/container/vector}}
results in the link: vector<>. - Example:
{{ltp|cpp/container/vector|targs=int}}
results in the link: vector<int>. - Example:
{{ltp|cpp/container/vector|targs=std::size_t}}
results in the link: vector<std::size_t>.
{{ltpi|path |title (optional)|targs=template arguments (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is teletype
, and the template name is in italic. Angle brackets indicating template are appended, which enclose the optional template arguments.
- Example:
{{ltpi|cpp/concepts/boolean-testable}}
results in the link: boolean-testable <>. - Example:
{{ltpi|cpp/concepts/boolean-testable|targs=int}}
results in the link: boolean-testable <int>.
{{ltpf|path |title (optional)|targs=template arguments (optional)|args=arguments (optional)}} - creates a link to a page using absolute path. The default title is only the last part of the path. Link font is teletype
. Angle brackets indicating template are appended, which enclose the optional template arguments. After that, parentheses indicating function are appended, which enclose the optional arguments.
- Example:
{{ltpf|cpp/container/vector/vector|targs=int|args=5}}
results in the link: vector<int>(5). - Example:
{{ltpf|cpp/locale/use_facet|targs=Facet|args=loc}}
results in the link: use_facet<Facet>(loc).
{{l2tt|page |title1 (optional)|title2 (optional)}} - creates 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)}} - creates 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().
Absolute links with prefix std::
The following convenience templates generate links whose titles begin with std::
. They can be used in places where {{lc}} fails to generate a link.
{{ltt std|path}} - link to a page using absolute path. The title is std::
followed by the last part of the path. Link font is teletype
.
- Example:
{{ltt std|cpp/container/mdspan}}
results in the link: std::mdspan.
{{ltf std|path}} - link to a page using absolute path. The title is std::
followed by the last part of the path and parentheses indicating function. Link font is teletype
.
- Example:
{{ltf std|cpp/io/print}}
results in the link: std::print().
{{l2tt std|path}} - link to a page using absolute path. The title is std::
followed by the last two parts of the path joined by ::
. Link font is teletype
.
- Example:
{{l2tt std|cpp/utility/basic_stacktrace/current}}
results in the link: std::basic_stacktrace::current.
{{l2tf std|path}} - link to a page using absolute path. The title is std::
followed by the last two parts of the path joined by ::
and parentheses indicating function. Link font is teletype
.
- Example:
{{l2tf std|cpp/utility/expected/value}}
results in the link: std::expected::value().
Relative links
{{rl|page|title (optional)}} - makes a link to a page relative to this 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.
{{rli|page|title (optional)}} - makes a link to a page relative to this page. The link appears in teletype
font in italic.
{{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.
{{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.
{{rlpi|page|title (optional)}} - makes a link to a page relative to the parent page. The link appears in teletype
font in italic.
{{rlpi|/|title}} - makes a link to the parent page. The link appears in teletype
font in italic.
{{rlpf|page|title (optional)|args=arguments (optional)}} - makes a link to a page relative to the parent page. The link appears in teletype
font. Parentheses indicating function are appended, which enclose the optional arguments.
{{ttt|identifier}} - makes a link to the current page (via the #top link). The identifier appears in teletype
font.
Decorated links
{{attr|1=attribute|2=title (optional)|3=additional_title (optional)|lang (optional)=get_lang}}
- Nameless param 1 - an attribute specifier name.
- Nameless param 2 (optional) - an attribute specifier title.
- Nameless param 3 (optional) - additional elements after the title.
- Param lang (optional) - language: cpp or c. If lang is not given, {{get lang}} is used.
- Example:
{{attr|assume}}
results in[[assume]]
. - Example:
{{attr|noreturn|_Noreturn|lang=c}}
results in[[_Noreturn]]
. - Example:
{{attr|deprecated|3=("because")}}
results in[[deprecated("because")]]
.