Template:hc
用于展示带首行(通常是文件名或输入)的代码块。
- 要展示没有首行的代码块,使用模板 Template:bc。
- 要展示内联代码,使用模板 Template:ic 。
提示:在 Arch Linux 中文维基上也可以使用 MediaWiki 的 SyntaxHighlight 扩展提供的代码高亮功能,详情请参阅前述页面。
Usage[编辑源代码]
1
orhead
: the code in the top pane2
oroutput
: the code in the bottom pane
{{hc|main.h|#include <stdio.h>}}
{{hc|head=main.h|output=#include <stdio.h>}}
Example[编辑源代码]
main.h
#include <stdio.h>