Шаблон:Markup
Этот шаблон используется, чтобы представить разметку или код рядом с результатом его применения.
Использование
Каждая ячейка в первой колонке ("Markup") использует <pre>, to retain newlines and spaces but styled to allow content to wrap within it. It is usually desirable to escape the content of these cells so that the markup is displayed by wrapping the markup in <nowiki>. It is technically not possible to add this feature to the template.
Каждая ячейка во второй колонке ("Renders as") скопирована из соответствующей ячейки "разметки" перед ней. Есть случаи, когда это может отличаться:
- Если первая строка содержит викиразметку, которая должна начать новую строку.
- Заголовки разметки, такой как
==покажет странице оглавления; will show in the page table of contents; use {{fake heading}}. - Some templates will place the page in a maintenance category, which is usually undesired:
- Instead of {{citation needed}}, use {{fake citation needed}}.
- Some templates may have error checking that places the page in a maintenance category. Suppress the category as possible:
- Шаблон:Cs1 templates can suppress the maintenance category by setting
|template doc demo=true.
- Шаблон:Cs1 templates can suppress the maintenance category by setting
Ограничение
<nowiki>
Если вы не поместите содержимое ячейки разметки в <nowiki>, then any template markup will not be escaped, it will be expanded.
This example shows the markup for {{tl|tag}}:
HTML entities
HTML entities are parsed in the markup cell:
To work around this, replace the & with & thus &nbsp; will show as
List and indent markup
If the first line includes wikimarkup that must start on a new line such as #, * or ; then use <nowiki />:
Examples
Simple
More complex
Note that Шаблон:Tl2's second argument here uses Шаблон:Tl2 and Шаблон:Tl2.
Multiple rows
With title
Showing rendered HTML
When a template is enclosed within {{code}}, it shows the rendered HTML: