Шаблон:Code — различия между версиями

Материал Psylab.info - энциклопедии психодиагностики
Перейти к: навигация, поиск
м
м
Строка 1: Строка 1:
<includeonly>
+
<includeonly><div class="contentbox mw-collapsible" style="border: 1px solid {{{color|#333}}}; background-color: {{{bgcol|#F3F3F3}}}; overflow: auto">
<div class="contentbox mw-collapsible" style="border: 1px solid {{{color|#333}}}; background-color: {{{bgcol|#F3F3F3}}}; overflow: auto">
+
<div class="contentbox-title"><span class="contentbox-title1" style="background-color: #204A87; color: white">{{{title|Код}}}</span>{{#if: {{{subtitle|}}}|<span class="contentbox-subtitle" style="background-color: #AAA; color: white;">{{{subtitle}}}</span>|}}{{#if:{{{description|}}}|<span class="contentbox-description" style="color: #333;">{{{description}}}</span>|}}</div><br style="clear: both;" />{{#if: {{{rightmsg|}}}|<div class="contentbox-rightmsg">{{{rightmsg}}}</div>|}}
<div class="contentbox-title"><span class="contentbox-title1" style="background-color: #204A87; color: white">{{{title|Код}}}</span>{{#if:{{{subtitle|}}}|<span class="contentbox-subtitle" style="background-color: #AAA; color: white;">{{{subtitle}}}</span>|}}{{#if:{{{description|}}}|<span class="contentbox-description" style="color: #333;">{{{description}}}</span>|}}</div><br style="clear: both;" />{{#if:{{{rightmsg|}}}|<div class="contentbox-rightmsg">{{{rightmsg}}}</div>|}}
+
 
<div class="contentbox-content mw-collapsible-content">
 
<div class="contentbox-content mw-collapsible-content">
{{#tag:syntaxhighlight|{{{code}}}|lang={{{lang|text}}}}}
+
{{#tag:syntaxhighlight|{{{code}}}|lang="{{{lang|text}}}"|enclose="pre"}}
 
</div>
 
</div>
 
</div></includeonly><noinclude>
 
</div></includeonly><noinclude>

Версия 16:05, 17 февраля 2014

Использование

{{code
  |title=Заголовок
  |subtitle=Подзаголовок
  |description=Описание
  |lang=Язык для подсветки синтаксиса
  |code=Код
}}


Примеры

{{code
  |subtitle=R
  |lang=rsplus
  |code=
x <- rnorm(100)
}}
Код

<syntaxhighlight lang="rsplus">> x <- rnorm(100) > mean(x) [1] -0.0004533</syntaxhighlight>