.
> cat htmlsection_orig.html | ./htmlsection > htmlsection.html
htmlsection-j.html と htmlsection-j_orig.html は,htmlsection による変換例の
日本語版です.htmlsection-j.html は,以下のようにして htmlsection-j_orig.html
から作成されます.
> cat htmlsection-j_orig.html | ./htmlsection -japanese > htmlsection-j.html
インストール
htmlsection をインストールするには,以下を実行してください.
> su
Password:
# make install
htmlsection と
マニュアルページ[,
ドキュメント類がインストールされます.
アンインストール
アンインストールするには,以下を実行してください.
]
> su
Password:
# make uninstall
htmlsection と
マニュアルページ[,
ドキュメント類がアンインストールされます.
http://web.ffn.ne.jp/~hsakai/myfreesoft/index.html
BSD make と GNU make の両方が利用可能です.
htmlsection のマニュアルページを参照するには,
以下を実行してください.
]
> man htmlsection
もしくは
> nroff -man htmlsection.1
このファイルは htmlsection.html の日本語版
(htmlsection-j.html)です.
htmlsection 付属の Makefile を参照してください.
HTMLSECTION_PREFIX/share/doc/htmlsection,
HTMLSECTION_PREFIX/share/doc/ja/htmlsection
章番号の挿入とリンクの作成
<section></section> タグは <h1></h1> タグに変換され,
章番号が挿入されます.タグには <section>, <subsection>, ...,
<subsubsubsubsubsection> が利用できます.
章には name オプションを利用して名前を指定することができます.
本文中では<sectionref>タグを利用し,章の名前を指定することで,
その章への参照を作成し,リンクを作成することができます.
章に番号を割り当てたくない場合には,number オプションを
<section number=no>のように指定します.
章番号の例
例えばの内容で,example.html という
ファイルを作成します.
章番号の例
<section name="intro" number=no>はじめに</section>
これは「はじめに」です.
<section name="howto">htmlsection の使いかた</section>
<subsection name="howtouse">htmlsection を使ってみよう!</subsection>
htmlsection については,
<sectionref name="howto"> や
<subsectionref name="howtouse" title=no> を参照してください.
<section number=no>おわりに</section>
|
さらに,以下を実行します.
> cat example.html | htmlsection -japanese -no-spacer
htmlsection の出力はのようになります.
章番号の例(変換後)
目次の作成
htmlsection は目次を自動生成します.
<tableofcontents></tableofcontents> タグがあると,
目次が挿入されます[.
表,図,リスト番号の挿入とリンクの作成
<tablereference> タグがあると,表番号を自動生成し,挿入します.
表,図,リスト番号の例
は htmlsection による変換前です.
]
表,図,リスト番号の例
<center>
<tablereference name="sample_table">表のサンプル</tablereference>
<table border=1>
<tr><td align=center>関数名</td><td align=center>機能</td></tr>
<tr><td>printf</td><td>フォーマットに従って,文字列を表示します.</td></tr>
</table>
</center>
<p>
<center>
<img src="picture/sample.jpg">
<br>
<figurereference name="sample_figure">図のサンプル</figurereference>
</center>
<p>
<pre>
<listreference name="sample_list">サンプルリスト</listreference>
int main()
{
int i;
for (i = 0; i < 10; i++)
printf("%d\n", i);
exit (0);
}
</pre>
<p>
<tableref name="sample_table"> を参照してください.
<figureref name="sample_figure"> を参照してください.
<listref name="sample_list"> を参照してください.
|
は htmlsection による変換後です.
表,図,リスト番号の例(変換後)
表,図,リスト目次の作成
<tableindex></tableindex>,
<figureindex></figureindex>,
<listindex></listindex> タグがあると,
それぞれ表目次,図目次,リスト目次に変換されます.
参考文献,用語,注釈番号の挿入とリンクの作成
参考文献,用語,注釈番号を挿入します.
参考文献,用語,注釈番号の例
は htmlsection による変換前です.
参考文献,用語,注釈番号の例
<termref name="CLang">C</termref> はプログラミング言語です
<ref name="KandR"><ref name="KandR2">.
私は普段は<termref name="CLang">C</termref>を
利用しています<noteref name="AboutMe">.
また,<termref name="htmlsection">htmlsection</termref>は
<termref name="PerlLang">perl</termref><ref name="LamaBook">で
書かれています<noteref name="htmlsection">.
<termref name="PerlLang">Perl</termref>はスクリプト言語の一種です
<ref name="LamaBook">.
私は<termref name="PerlLang">perl</termref>も
よく利用しています<noteref name="AboutMe">.
<notes>
<note name="AboutMe">様々なプログラムを作成しています.
<note name="htmlsection">htmlsection はすべて perl で記述されています.
<note>他にも本文中に無い注釈を入れたい場合には,ここより下に記述します.
<note>私は他にも Tcl/Tk, Java, C++, ... などなどを利用しています.
</notes>
<terms>
<term name="CLang">プログラミング言語の一種.
<term name="htmlsection">このプログラムです.
<term name="PerlLang">プログラミング言語の一種.
<term>他にも本文中に無い用語を入れたい場合には,ここより下に記述します.
<term word="Tcl/Tk">プログラミング言語の一種.
<term word="Java">プログラミング言語の一種.
</terms>
<references>
<reference name="KandR">"プログラミング言語C",
B.W.カーニハン著, D.M.リッチー著, 石田晴久訳, 共立出版.
<reference name="KandR2">"プログラミング言語C 第2版 ANSI規格準拠",
B.W.カーニハン著, D.M.リッチー著, 石田晴久訳, 共立出版, 1989.
<reference name="LamaBook">"初めての Perl",
ランダル・L.シュワルツ著, トム・フェニックス著, 近藤嘉雪訳,
オライリー・ジャパン.
<reference>他にも本文中に無い参考文献を入れたい場合には,
ここより下に記述します.
<reference name="CamelBook">"プログラミング Perl",
ラリー・ウォール著, トム・クリスチャンセン著, ジョン・オーワント著, 近藤嘉雪訳,
オライリー・ジャパン.
<reference name="NumericalRecipe">"C言語による数値計算のレシピ",
William H. Press著, Saul A. Teukolsky著,
William T. Vetterling著, Brian P.Flannery著,
丹慶勝市訳, 佐藤俊郎訳, 奥村晴彦訳, 小林誠訳, 技術評論社, 1993.
</references>
|
は htmlsection による変換後です.
参考文献,用語,注釈番号の例(変換後)
(1)C はプログラミング言語です
[1][2].
私は普段は(1)Cを
利用しています(*1).
また,(2)htmlsectionは
(3)perl[3]で
書かれています(*2).
(3)Perlはスクリプト言語の一種です
[3].
私は(3)perlも
よく利用しています(*1).
注釈
- (*1) 様々なプログラムを作成しています.
- (*2) htmlsection はすべて perl で記述されています.
- (*3) 他にも本文中に無い注釈を入れたい場合には,ここより下に記述します.
- (*4) 私は他にも Tcl/Tk, Java, C++, ... などなどを利用しています.
用語
参考文献
- [1] "プログラミング言語C",
B.W.カーニハン著, D.M.リッチー著, 石田晴久訳, 共立出版.
- [2] "プログラミング言語C 第2版 ANSI規格準拠",
B.W.カーニハン著, D.M.リッチー著, 石田晴久訳, 共立出版, 1989.
- [3] "初めての Perl",
ランダル・L.シュワルツ著, トム・フェニックス著, 近藤嘉雪訳,
オライリー・ジャパン.
- [4] 他にも本文中に無い参考文献を入れたい場合には,
ここより下に記述します.
- [5] "プログラミング Perl",
ラリー・ウォール著, トム・クリスチャンセン著, ジョン・オーワント著, 近藤嘉雪訳,
オライリー・ジャパン.
- [6] "C言語による数値計算のレシピ",
William H. Press著, Saul A. Teukolsky著,
William T. Vetterling著, Brian P.Flannery著,
丹慶勝市訳, 佐藤俊郎訳, 奥村晴彦訳, 小林誠訳, 技術評論社, 1993.
|
章ごとの例
参考文献,用語,注釈は,章ごとに作成することができます.この場合,
name オプションによる名前指定には,同じ名前を重複して利用することができます.
は htmlsection による変換前です.
章ごとの例
<section>プログラミング言語C</section>
<termref name="Lang">C</termref> はプログラミング言語です
<ref name="Book">.<noteref name="About">
<notes>
<note name="About">プログラミング言語です.
</notes>
<terms>
<term name="Lang">プログラミング言語の一種
</terms>
<references>
<reference name="Book">"プログラミング言語C",
B.W.カーニハン著, D.M.リッチー著, 石田晴久訳, 共立出版.
</references>
<section>プログラミング言語 Perl</section>
<termref name="Lang">Perl</termref> はプログラミング言語です
<ref name="Book">.<noteref name="About">
<notes>
<note name="About">プログラミング言語です.
</notes>
<terms>
<term name="Lang">プログラミング言語の一種
</terms>
<references>
<reference name="Book">"初めての Perl",
ランダル・L.シュワルツ著, トム・フェニックス著, 近藤嘉雪訳,
オライリー・ジャパン.
</references>
|
は htmlsection による変換後です.
章ごとの例(変換後)
(1)C はプログラミング言語です
[1].(*1)
注釈
用語
参考文献
- [1] "プログラミング言語C",
B.W.カーニハン著, D.M.リッチー著, 石田晴久訳, 共立出版.
(1)Perl はプログラミング言語です
[1].(*1)
注釈
用語
参考文献
- [1] "初めての Perl",
ランダル・L.シュワルツ著, トム・フェニックス著, 近藤嘉雪訳,
オライリー・ジャパン.
|
のオプションが利用できます.
オプション一覧
オプション |
説明 |
-h, -help |
ヘルプメッセージを出力します. |
-max-depth [depth] |
利用できる subsection タグの深さの最大値を指定します.例えば
-max-depth 10 を指定したならば,<subsubsubsubsubsubsubsubsubsection>
タグまで利用できます. |
-spacer |
<section>, <subsection>, <subsubsection> タグの上下に
スペースを挿入します. |
-no-spacer |
-spacer の反対です.スペースを挿入しません. |
-english, -japanese |
言語を指定します.このオプションが指定されていない場合には,環境変数 LANG
が参照されます. |
-start-section [section] |
章番号の初期値を指定します.例えば -start-section 3.5.6 を指定したならば,
第3.5.6章を初期値として章番号を割り当てます.
|
-toc-section [section] |
目次を作成する際に,目次に入れる章の深さを指定します.
例えば -toc-section 2 を指定したならば,section(章) と subsection(節)
のみから目次を作成します.-toc-section 0 を指定すると,すべての章
(section, subsection, subsubsection, ...)を目次に反映します.
|
-table-section [section] |
表番号を作成する際に入れる章番号の深さを指定します.
例えば -table-section 2 を指定した場合には,表番号のフォーマットは
[章番号].[節番号].[表番号] のようになります.
-table-section 0 を指定した場合には,章番号を引用せずに表番号を作成します.
|
-figure-section [section], -list-section [section] |
-table-section と同様です.それぞれ図,リストのためのオプションです. |
-start-table [number] |
表番号の初期値を指定します. |
-start-figure [number], -start-list [number] |
-start-table と同様です.それぞれ図,リストのためのオプションです. |
-start-ref [number], -start-term [number], -start-note [number] |
-start-table と同様です.それぞれ参考文献,用語,注釈のための
オプションです. |
-ref-number |
参考文献にデフォルトで番号を割り付けます. |
-term-number, -note-number |
-ref-number と同様です.それぞれ用語,注釈のためのオプションです. |
-no-ref-number, -no-term-number, -no-note-number |
-ref-number などの逆です.デフォルトで番号を割り付けません. |
-toc-file [filename] |
目次を指定したファイル名で出力します. |
-table-file [filename] |
表目次を指定したファイル名で出力します. |
-figure-file [filename], -list-file [filename] |
-table-file と同様です.それぞれ図,リストのためのオプションです. |
-ref-file [filename], -term-file [filename], -note-file [filename] |
-table-file と同様です.それぞれ参考文献,用語,注釈のための
オプションです. |
-o [filename] |
出力先のファイル名を指定します.-o が指定されていない場合には,
標準出力に出力します. |
の環境変数を参照します.
環境変数一覧
Variable | Description |
LANG | 言語を指定します.ja_JP.EUC もしくは japanese の場合には
日本語となり,それ以外は英語になります.
|
のタグが利用できます.
タグ一覧
Tag | Options |
<section>Title</section>, <subsection>Title</subsection>, ... |
name="section_name"
number=yes or no |
<sectionref>, <subsectionref>, ... |
name="section_name"
title=yes or no |
<tablereference>Title</tablereference> |
name="table_name"
number=yes or no |
<figurereference>Title</figurereference> |
name="figure_name"
number=yes or no |
<listreference>Title</listreference> |
name="list_name"
number=yes or no |
<tableref> |
name="table_name"
title=yes or no |
<figureref> |
name="figure_name"
title=yes or no |
<listref> |
name="list_name"
title=yes or no |
<references></references> |
none |
<reference> |
name="reference_name"
title=yes or no
number=yes or no |
<terms></terms> |
none |
<term> |
name="term_name"
word="term_word"
title=yes or no
number=yes or no |
<notes></notes> |
none |
<note> |
name="note_name"
title=yes or no
number=yes or no |
<ref> |
name="reference_name"
title=yes or no
number=yes or no |
<termref>Word</termref> |
name="term_name"
title=yes or no
number=yes or no |
<noteref> |
name="note_name"
title=yes or no
number=yes or no |
<tableofcontents></tableofcontents> |
none |
<tableindex></tableindex> |
none |
<figureindex></figureindex> |
none |
<listindex></listindex> |
none |
htmlsection についての更なる情報は,以下を参照してください.
坂井弘亮
メールアドレス:
hsakai@m8.ffn.ne.jp
ウェブサイト:
http://web.ffn.ne.jp/~hsakai/myfreesoft/index.html
ミラーサイト:
http://hp.vector.co.jp/authors/VA014157/myfreesoft/index.html
htmlsection Copyright (C) 2001-2003 SAKAI Hiroaki.
All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
このプログラムはフリーソフトウエアであり,GNU General Public License (GPL) の
下で自由に改変し再配布できます.
Hyper Text Makeup Language
プログラミング言語の一種
標準入力
perl マニュアルページ
HTMLSECTION_PREFIX/share/doc/htmlsection/README
- Readme ファイル
man htmlsection - htmlsection マニュアルページ
HTMLSECTION_PREFIX/share/doc/htmlsection/htmlsection.html
- サンプルファイルと詳細な説明
HTMLSECTION_PREFIX/share/doc/htmlsection/htmlsection_orig.html
- サンプルファイルと詳細な説明 (htmlsection による変換前)
noweb
TeX
htmlsection ソースコード