Меню
Главная
Случайная статья
Настройки
|
Содержание
Этот шаблон используется, чтобы представить разметку или код рядом с результатом его применения.
Использование
Каждая ячейка в первой колонке ("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:
- Some templates may have error checking that places the page in a maintenance category. Suppress the category as possible:
Ограничение
Если вы не поместите содержимое ячейки разметки в <nowiki> , then any template markup will not be escaped, it will be expanded.
This example shows the markup for {{tl|tag}}:
Renders as |
Expected rendering
|
|
{{tl|tag}}
|
|
|
HTML entities are parsed in the markup cell:
Nowikied markup shows as |
Expected markup
|
–
|
–
|
|
|
To work around this, replace the & with & thus &nbsp; will show as
If the first line includes wikimarkup that must start on a new line such as #, * or ; then use <nowiki /> :
Without <nowiki />
Разметка |
Результат
|
# Item 1
# Item 2
# Item 3
# Item 4
|
- Item 1
- Item 2
- Item 3
- Item 4
|
|
|
With <nowiki />
Разметка |
Результат
|
<nowiki />
# Item 1
# Item 2
# Item 3
# Item 4
|
- Item 1
- Item 2
- Item 3
- Item 4
|
|
|
Examples
Разметка |
Результат
|
'''Bold text'''
|
Bold text
|
''Italic text''
|
Italic text
|
|
|
Note that
Разметка |
Результат
|
The quick brown fox jumps over the lazy dog.{{#tag:ref|A footnote.<ref>A reference for the footnote.</ref>|group=nb}} The cow jumped over the moon.{{fact}}
== Notes ==
{{reflist|group=nb}}
== References ==
{{reflist}}
|
|
|
|
Разметка |
Результат
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
|
|
Foxes and dogs
Разметка |
Результат
|
The quick brown fox jumps over the lazy dog.
|
The quick brown fox jumps over the lazy dog.
|
|
|
When a template is enclosed within
Разметка |
Результат
|
{{книга |заглавие=The Book of Merlyn |год=1977 |язык=en |автор=White, T. H.}}
|
White, T. H. The Book of Merlyn (англ.). — 1977.
|
{{code|{{книга |заглавие=The Book of Merlyn |год=1977 |язык=en |автор=White, T. H.}}}}
|
'"`UNIQ--templatestyles-00000038-QINU`"'<span class="citation no-wikidata" data-wikidata-property-id="P1343" ><i>White, T. H.</i> The Book of Merlyn <small class="ref-info" style="cursor:help;" title="на английском языке">(англ.)</small>. — 1977.</span>
|
|
|
Во избежание поломок страниц, использующих этот шаблон, экспериментируйте в песочнице (создать | зеркало) или своём личном пространстве. Пожалуйста, добавляйте категории на подстраницу /doc. Подстраницы этого шаблона.
|
|