模板:Example/doc:修订间差异
来自 LNN的:not(博客)?
更多操作
小 →示例 |
小无编辑摘要 |
||
| 第5行: | 第5行: | ||
<pre> | <pre> | ||
{{example|<nowiki><</nowiki>nowiki> | {{example|<nowiki><</nowiki>nowiki> | ||
''你好'',<u>世界</u>!{{code|{{tl|Example}}}} 模版示例。 | ''你好'',<u>世界</u>! | ||
{{code|{{tl|Example}}}} 模版示例。 | |||
<nowiki></</nowiki>nowiki>}} | <nowiki></</nowiki>nowiki>}} | ||
</pre> | </pre> | ||
结果: | 结果: | ||
{{example|<nowiki> | {{example|<nowiki> | ||
''你好'',<u>世界</u>!{{code|{{tl|Example}}}} 模版示例。 | ''你好'',<u>世界</u>! | ||
{{code|{{tl|Example}}}} 模版示例。 | |||
</nowiki>}} | </nowiki>}} | ||
=== 模版数据 === | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "代码", | |||
"description": "要作为示例的维基文本,必要时用 <nowiki> 包裹。", | |||
"example": "<nowiki>{{hidebox|标题|2= 内容 }}</nowiki>", | |||
"type": "string", | |||
"required": true | |||
} | |||
}, | |||
"description": "显示维基语法示例(源代码+显示效果)。" | |||
} | |||
</templatedata> | |||
<noinclude>[[分类:模板文档]]</noinclude><includeonly>[[分类:内容模板]]</includeonly> | <noinclude>[[分类:模板文档]]</noinclude><includeonly>[[分类:内容模板]]</includeonly> | ||
2023年2月26日 (日) 00:33的版本
输入一段维基文本(必要时使用 <nowiki> 包裹),先输出这段源代码(自动用 <pre> 包裹),再输出这段代码的展开结果。
示例
{{example|<nowiki>
''你好'',<u>世界</u>!
{{code|{{tl|Example}}}} 模版示例。
</nowiki>}}
结果: Lua错误:无法创建进程:proc_open(/dev/null): Failed to open stream: Operation not permitted
模版数据
显示维基语法示例(源代码+显示效果)。
| 参数 | 描述 | 类型 | 状态 | |
|---|---|---|---|---|
| 代码 | 1 | 要作为示例的维基文本,必要时用 <nowiki> 包裹。
| 字符串 | 必需 |