Template:Code/doc/ru: Difference between revisions
< Template:Code | doc
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{doc|0}}</noinclude>__NOTOC__ | <noinclude>{{doc|0}}</noinclude>__NOTOC__ | ||
Этот шаблон позволяет отформатировать текст как однострочный код. | |||
== Параметры == | ==Параметры и примеры== | ||
{| class= | {| class=standard-table | style="width:100%" | ||
|- | |- | ||
! Параметр | |||
! Описание | |||
! Пример | |||
! Предпросмотр | |||
|- | |- | ||
| {{ | | align=center | {{Code|{{Param|preset}}}} | ||
| Стиль оформления шаблона. Доступны следующие стили: | |||
:* {{Code|preset=0|Default}} — стиль по умолчанию, основанный на Markdown; | |||
:* {{Code|preset=1|0}} — простой текст без оформления; | |||
:* {{Code|preset=1|1}} — блёклый фон; | |||
:* {{Code|preset=1|2}} — обведённый текст; | |||
:* {{Code|preset=1|3}} — светлый фон обведённого текста. | |||
| {{CodeBlock|{{Code|{{Tint|color=comment|Привет, мир!}}}}}} {{CodeBlock|{{Code|{{Tint|color=yellow|preset}}={{Tint|color=green|0}}|{{Tint|color=comment|Привет, мир!}}}}}} {{CodeBlock|{{Code|{{Tint|color=yellow|preset}}={{Tint|color=green|1}}|{{Tint|color=comment|Привет, мир!}}}}}} {{CodeBlock|{{Code|{{Tint|color=yellow|preset}}={{Tint|color=green|2}}|{{Tint|color=comment|Привет, мир!}}}}}}{{CodeBlock|{{Code|{{Tint|color=yellow|preset}}={{Tint|color=green|3}}|{{Tint|color=comment|Привет, мир!}}}}}} | |||
| {{Capsule|margin=4px|{{Code|Привет, мир!}}}} {{Capsule|margin=4px|{{Code|preset=0|Привет, мир!}}}} {{Capsule|margin=4px|{{Code|preset=1|Привет, мир!}}}} {{Capsule|margin=4px|{{Code|preset=2|Привет, мир!}}}} {{Capsule|margin=4px|{{Code|preset=3|Привет, мир!}}}} | |||
|- | |- | ||
| {{ | | align=center | {{Code|{{Param|select}}}} | ||
|} | | Режим выделения текста. Использовать {{Code|preset=1|user-select}} CSS свойства — (выделение одним нажатием). По умолчанию применяется {{Code|preset=1|unset}} — (содержимое шаблона не будет выделяться). | ||
{| | | {{CodeBlock|{{Code|{{tint|color=yellow|select}}={{Tint|color=green|none}}|{{Tint|color=comment|Привет, мир!}}}}}} {{CodeBlock|{{Code|{{Tint|color=yellow|select}}={{Tint|color=green|all}}|{{Tint|color=comment|Привет, мир!}}}}}} | ||
! | | {{Capsule|margin=4px|{{Code|select=none|Привет, мир!}}}} {{Capsule|margin=4px|{{Code|select=all|Привет, мир!}}}} | ||
|- | |- | ||
| {{ | | align=center | {{Code|{{Param|style}}}} | ||
| Каскадные стили CSS. <br> Поддерживаются HSL, HEX, RGB(A) и другие. | |||
| {{CodeBlock|{{Code|{{Tint|color=yellow|style}}={{Tint|color=green|color:#EF9B9B}}|{{Tint|color=comment|Привет, Мир!}}}}}} | |||
{{CodeBlock|{{Code|{{Tint|color=yellow|background}}={{Tint|color=green|background:rgba(249,155,155,.15)}}|{{Tint|color=comment|Привет, мир!}}}}}} | |||
| {{Capsule|margin=4px|{{Code|style=color:#EF9B9B|Привет, Мир!}}}} | |||
{{Capsule|margin=5px|{{Code|style=background:rgba(249,155,155,.15)|Привет, мир!}}}} | |||
|- | |- | ||
| {{ | | align=center | {{Code|{{Param|highlight}}}} | ||
| Добавление подстветки синтаксиса языка. {{Bug|Собирает код в одну строку.}} | |||
| {{CodeBlock|margin=5px|<nowiki>{{Code|highlight=c|int main() {return 0;} }}</nowiki>}} | |||
| {{Capsule|margin=5px|{{Code|highlight=c|int main() {return 0;} }}}} | |||
|- | |- | ||
|} | |} | ||
Latest revision as of 09:24, 12 May 2024

This is a documentation subpage for Template:Code.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Этот шаблон позволяет отформатировать текст как однострочный код.
Параметры и примеры
Параметр | Описание | Пример | Предпросмотр |
---|---|---|---|
{{{preset}}} | Стиль оформления шаблона. Доступны следующие стили:
|
Привет, мир! Привет, мир! Привет, мир! Привет, мир! Привет, мир!
| |
{{{select}}} | Режим выделения текста. Использовать user-select CSS свойства — (выделение одним нажатием). По умолчанию применяется unset — (содержимое шаблона не будет выделяться). | Привет, мир! Привет, мир!
| |
{{{style}}} | Каскадные стили CSS. Поддерживаются HSL, HEX, RGB(A) и другие. |
Привет, Мир!
Привет, мир!
| |
{{{highlight}}} | Добавление подстветки синтаксиса языка. ![]() |
int main() {return 0;} |