htmlsection manual
(This manual was created by htmlsection!)

Table of Contents

Introduction

htmlsection - insert section number in (1)HTML and make the table of contents(*1).

Notes

1 Description

htmlsection is a (2)perl[1] script to insert section number in (1)HTML. When you use htmlsection, you don't have to manage section, table, figure, program-list, reference, term and note numbers and you don't have to make the table of contents, table index, figure index, and program-list index.

If files are specified, htmlsection reads HTML from these files. But, if files are not specified, htmlsection reads HTML from (3)STDIN.

Synopsis:

htmlsection [-options] [files ...]

2 Install

2.1 Download

You can get the newest htmlsection from here(*1).

2.2 Make htmlsection

If you want to make htmlsection, type(*2),
> make
search path to (2)perl, create head of script (Ex. #!/usr/bin/perl), create comments from README[2], create (*3)manual page[3], make htmlsection from htmlsection.pl, and create (*4)htmlsection.html[4] from htmlsection_orig.html[5].

2.3 See Sample HTML File

If you want to see sample HTML file, see htmlsection_orig.html[5] and (*4)htmlsection.html[4]. htmlsection.html was created from htmlsection_orig.html[5] by htmlsection such as(*5),
> cat htmlsection_orig.html | ./htmlsection > htmlsection.html

If you want to see japanese sample file, see htmlsection-j.html and htmlsection-j_orig.html. htmlsection-j.html was created from htmlsection-j_orig.html by htmlsection such as(*5),

> cat htmlsection-j_orig.html | ./htmlsection -japanese > htmlsection-j.html

2.4 Install

If you want to install htmlsection to your system, type,
> su
Password:
# make install
htmlsection, (*3)manual page[3], and documents(*6) are installed to your system.

2.5 Uninstall

If you want to uninstall htmlsection from your system, type,
> su
Password:
# make uninstall
htmlsection, manual page, and documents are deleted from your system.

Notes

3 Examples

3.1 Insert section number in HTML and make links to the section

htmlsection changes <section></section> tag to <h1></h1> tag and section number. You can use tag <section>, <subsection>, ..., and <subsubsubsubsubsection>. If name option is specified, htmlsection changes <sectionref> tag to the number and title of the section and make link to the section. If you want not to use number, use number option as <section number=no>.

3.1.1 Section Number Example

For example, make the file example.html as list3.1.

list3.1: Section Number Example
<section name="intro" number=no>Introduction</section>

    This is introduction.

<section name="howto">How to use htmlsection</section>

<subsection name="howtouse">Let's use htmlsection!</subsection>

    If you want to know about htmlsection, see
<sectionref name="howto">, and
<subsectionref name="howtouse" title=no>.

<section number=no>Ending</section>

And execute,

> cat example.html | htmlsection -no-spacer
htmlsection will output as list3.2.

list3.2: Section Number Example after Convertion

Introduction

This is introduction.

1 How to use htmlsection

1.1 Let's use htmlsection!

If you want to know about htmlsection, see 1 How to use htmlsection, and 1.1.

Ending

3.2 Make the table of contents

htmlsection inserts the table of contents at <tableofcontents></tableofcontents> tag.[6]

3.3 Insert table, figure, and program-list number and make links

htmlsection inserts the number at <tablereference> tag.

3.3.1 Table, Figure, and Program-list Number Example

Before convertion, See list3.3.

list3.3: Table, Figure and List Number Example
<center>
<tablereference name="sample_table">Sample Table</tablereference>
<table border=1>
<tr><td align=center>name</td><td align=center>function</td></tr>
<tr><td>printf</td><td>print strings by a format.</td></tr>
</table>
</center>

<p>
<center>
<img src="picture/sample.jpg">
<br>
<figurereference name="sample_figure">Sample Figure</figurereference>
</center>

<p>
<pre>
<listreference name="sample_list">Sample List</listreference>

int main()
{
  int i;
  for (i = 0; i < 10; i++)
    printf("%d\n", i);
  exit (0);
}
</pre>

<p>
See <tableref name="sample_table">.
See <figureref name="sample_figure">.
See <listref name="sample_list">.

After convertion by htmlsection, See list3.4.

list3.4: Table, Figure and List Number Example after Convertion
table1: Sample Table
namefunction
printfprint strings by a format.


figure1: Sample Figure

list1: Sample List

int main()
{
  int i;
  for (i = 0; i < 10; i++)
    printf("%d\n", i);
  exit (0);
}

See table1. See figure1. See list1.

3.4 Make the index of tables, figures, and program-lists

htmlsection inserts the index of table, figure, and list at <tableindex></tableindex>, <figureindex></figureindex>, and <listindex></listindex> tag.

3.5 Insert reference, term, and note number. And make links

htmlsention makes reference, term, and note index.

3.5.1 Reference, Term, and Note Number Example

Before convertion, See list3.5.

list3.5: Reference, Term and Note Number Example
The <termref name="CLang">C</termref> is a programming
language<ref name="KandR"><ref name="KandR2">.
I always use <termref name="CLang">C</termref><noteref name="AboutMe">.
But, <termref name="htmlsection">htmlsection</termref> is
<noteref name="htmlsection">written by
<termref name="PerlLang">perl</termref><ref name="LamaBook">.
<termref name="PerlLang">Perl</termref> is a very convenient
language<ref name="LamaBook"> and I always use
<termref name="PerlLang">perl</termref> too<noteref name="AboutMe">.

<notes>
<note name="AboutMe">And make many programs.
<note name="htmlsection">All of htmlsection are written by perl.
<note>If you want to write other notes,
you can write them after here.
<note>Sometimes, I use Tcl/Tk, Java, C++, ...
</notes>

<terms>
<term name="CLang">A programming language.
<term name="htmlsection">This program.
<term name="PerlLang">A programming language.
<term>If you want to write other terms,
you can write them after here.
<term word="Tcl/Tk">A programming language.
<term word="Java">A programming language.
</terms>

<references>
<reference name="KandR">Brian W. Kernighan and Dennis M. Ritchie,
"The C Programming Language", Prentice-Hall, 1978.
<reference name="KandR2">Brian W. Kernighan and Dennis M. Ritchie,
"The C Programming Language", Second Edition, Prentice Hall, 1988.
<reference name="LamaBook">Randal L. Schwartz and Tom Phoenix,
"Learning Perl", Oreilly & Associates Inc.
<reference>If you want to write other references,
you can write them after here.
<reference name="CamelBook">Larry Wall, Tom Christiansen, and Jon Orwant,
"Programming Perl", Oreilly & Associates.
<reference name="NumericalRecipe">William H. Press, Saul A. Teukolsky,
William T. Vetterling, and Brian P.Flannery,
"Numerical Recipes in C", Second Edition, Cambridge University Press, 1992.
</references>

After convertion by htmlsection, See list3.6.

list3.6: Reference, Term and Note Number Example after Convertion
The (1)C is a programming language[1][2]. I always use (1)C(*1). But, (2)htmlsection is (*2)written by (3)perl[3]. (3)Perl is a very convenient language[3] and I always use (3)perl too(*1).

Notes

  • (*1) And make many programs.
  • (*2) All of htmlsection are written by perl.
  • (*3) If you want to write other notes, you can write them after here.
  • (*4) Sometimes, I use Tcl/Tk, Java, C++, ...

Terms

  • (1)C A programming language.
  • (2)htmlsection This program.
  • (3)perl A programming language.
  • (4) If you want to write other terms, you can write them after here.
  • (5)Tcl/Tk A programming language.
  • (6)Java A programming language.

References

  • [1] Brian W. Kernighan and Dennis M. Ritchie, "The C Programming Language", Prentice-Hall, 1978.
  • [2] Brian W. Kernighan and Dennis M. Ritchie, "The C Programming Language", Second Edition, Prentice Hall, 1988.
  • [3] Randal L. Schwartz and Tom Phoenix, "Learning Perl", Oreilly & Associates Inc.
  • [4] If you want to write other references, you can write them after here.
  • [5] Larry Wall, Tom Christiansen, and Jon Orwant, "Programming Perl", Oreilly & Associates.
  • [6] William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P.Flannery, "Numerical Recipes in C", Second Edition, Cambridge University Press, 1992.

3.5.2 Every Section Example

You can use reference, term, and note index to repeat every section and use name option as same name.

Before convertion, See list3.7.

list3.7: Every Section Example
<section>The C Programming Language</section>

The <termref name="Lang">C</termref> is a programming
language<ref name="Book">.<noteref name="About">

<notes>
<note name="About">A programming language.
</notes>

<terms>
<term name="Lang">It is a programming language.
</terms>

<references>
<reference name="Book">Brian W. Kernighan and Dennis M. Ritchie,
"The C Programming Language", Prentice-Hall, 1978.
</references>

<section>The Perl Programming Language</section>

The <termref name="Lang">Perl</termref> is a programming
language<ref name="Book">.<noteref name="About">

<notes>
<note name="About">A programming language.
</notes>

<terms>
<term name="Lang">It is a programming language.
</terms>

<references>
<reference name="Book">Randal L. Schwartz and Tom Phoenix,
"Learning Perl", Oreilly & Associates Inc.
</references>

After convertion by htmlsection, See list3.8.

list3.8: Every Section Example after Convertion

1 The C Programming Language

The (1)C is a programming language[1].(*1)

Notes

  • (*1) A programming language.

Terms

  • (1)C It is a programming language.

References

  • [1] Brian W. Kernighan and Dennis M. Ritchie, "The C Programming Language", Prentice-Hall, 1978.

2 The Perl Programming Language

The (1)Perl is a programming language[1].(*1)

Notes

  • (*1) A programming language.

Terms

  • (1)Perl It is a programming language.

References

  • [1] Randal L. Schwartz and Tom Phoenix, "Learning Perl", Oreilly & Associates Inc.

4 Options

Options in table4.1 are available.

table4.1: Available Options
Option Description
-h, -help Output help messages.
-max-depth [depth] Specify the max depth of subsection of section tag. If you specify -max-depth 10, you can use <subsubsubsubsubsubsubsubsubsection> tag.
-spacer Spacing <section>, <subsection> and <subsubsection> tag.
-no-spacer No spacing.
-english,
-japanese
Specify the language. If you don't specify these options, htmlsection sees environment variable LANG.
-start-section [section] Specify the section number at start. For example, if you specify -start-section 3.5.6, htmlsection sets the section number to it at start.
-toc-section [section] Specify the section depth to make the table of contents. If you specify -toc-section 2, htmlsection makes the table of contents by section and subsection only. If you specify -toc-section 0, htmlsection makes the table of contents by all of sections, subsections, subsubsections, ...
-table-section [section] Specify the section number at beginning of table number. If you specify -table-section 2, format of table number is [section_number].[subsection_number].[table_number]. If you specify -table-section 0, format of table number is [table_number] only.
-figure-section [section],
-list-section [section]
Same as -table-section option.
-start-table [number] Specify the table number at start.
-start-figure [number],
-start-list [number]
Same as -start-table option.
-start-ref [number],
-start-term [number],
-start-note [number]
Same as -start-table option.
-ref-number Numbering of references are available as default.
-term-number, -note-number Same as -ref-number option.
-no-ref-number, -no-term-number, -no-note-number No numbering as default.
-toc-file [filename] If you specify -toc-file, output the table of contents to the file.
-table-file [filename] If you specify -table-file, output the table index to the file.
-figure-file [filename],
-list-file [filename]
Same as -table-file option.
-ref-file [filename], -term-file [filename], -note-file [filename] Same as -table-file option.
-o [filename] Specify the output file. If you don't specify the filename, htmlsection outputs HTML to the standard output.

5 Environment Variables

Environment variables in table5.1 are available.

table5.1: Available Environment Variables
VariableDescription
LANGSpecify the language.

6 Tags

Tags in table6.1 are available.

table6.1: Available Tags
TagOptions
<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

7 Other Documents

If you want to see more detail information, See,

Author

Programmed by SAKAI Hiroaki.

E-Mail: hsakai@m8.ffn.ne.jp

Web site: http://web.ffn.ne.jp/~hsakai/myfreesoft/index.html
Mirror site: http://hp.vector.co.jp/authors/VA014157/myfreesoft/index.html

Copyright

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.

Terms

References

  • [1] perl manual page
  • [2] /usr/local/share/doc/htmlsection/README
    - Readme file.
  • [3] man htmlsection - htmlsection's manual page.
  • [4] /usr/local/share/doc/htmlsection/htmlsection.html
    - Sample HTML file and description about htmlsection.
  • [5] /usr/local/share/doc/htmlsection/htmlsection_orig.html
    - Sample HTML file and description about htmlsection before convertion by htmlsection.
  • [6] noweb
  • [7] TeX
  • [8] htmlsection's source code

Table Index

List Index