Template:Demo/doc:修订间差异
创建页面,内容为“{{Lua|Module:Demo}} 该模板只是将模板代码(或任何其他代码)放在标签中<syntaxhighlight lang="wikitext">...</syntaxhighlight>,然后将该代码的呈现放在下面。 {{演示|< nowiki > {{您的模板}} </ nowiki >}} 重要提示:您必须用<nowiki>...</nowiki>标签包裹要演示的源(或者使用{{ escape }},它有一个 demo-escape 示例),如下所示: {{demo|<nowiki>[template source]</nowiki>}}” |
无编辑摘要 |
||
第2行: | 第2行: | ||
该模板只是将模板代码(或任何其他代码)放在标签中<syntaxhighlight lang="wikitext">...</syntaxhighlight>,然后将该代码的呈现放在下面。 | 该模板只是将模板代码(或任何其他代码)放在标签中<syntaxhighlight lang="wikitext">...</syntaxhighlight>,然后将该代码的呈现放在下面。 | ||
{{ | This template simply places template code (or any other code) in a {{tag|syntaxhighlight|params=lang="wikitext"}} tag and then places the rendering of that code below. | ||
<syntaxhighlight lang="wikitext"> | |||
{{demo|<nowiki>{{your template}}</nowiki>}} | |||
</syntaxhighlight> | |||
'''{{red|IMPORTANT:}}''' You must wrap {{tag|nowiki}} tags around the source to be demonstrated (or use {{t|escape}}, which has a demo-escape example), like so: | |||
<syntaxhighlight lang="wikitext" inline>{{demo|<nowiki>[template source]</nowiki>}}</syntaxhighlight> | |||
Failure to wrap {{tag|nowiki}} tags around the source may cause the source to be executed before it reaches this template. | |||
<syntaxhighlight lang="wikitext" inline>{{demo|{{fail}}}}</syntaxhighlight> produces: | |||
{{demo|{{fail}}}} |