コンテンツにスキップ

「テンプレート:Hc」の版間の差分

提供: ArchWiki
削除された内容 追加された内容
ページの作成:「<noinclude>{{DISPLAYTITLE:テンプレート:hc}} {{Template}} '''Block code with header.''' * Use Template:bc for block code without header. * Use Template:ic...」
 
編集の要約なし
 
7行目: 7行目:
* Use [[Template:ic]] for inline code.
* Use [[Template:ic]] for inline code.


==Usage==
== Usage ==


* {{ic|1}} or {{ic|head}}: the code in the top pane
{{bc|<nowiki>{{hc|head|code}}</nowiki>}}
* {{ic|2}} or {{ic|output}}: the code in the bottom pane


<nowiki>{{hc|main.h|#include <stdio.h>}}</nowiki>
==Example==


<nowiki>{{hc|head=main.h|output=#include <stdio.h>}}</nowiki>
{{hc|head|code}}</noinclude><includeonly><pre<noinclude></noinclude> style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;">{{{head|{{{1|{{META Error}}}}}}}}</pre<noinclude></noinclude>><!-- The line break is needed, otherwise the wiki will generate extraneous paragraphs inside the 2nd pre block -->

<pre<noinclude></noinclude> style="margin-top: 0; border-top-style:dashed; padding-top: 0.8em;">{{{output|{{{2|{{META Error}}}}}}}}</pre<noinclude></noinclude>></includeonly><noinclude><!-- The &lt;noinclude>&lt;/noinclude> hack is needed to allow wiki markup inside the pre tags; reference: http://www.gossamer-threads.com/lists/wiki/mediawiki/118688#118688 --></noinclude>
== Example ==

{{hc|head=main.h|output=#include <stdio.h>}}</noinclude><includeonly><pre<noinclude></noinclude> style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;">{{{head|{{{1|{{META Error}}}}}}}}</pre<noinclude></noinclude>><!-- The line break is needed, otherwise the wiki will generate extraneous paragraphs inside the 2nd pre block -->
<pre<noinclude></noinclude> style="margin-top: 0; border-top-style:dashed; padding-top: 0.8em;">{{{output|{{{2|{{META Error}}}}}}}}</pre<noinclude></noinclude>></includeonly>

2025年12月13日 (土) 18:14時点における最新版

このページはテンプレートです。このページに Arch Linux に関連する情報は含まれていません、他の記事のパーツとして使って下さい。詳しくは、ヘルプ:テンプレートを見て下さい。

このテンプレートで実験はしないようお願いします。このテンプレートを使っているページを破壊してしまうおそれがあります。このテンプレートを編集したいときは、テキストをテンプレート:サンドボックスにコピーして、そこでテストを行ってから、問題ないようでしたら編集してください。

このテンプレートに関して何か意見がある場合は、自由に発言してください。

Block code with header.

Usage

  • 1 or head: the code in the top pane
  • 2 or output: 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>