|
|
| 第1行: |
第1行: |
| Block code with header.
| | <noinclude>{{Documentation}}</noinclude><includeonly><div class="wiki-hc-background"><pre<noinclude></noinclude> style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;background-color: #ffffff;">{{{head|{{{1|{{META Error}}}}}}}}</pre<noinclude></noinclude>><!-- The line break is needed, otherwise the wiki will generate extraneous paragraphs inside the 2nd pre block --> |
| | | <div class="wiki-hcdiff-main" styles="display:flex;"><div style="margin-top: 0; border-top-style:dashed; padding-top:0.8em;flex:1;">{{{output|{{{2|{{META Error}}}}}}}}</div><div style="margin-top: 0; border-top-style:dashed; padding-top:0.8em;flex:1;">{{{output2|{{{3|{{META Error}}}}}}}}</div></div></div></includeonly> |
| * Use [[Template:bc]] for block code without header.
| |
| * Use [[Template:ic]] for inline code.
| |
| | |
| ==Usage==
| |
| | |
| * {{ic|1}} or {{ic|head}}: the code in the top pane
| |
| * {{ic|2}} or {{ic|output}}: the code in the bottom left pane
| |
| * {{ic|3}} or {{ic|output2}}: the code in the bottom right pane
| |
| | |
| <nowiki>{{hcdiff|main.h|#include <stdio.h>|#include2 <stdio2.h>}}</nowiki>
| |
| | |
| <nowiki>{{hcdiff|head=main.h|output=<syntaxhighlight lang="bash">
| |
| #include <stdio.h></syntaxhighlight>|output2=<syntaxhighlight lang="bash">
| |
| #include2 <stdio2.h></syntaxhighlight>}}</nowiki>
| |
| | |
| ==Example==
| |
| | |
| {{hcdiff|head=main.h|output=<syntaxhighlight lang="bash"> | |
| #include <stdio.h></syntaxhighlight>|output2=<syntaxhighlight lang="bash">
| |
| #include2 <stdio2.h></syntaxhighlight>}}
| |
| | |
| <!-- 本行下加入模板(Documentation)的分类 -->
| |
| <includeonly>[[Category:工具模板]]</includeonly> | |
| <!-- 本行下加入模板的子页面(Documentation/doc)分类 --> | |
| <noinclude>[[Category:模板说明文件]]</noinclude>
| |