Helpful info for editing
Contents |
[edit] Overview
Most of the content in this wiki is wrapped in wiki templates, some of which are simple, and some... less so. They do most of the formatting and help to aggregate the repetitive stuff in one place, so when something has to be modified, there is no need to make the same modification numerous times.
You can use the text formatting markup syntax found on Wikipedia's cheatsheet (see also:Help:Editing), however there are also templates available that are generally preferred, as listed on the Help:Templates page.
In general, you can see how templates and markup is used by choosing an existing page and changing to edit
mode to see how it was created.
[edit] More Help
If you need additional help, you can do one of the following:
- Ask by adding text to the Cppreference talk:FAQ discussion page
- Join cpplang on Slack, then join the cppreference channel and ask on there.
[edit] Text Formatting
See the template help for Formatting.
The most common mono-spaced-font (teletype
) template, for example, is {{tlc|tt| {{tt|text}}.
[edit] Links
For external links, use the Wikipedia syntax.
For internal links, see the template help for Links.
One commonly used auto-linking template is lc, which is used for known identifiers. For example {{lc|std::vector}}
will create a link to the page as well as display it in teletype
font, as: std::vector.
[edit] Code
See the template help for Syntax-Highlighting.
The {{c|1=code}}
is commonly used for inline code, and if the code contains no "=", the "1=" can be omitted. For example {{c|true}}
and {{c|false}}
are frequently used for return values true and false.
[edit] Gotchas and Quirks
- Within wiki template brace sections, the wiki engine sometimes gets confused by the "
=
" symbol; use{{=}}
to overcome this issue. - The
{{!
=}}
template does not display "!
=
", but rather "|=
", and likewise{{!
}}
displays "|
". Use!{{
=}}
instead.
[edit] Repetitive Content
Some classes/types have a common set of sub-pages because they have the same (or nearly the same) API. For example std::condition_variable and std::condition_variable_any have nearly identical APIs, with the same descriptions and explanations for most of the functions.
To avoid repeating the same text, and avoid fixing things in multiple places, they use custom templates for their sub-pages. For example, if you go to the page for condition_variable::notify_one(), you will see a full page of information, but if you click edit you'll only see an include
template. The actual content was generated by its template.
Such template use for sub-pages can be tricky, and is too complicated to explain here. If you can't figure it out from the current use-cases, ask for help - see the "More help" section above.