模板:Inline-code/doc
外观
| 文件:Codex icon book color-base.svg | This is a documentation subpage for 模板:Inline-code. It contains usage information, categories and other content that is not part of the original 模板 page. |
Usage
Simply wraps {{{code}}} in ,<syntaxhighlight inline lang="php">{{{code}}}</syntaxhighlight>
where in {{Inline-code}}: |lang=php is by default, but |lang= can be whatever, e.g. sql, wikitext, etc. (check Extension:SyntaxHighlight for list of languages available).
- Some text, then
{{Inline-code | 1=wfDebug( $text, $dest = 'all' );}}and more text.
produces
- Some text, then
wfDebug( $text, $dest = 'all' );and more text.
Note that for PHP, using the shorter {{phpi}} might be easier.
TemplateData
This is the TemplateData documentation for this template used by VisualEditor and other tools.
Inline-code
An inline source code string.
| 参数 | 描述 | 类型 | 状态 | |
|---|---|---|---|---|
| Code | 1 code | The code to display. | 字符串 | 必需 |
| Language | 2 lang | The programming language of the source code. List of valid values is at: Extension:SyntaxHighlight#Supported languages.
| 字符串 | 推荐 |
| Class | class | 无描述 | 字符串 | 可选 |
| ID | id | 无描述 | 字符串 | 可选 |
| CSS style | style | 无描述 | 字符串 | 可选 |
See also
- {{Code}}