Шаблон:File — различия между версиями
м |
м |
||
(не показано 26 промежуточных версий этого же участника) | |||
Строка 1: | Строка 1: | ||
− | <includeonly> | + | <includeonly><div class="contentbox mw-collapsible" style="border: 1px solid #AAA; background-color: #F9F9F9; overflow: auto"> |
− | <div class="contentbox mw-collapsible" style="border: 1px solid | + | <div class="contentbox-title"><span class="contentbox-title1" style="background-color: #870922; color: white">{{{title|Файл}}}</span>{{#if:{{{filename|}}}|<span class="contentbox-subtitle" style="background-color: #AAA; color: white;">{{{filename}}}</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: #870922; color: white">{{{title|Файл}}}</span>{{#if:{{{ | + | |
<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> | ||
== Использование == | == Использование == | ||
+ | |||
+ | {{mbox| | ||
+ | |type=notice | ||
+ | |text='''Рекомендация:''' | ||
+ | |text-small=Во избежании неправильной работы шаблона обрамляйте код в кэги <code><nowiki><</nowiki>nowiki><nowiki></nowiki></nowiki></code>. Это необходимо, если в коде встречаются символы <nowiki>«|»</nowiki>. | ||
+ | }} | ||
<pre> | <pre> | ||
{{file | {{file | ||
|title=Заголовок | |title=Заголовок | ||
− | | | + | |filename=Имя файла |
|description=Описание | |description=Описание | ||
|lang=Язык для подсветки синтаксиса | |lang=Язык для подсветки синтаксиса | ||
Строка 22: | Строка 27: | ||
<pre> | <pre> | ||
{{file | {{file | ||
− | | | + | |filename=$HOME/.Rprofile |
− | |lang= | + | |lang=r |
|code= | |code= | ||
− | # .Rprofile -- commands to execute at the beginning of each R session | + | <nowiki><</nowiki>nowiki># .Rprofile -- commands to execute at the beginning of each R session |
# | # | ||
# You can use this file to load packages, set options, etc. | # You can use this file to load packages, set options, etc. | ||
Строка 38: | Строка 43: | ||
options(showWarnCalls = TRUE, showErrorCalls = TRUE) | options(showWarnCalls = TRUE, showErrorCalls = TRUE) | ||
− | utils::rc.settings(ipck = TRUE) | + | utils::rc.settings(ipck = TRUE)<nowiki></nowiki></nowiki> |
}} | }} | ||
</pre> | </pre> | ||
{{file | {{file | ||
− | | | + | |filename=$HOME/.Rprofile |
− | |lang= | + | |lang=r |
|code= | |code= | ||
− | # .Rprofile -- commands to execute at the beginning of each R session | + | <nowiki># .Rprofile -- commands to execute at the beginning of each R session |
# | # | ||
# You can use this file to load packages, set options, etc. | # You can use this file to load packages, set options, etc. | ||
Строка 54: | Строка 59: | ||
options(digits = 4) | options(digits = 4) | ||
− | options(digits.secs=3) | + | options(digits.secs = 3) |
options(show.signif.stars = FALSE) | options(show.signif.stars = FALSE) | ||
options(showWarnCalls = TRUE, showErrorCalls = TRUE) | options(showWarnCalls = TRUE, showErrorCalls = TRUE) | ||
− | utils::rc.settings(ipck = TRUE) | + | utils::rc.settings(ipck = TRUE)</nowiki> |
}} | }} | ||
</noinclude> | </noinclude> |
Текущая версия на 17:19, 20 апреля 2014
Использование
Рекомендация: Во избежании неправильной работы шаблона обрамляйте код в кэги
<nowiki></nowiki> . Это необходимо, если в коде встречаются символы «|». |
{{file |title=Заголовок |filename=Имя файла |description=Описание |lang=Язык для подсветки синтаксиса |code=Содержимое файла }}
Примеры
{{file |filename=$HOME/.Rprofile |lang=r |code= <nowiki># .Rprofile -- commands to execute at the beginning of each R session # # You can use this file to load packages, set options, etc. # # NOTE: changes in this file won't be reflected until after you quit # and start a new session # options(digits = 4) options(digits.secs=3) options(show.signif.stars = FALSE) options(showWarnCalls = TRUE, showErrorCalls = TRUE) utils::rc.settings(ipck = TRUE)</nowiki> }}
Файл$HOME/.Rprofile
<syntaxhighlight lang="r" enclose="pre"># .Rprofile -- commands to execute at the beginning of each R session # # You can use this file to load packages, set options, etc. # # NOTE: changes in this file won't be reflected until after you quit # and start a new session # options(digits = 4) options(digits.secs = 3) options(show.signif.stars = FALSE) options(showWarnCalls = TRUE, showErrorCalls = TRUE) utils::rc.settings(ipck = TRUE)</syntaxhighlight>