git-scribe 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Rakefile +31 -0
- data/SPEC.asciidoc +126 -0
- data/TODO.txt +29 -0
- data/bin/git-scribe +2 -1
- data/docbook-xsl/.CatalogManager.properties.example +61 -0
- data/docbook-xsl/.urilist +1 -0
- data/git-scribe.gemspec +32 -0
- data/lib/git-scribe.rb +21 -315
- data/lib/git-scribe/check.rb +60 -0
- data/lib/git-scribe/cli.rb +84 -0
- data/lib/git-scribe/generate.rb +222 -0
- data/lib/git-scribe/init.rb +16 -0
- data/lib/git-scribe/version.rb +3 -0
- data/template/.gitignore +1 -0
- data/template/.gitscribe +5 -0
- data/test/check_test.rb +12 -0
- data/test/gen_test.rb +78 -0
- data/test/init_test.rb +36 -0
- data/test/test_helper.rb +44 -0
- metadata +49 -161
- data/example/book/big.asc +0 -5604
- data/example/book/holmes.asc +0 -12983
- data/example/output/META-INF/container.xml +0 -6
- data/example/output/OEBPS/ar01s02.html +0 -15
- data/example/output/OEBPS/ar01s03.html +0 -3
- data/example/output/OEBPS/content.opf +0 -21
- data/example/output/OEBPS/index.html +0 -5
- data/example/output/OEBPS/toc.ncx +0 -37
- data/example/output/a_case_of_identity.html +0 -725
- data/example/output/a_example_appendix.html +0 -63
- data/example/output/a_migration_notes.html +0 -95
- data/example/output/apa.html +0 -20
- data/example/output/apb.html +0 -6
- data/example/output/apc.html +0 -24
- data/example/output/apd.html +0 -30
- data/example/output/ape.html +0 -26
- data/example/output/apf.html +0 -9
- data/example/output/apg.html +0 -42
- data/example/output/aph.html +0 -89
- data/example/output/ar01s02.html +0 -12
- data/example/output/ar01s03.html +0 -34
- data/example/output/ar01s04.html +0 -77
- data/example/output/ar01s05.html +0 -272
- data/example/output/ar01s06.html +0 -35
- data/example/output/ar01s07.html +0 -105
- data/example/output/ar01s08.html +0 -33
- data/example/output/ar01s09.html +0 -12
- data/example/output/ar01s10.html +0 -14
- data/example/output/ar01s11.html +0 -34
- data/example/output/ar01s12.html +0 -63
- data/example/output/ar01s13.html +0 -156
- data/example/output/ar01s14.html +0 -330
- data/example/output/ar01s15.html +0 -22
- data/example/output/ar01s16.html +0 -27
- data/example/output/ar01s17.html +0 -94
- data/example/output/ar01s18.html +0 -359
- data/example/output/ar01s19.html +0 -373
- data/example/output/ar01s20.html +0 -27
- data/example/output/ar01s21.html +0 -33
- data/example/output/ar01s22.html +0 -351
- data/example/output/ar01s23.html +0 -21
- data/example/output/ar01s24.html +0 -69
- data/example/output/ar01s25.html +0 -60
- data/example/output/ar01s26.html +0 -217
- data/example/output/ar01s27.html +0 -88
- data/example/output/ar01s28.html +0 -237
- data/example/output/ar01s29.html +0 -68
- data/example/output/ar01s30.html +0 -154
- data/example/output/ar01s31.html +0 -6
- data/example/output/ar01s32.html +0 -22
- data/example/output/ar01s33.html +0 -209
- data/example/output/asciidoc_backends.html +0 -190
- data/example/output/asciidoc_document_types.html +0 -131
- data/example/output/attribute_entries.html +0 -185
- data/example/output/attribute_lists.html +0 -157
- data/example/output/attribute_references.html +0 -414
- data/example/output/attributelist_element.html +0 -143
- data/example/output/b_packager_notes.html +0 -68
- data/example/output/bi01.html +0 -18
- data/example/output/big.asc +0 -5604
- data/example/output/block_element_definitions.html +0 -448
- data/example/output/block_titles.html +0 -83
- data/example/output/blockid_element.html +0 -80
- data/example/output/book.asc +0 -5604
- data/example/output/book.epub +0 -0
- data/example/output/book.fo +0 -3788
- data/example/output/book.html +0 -8793
- data/example/output/book.xml +0 -8265
- data/example/output/c_asciidoc_safe_mode.html +0 -105
- data/example/output/callouts.html +0 -214
- data/example/output/catalog +0 -10
- data/example/output/colophon.html +0 -397
- data/example/output/configuration_files.html +0 -672
- data/example/output/converting_docbook_to_other_file_formats.html +0 -324
- data/example/output/d_using_asciidoc_with_non-english_languages.html +0 -107
- data/example/output/delimited_blocks.html +0 -455
- data/example/output/document_attributes.html +0 -95
- data/example/output/document_processing.html +0 -116
- data/example/output/document_structure.html +0 -493
- data/example/output/e_vim_syntax_highlighter.html +0 -111
- data/example/output/example_bibliography.html +0 -82
- data/example/output/example_colophon.html +0 -58
- data/example/output/example_glossary.html +0 -73
- data/example/output/example_index.html +0 -108
- data/example/output/f_attribute_options.html +0 -129
- data/example/output/filters.html +0 -179
- data/example/output/footnotes.html +0 -103
- data/example/output/g_diagnostics.html +0 -148
- data/example/output/generating_plain_text_files.html +0 -68
- data/example/output/getting_started.html +0 -87
- data/example/output/glossary.html +0 -95
- data/example/output/go01.html +0 -24
- data/example/output/h_backend_attributes.html +0 -308
- data/example/output/help_commands.html +0 -96
- data/example/output/holmes.asc +0 -12983
- data/example/output/image/octocat_professor.png +0 -0
- data/example/output/include/hello.c +0 -10
- data/example/output/index.html +0 -656
- data/example/output/indexes.html +0 -104
- data/example/output/intrinsic_attributes.html +0 -165
- data/example/output/ix01.html +0 -3
- data/example/output/lists.html +0 -666
- data/example/output/macros.html +0 -737
- data/example/output/manpage_documents.html +0 -124
- data/example/output/master.css +0 -281
- data/example/output/mathematical_formulas.html +0 -125
- data/example/output/page.html +0 -60
- data/example/output/paragraphs.html +0 -192
- data/example/output/pr01.html +0 -3
- data/example/output/source_code_highlighting.html +0 -59
- data/example/output/stylesheets/handbookish-quirks.css +0 -0
- data/example/output/stylesheets/handbookish.css +0 -233
- data/example/output/tables.html +0 -797
- data/example/output/text_formatting.html +0 -273
- data/example/output/the_adventure_of_the_beryl_coronet.html +0 -968
- data/example/output/the_adventure_of_the_blue_carbuncle.html +0 -825
- data/example/output/the_adventure_of_the_copper_beeches.html +0 -998
- data/example/output/the_adventure_of_the_engineer_s_thumb.html +0 -851
- data/example/output/the_adventure_of_the_noble_bachelor.html +0 -861
- data/example/output/the_adventure_of_the_speckled_band.html +0 -1015
- data/example/output/the_boscombe_valley_mystery.html +0 -974
- data/example/output/the_first_chapter.html +0 -110
- data/example/output/the_five_orange_pips.html +0 -776
- data/example/output/the_man_with_the_twisted_lip.html +0 -946
- data/example/output/the_red-headed_league.html +0 -950
- data/example/output/the_second_chapter.html +0 -95
- data/example/output/the_third_chapter.html +0 -58
- data/example/output/tips_and_tricks.html +0 -452
- data/example/output/title.html +0 -120
- data/example/output/titles.html +0 -126
@@ -1,95 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
-
<link rel="stylesheet" href="master.css" type="text/css" />
|
6
|
-
<title>Document Attributes</title>
|
7
|
-
</head>
|
8
|
-
|
9
|
-
<body>
|
10
|
-
<div class="nav" id="navheader">
|
11
|
-
<table width="100%">
|
12
|
-
<tr><td width="33%" align="left">
|
13
|
-
|
14
|
-
<a href="configuration_files.html">Prev</a><br/>
|
15
|
-
Configuration Files
|
16
|
-
|
17
|
-
</td><td width="33%" align="center">
|
18
|
-
|
19
|
-
<a href="index.html">Home</a><br/>
|
20
|
-
<strong>AsciiDoc User Guide</strong>
|
21
|
-
|
22
|
-
</td><td width="33%" align="right">
|
23
|
-
|
24
|
-
<a href="attribute_entries.html">Next</a><br/>
|
25
|
-
Attribute Entries
|
26
|
-
|
27
|
-
</td></tr>
|
28
|
-
</table>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<hr/>
|
32
|
-
|
33
|
-
<div class="content">
|
34
|
-
<div class="section" lang="en" xml:lang="en">
|
35
|
-
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
36
|
-
<a id="_document_attributes"></a>Document Attributes</h2></div></div></div>
|
37
|
-
<p>A document attribute is comprised of a <span class="emphasis"><em>name</em></span> and a textual <span class="emphasis"><em>value</em></span>
|
38
|
-
and is used for textual substitution in AsciiDoc documents and
|
39
|
-
configuration files. An attribute reference (an attribute name
|
40
|
-
enclosed in braces) is replaced by the corresponding attribute
|
41
|
-
value. Attribute names are case insensitive and can only contain
|
42
|
-
alphanumeric, dash and underscore characters.</p>
|
43
|
-
<p>There are four sources of document attributes (from highest to lowest
|
44
|
-
precedence):</p>
|
45
|
-
<div class="itemizedlist"><ul type="disc">
|
46
|
-
<li>
|
47
|
-
Command-line attributes.
|
48
|
-
</li>
|
49
|
-
<li>
|
50
|
-
AttributeEntry, AttributeList, Macro and BlockId elements.
|
51
|
-
</li>
|
52
|
-
<li>
|
53
|
-
Configuration file <code class="literal">[attributes]</code> sections.
|
54
|
-
</li>
|
55
|
-
<li>
|
56
|
-
Intrinsic attributes.
|
57
|
-
</li>
|
58
|
-
</ul></div>
|
59
|
-
<p>Within each of these divisions the last processed entry takes
|
60
|
-
precedence.</p>
|
61
|
-
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
|
62
|
-
<h3 class="title">Note</h3>
|
63
|
-
<p>If an attribute is not defined then the line containing the
|
64
|
-
attribute reference is dropped. This property is used extensively in
|
65
|
-
AsciiDoc configuration files to facilitate conditional markup
|
66
|
-
generation.</p>
|
67
|
-
</div>
|
68
|
-
</div>
|
69
|
-
|
70
|
-
</div>
|
71
|
-
|
72
|
-
<hr/>
|
73
|
-
|
74
|
-
<div class="nav" id="navfooter">
|
75
|
-
<table width="100%">
|
76
|
-
<tr><td width="33%" align="left">
|
77
|
-
|
78
|
-
<a href="configuration_files.html">Prev</a><br/>
|
79
|
-
Configuration Files
|
80
|
-
|
81
|
-
</td><td width="33%" align="center">
|
82
|
-
|
83
|
-
<a href="index.html">Home</a><br/>
|
84
|
-
AsciiDoc User Guide
|
85
|
-
|
86
|
-
</td><td width="33%" align="right">
|
87
|
-
|
88
|
-
<a href="attribute_entries.html">Next</a><br/>
|
89
|
-
Attribute Entries
|
90
|
-
|
91
|
-
</td></tr>
|
92
|
-
</table>
|
93
|
-
</div>
|
94
|
-
</body>
|
95
|
-
</html>
|
@@ -1,116 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
-
<link rel="stylesheet" href="master.css" type="text/css" />
|
6
|
-
<title>Document Processing</title>
|
7
|
-
</head>
|
8
|
-
|
9
|
-
<body>
|
10
|
-
<div class="nav" id="navheader">
|
11
|
-
<table width="100%">
|
12
|
-
<tr><td width="33%" align="left">
|
13
|
-
|
14
|
-
<a href="document_structure.html">Prev</a><br/>
|
15
|
-
Document Structure
|
16
|
-
|
17
|
-
</td><td width="33%" align="center">
|
18
|
-
|
19
|
-
<a href="index.html">Home</a><br/>
|
20
|
-
<strong>AsciiDoc User Guide</strong>
|
21
|
-
|
22
|
-
</td><td width="33%" align="right">
|
23
|
-
|
24
|
-
<a href="text_formatting.html">Next</a><br/>
|
25
|
-
Text Formatting
|
26
|
-
|
27
|
-
</td></tr>
|
28
|
-
</table>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<hr/>
|
32
|
-
|
33
|
-
<div class="content">
|
34
|
-
<div class="section" lang="en" xml:lang="en">
|
35
|
-
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
36
|
-
<a id="_document_processing"></a>Document Processing</h2></div></div></div>
|
37
|
-
<p>The AsciiDoc source document is read and processed as follows:</p>
|
38
|
-
<div class="orderedlist"><ol type="1">
|
39
|
-
<li>
|
40
|
-
The document <span class="emphasis"><em>Header</em></span> is parsed, header parameter values are
|
41
|
-
substituted into the configuration file <code class="literal">[header]</code> template section
|
42
|
-
which is then written to the output file.
|
43
|
-
</li>
|
44
|
-
<li>
|
45
|
-
Each document <span class="emphasis"><em>Section</em></span> is processed and its constituent elements
|
46
|
-
translated to the output file.
|
47
|
-
</li>
|
48
|
-
<li>
|
49
|
-
The configuration file <code class="literal">[footer]</code> template section is substituted
|
50
|
-
and written to the output file.
|
51
|
-
</li>
|
52
|
-
</ol></div>
|
53
|
-
<p>When a block element is encountered asciidoc(1) determines the type of
|
54
|
-
block by checking in the following order (first to last): (section)
|
55
|
-
Titles, BlockMacros, Lists, DelimitedBlocks, Tables, AttributeEntrys,
|
56
|
-
AttributeLists, BlockTitles, Paragraphs.</p>
|
57
|
-
<p>The default paragraph definition <code class="literal">[paradef-default]</code> is last element
|
58
|
-
to be checked.</p>
|
59
|
-
<p>Knowing the parsing order will help you devise unambiguous macro, list
|
60
|
-
and block syntax rules.</p>
|
61
|
-
<p>Inline substitutions within block elements are performed in the
|
62
|
-
following default order:</p>
|
63
|
-
<div class="orderedlist"><ol type="1">
|
64
|
-
<li>
|
65
|
-
Special characters
|
66
|
-
</li>
|
67
|
-
<li>
|
68
|
-
Quotes
|
69
|
-
</li>
|
70
|
-
<li>
|
71
|
-
Special words
|
72
|
-
</li>
|
73
|
-
<li>
|
74
|
-
Replacements
|
75
|
-
</li>
|
76
|
-
<li>
|
77
|
-
Attributes
|
78
|
-
</li>
|
79
|
-
<li>
|
80
|
-
Inline Macros
|
81
|
-
</li>
|
82
|
-
<li>
|
83
|
-
Replacements2
|
84
|
-
</li>
|
85
|
-
</ol></div>
|
86
|
-
<p>The substitutions and substitution order performed on
|
87
|
-
Title, Paragraph and DelimitedBlock elements is determined by
|
88
|
-
configuration file parameters.</p>
|
89
|
-
</div>
|
90
|
-
|
91
|
-
</div>
|
92
|
-
|
93
|
-
<hr/>
|
94
|
-
|
95
|
-
<div class="nav" id="navfooter">
|
96
|
-
<table width="100%">
|
97
|
-
<tr><td width="33%" align="left">
|
98
|
-
|
99
|
-
<a href="document_structure.html">Prev</a><br/>
|
100
|
-
Document Structure
|
101
|
-
|
102
|
-
</td><td width="33%" align="center">
|
103
|
-
|
104
|
-
<a href="index.html">Home</a><br/>
|
105
|
-
AsciiDoc User Guide
|
106
|
-
|
107
|
-
</td><td width="33%" align="right">
|
108
|
-
|
109
|
-
<a href="text_formatting.html">Next</a><br/>
|
110
|
-
Text Formatting
|
111
|
-
|
112
|
-
</td></tr>
|
113
|
-
</table>
|
114
|
-
</div>
|
115
|
-
</body>
|
116
|
-
</html>
|
@@ -1,493 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
-
<link rel="stylesheet" href="master.css" type="text/css" />
|
6
|
-
<title>Document Structure</title>
|
7
|
-
</head>
|
8
|
-
|
9
|
-
<body>
|
10
|
-
<div class="nav" id="navheader">
|
11
|
-
<table width="100%">
|
12
|
-
<tr><td width="33%" align="left">
|
13
|
-
|
14
|
-
<a href="asciidoc_backends.html">Prev</a><br/>
|
15
|
-
AsciiDoc Backends
|
16
|
-
|
17
|
-
</td><td width="33%" align="center">
|
18
|
-
|
19
|
-
<a href="index.html">Home</a><br/>
|
20
|
-
<strong>AsciiDoc User Guide</strong>
|
21
|
-
|
22
|
-
</td><td width="33%" align="right">
|
23
|
-
|
24
|
-
<a href="document_processing.html">Next</a><br/>
|
25
|
-
Document Processing
|
26
|
-
|
27
|
-
</td></tr>
|
28
|
-
</table>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<hr/>
|
32
|
-
|
33
|
-
<div class="content">
|
34
|
-
<div class="section" lang="en" xml:lang="en">
|
35
|
-
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
36
|
-
<a id="_document_structure"></a>Document Structure</h2></div></div></div>
|
37
|
-
<p>An AsciiDoc document consists of a series of <a class="link" href="glossary.html#X8">block elements</a>
|
38
|
-
starting with an optional document Header, followed by an optional
|
39
|
-
Preamble, followed by zero or more document Sections.</p>
|
40
|
-
<p>Almost any combination of zero or more elements constitutes a valid
|
41
|
-
AsciiDoc document: documents can range from a single sentence to a
|
42
|
-
multi-part book.</p>
|
43
|
-
<div class="section" lang="en" xml:lang="en">
|
44
|
-
<div class="titlepage"><div><div><h3 class="title">
|
45
|
-
<a id="_block_elements"></a>Block Elements</h3></div></div></div>
|
46
|
-
<p>Block elements consist of one or more lines of text and may contain
|
47
|
-
other block elements.</p>
|
48
|
-
<p>The AsciiDoc block structure can be informally summarized as follows
|
49
|
-
<sup>[<a id="id36113202" href="#ftn.id36113202" class="footnote">1</a>]</sup>:</p>
|
50
|
-
<pre class="literallayout">Document ::= (Header?,Preamble?,Section*)
|
51
|
-
Header ::= (Title,(AuthorInfo,RevisionInfo?)?)
|
52
|
-
AuthorInfo ::= (FirstName,(MiddleName?,LastName)?,EmailAddress?)
|
53
|
-
RevisionInfo ::= (RevisionNumber?,RevisionDate,RevisionRemark?)
|
54
|
-
Preamble ::= (SectionBody)
|
55
|
-
Section ::= (Title,SectionBody?,(Section)*)
|
56
|
-
SectionBody ::= ((BlockTitle?,Block)|BlockMacro)+
|
57
|
-
Block ::= (Paragraph|DelimitedBlock|List|Table)
|
58
|
-
List ::= (BulletedList|NumberedList|LabeledList|CalloutList)
|
59
|
-
BulletedList ::= (ListItem)+
|
60
|
-
NumberedList ::= (ListItem)+
|
61
|
-
CalloutList ::= (ListItem)+
|
62
|
-
LabeledList ::= (ListEntry)+
|
63
|
-
ListEntry ::= (ListLabel,ListItem)
|
64
|
-
ListLabel ::= (ListTerm+)
|
65
|
-
ListItem ::= (ItemText,(List|ListParagraph|ListContinuation)*)</pre>
|
66
|
-
<p>Where:</p>
|
67
|
-
<div class="itemizedlist"><ul type="disc">
|
68
|
-
<li>
|
69
|
-
<span class="emphasis"><em>?</em></span> implies zero or one occurrence, <span class="emphasis"><em>+</em></span> implies one or more
|
70
|
-
occurrences, <span class="emphasis"><em>*</em></span> implies zero or more occurrences.
|
71
|
-
</li>
|
72
|
-
<li>
|
73
|
-
All block elements are separated by line boundaries.
|
74
|
-
</li>
|
75
|
-
<li>
|
76
|
-
<code class="literal">BlockId</code>, <code class="literal">AttributeEntry</code> and <code class="literal">AttributeList</code> block elements (not
|
77
|
-
shown) can occur almost anywhere.
|
78
|
-
</li>
|
79
|
-
<li>
|
80
|
-
There are a number of document type and backend specific
|
81
|
-
restrictions imposed on the block syntax.
|
82
|
-
</li>
|
83
|
-
<li>
|
84
|
-
The following elements cannot contain blank lines: Header, Title,
|
85
|
-
Paragraph, ItemText.
|
86
|
-
</li>
|
87
|
-
<li>
|
88
|
-
A ListParagraph is a Paragraph with its <span class="emphasis"><em>listelement</em></span> option set.
|
89
|
-
</li>
|
90
|
-
<li>
|
91
|
-
A ListContinuation is a <a class="link" href="lists.html#X15" title="List Item Continuation">list continuation element</a>.
|
92
|
-
</li>
|
93
|
-
</ul></div>
|
94
|
-
</div>
|
95
|
-
<div class="section" lang="en" xml:lang="en">
|
96
|
-
<div class="titlepage"><div><div><h3 class="title">
|
97
|
-
<a id="X95"></a>Header</h3></div></div></div>
|
98
|
-
<p>The Header contains document meta-data, typically title plus optional
|
99
|
-
authorship and revision information:</p>
|
100
|
-
<div class="itemizedlist"><ul type="disc">
|
101
|
-
<li>
|
102
|
-
The Header is optional, but if it is used it must start with a
|
103
|
-
document <a class="link" href="titles.html" title="Titles">title</a>.
|
104
|
-
</li>
|
105
|
-
<li>
|
106
|
-
Optional Author and Revision information immediately follows the
|
107
|
-
header title.
|
108
|
-
</li>
|
109
|
-
<li>
|
110
|
-
The document header must be separated from the remainder of the
|
111
|
-
document by one or more blank lines and cannot contain blank lines.
|
112
|
-
</li>
|
113
|
-
<li>
|
114
|
-
The header can include comments.
|
115
|
-
</li>
|
116
|
-
<li>
|
117
|
-
The header can include <a class="link" href="attribute_entries.html" title="Attribute Entries">attribute entries</a>, typically
|
118
|
-
<span class="emphasis"><em>doctype</em></span>, <span class="emphasis"><em>lang</em></span>, <span class="emphasis"><em>encoding</em></span>, <span class="emphasis"><em>icons</em></span>, <span class="emphasis"><em>data-uri</em></span>, <span class="emphasis"><em>toc</em></span>,
|
119
|
-
<span class="emphasis"><em>numbered</em></span>.
|
120
|
-
</li>
|
121
|
-
<li>
|
122
|
-
Header attributes are overridden by command-line attributes.
|
123
|
-
</li>
|
124
|
-
<li>
|
125
|
-
If the header contains non-UTF-8 characters then the <span class="emphasis"><em>encoding</em></span> must
|
126
|
-
precede the header (either in the document or on the command-line).
|
127
|
-
</li>
|
128
|
-
</ul></div>
|
129
|
-
<p>Here’s an example AsciiDoc document header:</p>
|
130
|
-
<pre class="literallayout">Writing Documentation using AsciiDoc
|
131
|
-
====================================
|
132
|
-
Joe Bloggs <jbloggs@mymail.com>
|
133
|
-
v2.0, February 2003:
|
134
|
-
Rewritten for version 2 release.</pre>
|
135
|
-
<p>The author information line contains the author’s name optionally
|
136
|
-
followed by the author’s email address. The author’s name is formatted
|
137
|
-
like:</p>
|
138
|
-
<pre class="literallayout">firstname[ [middlename ]lastname][ <email>]]</pre>
|
139
|
-
<p>i.e. a first name followed by optional middle and last names followed
|
140
|
-
by an email address in that order. Multi-word first, middle and last
|
141
|
-
names can be entered using the underscore as a word separator. The
|
142
|
-
email address comes last and must be enclosed in angle <> brackets.
|
143
|
-
Here a some examples of author information lines:</p>
|
144
|
-
<pre class="literallayout">Joe Bloggs <jbloggs@mymail.com>
|
145
|
-
Joe Bloggs
|
146
|
-
Vincent Willem van_Gogh</pre>
|
147
|
-
<p>If the author line does not match the above specification then the
|
148
|
-
entire author line is treated as the first name.</p>
|
149
|
-
<p>The optional revision information line follows the author information
|
150
|
-
line. The revision information can be one of two formats:</p>
|
151
|
-
<div class="orderedlist"><ol type="1">
|
152
|
-
<li>
|
153
|
-
<p>
|
154
|
-
An optional document revision number followed by an optional
|
155
|
-
revision date followed by an optional revision remark:
|
156
|
-
</p>
|
157
|
-
<div class="itemizedlist"><ul type="disc">
|
158
|
-
<li>
|
159
|
-
If the revision number is specified it must be followed by a
|
160
|
-
comma.
|
161
|
-
</li>
|
162
|
-
<li>
|
163
|
-
The revision number must contain at least one numeric character.
|
164
|
-
</li>
|
165
|
-
<li>
|
166
|
-
Any non-numeric characters preceding the first numeric character
|
167
|
-
will be dropped.
|
168
|
-
</li>
|
169
|
-
<li>
|
170
|
-
If a revision remark is specified it must be preceded by a colon.
|
171
|
-
The revision remark extends from the colon up to the next blank
|
172
|
-
line, attribute entry or comment and is subject to normal text
|
173
|
-
substitutions.
|
174
|
-
</li>
|
175
|
-
<li>
|
176
|
-
If a revision number or remark has been set but the revision date
|
177
|
-
has not been set then the revision date is set to the value of the
|
178
|
-
<span class="emphasis"><em>docdate</em></span> attribute.
|
179
|
-
</li>
|
180
|
-
</ul></div>
|
181
|
-
</li>
|
182
|
-
<li>
|
183
|
-
An RCS/CVS/SVN $Id$ marker (if an $Id$ revision marker is used the
|
184
|
-
header author line can be omitted).
|
185
|
-
</li>
|
186
|
-
</ol></div>
|
187
|
-
<p>Here a some examples of header revision lines:</p>
|
188
|
-
<pre class="literallayout">v2.0, February 2003
|
189
|
-
February 2003
|
190
|
-
v2.0,
|
191
|
-
v2.0, February 2003: Rewritten for version 2 release.
|
192
|
-
February 2003: Rewritten for version 2 release.
|
193
|
-
v2.0,: Rewritten for version 2 release.
|
194
|
-
:Rewritten for version 2 release.</pre>
|
195
|
-
<p>You can override or set header parameters by passing <span class="emphasis"><em>revnumber</em></span>,
|
196
|
-
<span class="emphasis"><em>revremark</em></span>, <span class="emphasis"><em>revdate</em></span>, <span class="emphasis"><em>email</em></span>, <span class="emphasis"><em>author</em></span>, <span class="emphasis"><em>authorinitials</em></span>,
|
197
|
-
<span class="emphasis"><em>firstname</em></span> and <span class="emphasis"><em>lastname</em></span> attributes using the asciidoc(1) <code class="literal">-a</code>
|
198
|
-
(<code class="literal">--attribute</code>) command-line option. For example:</p>
|
199
|
-
<pre class="literallayout">$ asciidoc -a revdate=2004/07/27 article.txt</pre>
|
200
|
-
<p>The <span class="emphasis"><em>revnumber</em></span> attribute can be an RCS/CVS/SVN $Id$ marker.
|
201
|
-
Attributes can also be added to the header for substitution in the
|
202
|
-
header template with <a class="link" href="attribute_entries.html" title="Attribute Entries">Attribute Entry</a> elements.</p>
|
203
|
-
<div class="section" lang="en" xml:lang="en">
|
204
|
-
<div class="titlepage"><div><div><h4 class="title">
|
205
|
-
<a id="X87"></a>Additional document header information</h4></div></div></div>
|
206
|
-
<p><span class="emphasis"><em>docinfo</em></span> files are a mechanism for optionally including additional
|
207
|
-
meta-data in the header of the output document.</p>
|
208
|
-
<p>Two docinfo files are recognized: one named <code class="literal">docinfo</code> and a second
|
209
|
-
named like the AsciiDoc source file with a <code class="literal">-docinfo</code> suffix. For
|
210
|
-
example, if the source document is called <code class="literal">mydoc.txt</code> then the
|
211
|
-
document information files would be <code class="literal">docinfo.xml</code> and
|
212
|
-
<code class="literal">mydoc-docinfo.xml</code> (for DocBook outputs) and <code class="literal">docinfo.html</code> and
|
213
|
-
<code class="literal">mydoc-docinfo.html</code> (for HTML outputs).</p>
|
214
|
-
<p>The <a class="link" href="h_backend_attributes.html#X97">docinfo</a> attributes control which
|
215
|
-
docinfo files are included in the output files.</p>
|
216
|
-
<p>The contents docinfo file is dependent on the type of output:</p>
|
217
|
-
<div class="variablelist"><dl>
|
218
|
-
<dt><span class="term">
|
219
|
-
HTML
|
220
|
-
</span></dt>
|
221
|
-
<dd>
|
222
|
-
Valid <span class="emphasis"><em>head</em></span> child elements. Typically <span class="emphasis"><em>style</em></span> and <span class="emphasis"><em>script</em></span> elements
|
223
|
-
for CSS and JavaScript inclusion.
|
224
|
-
</dd>
|
225
|
-
<dt><span class="term">
|
226
|
-
DocBook
|
227
|
-
</span></dt>
|
228
|
-
<dd>
|
229
|
-
Valid <span class="emphasis"><em>articleinfo</em></span> or <span class="emphasis"><em>bookinfo</em></span> child elements. DocBook defines
|
230
|
-
numerous elements for document meta-data, for example: copyrights,
|
231
|
-
document history and authorship information. See the DocBook
|
232
|
-
<code class="literal">./doc/article-docinfo.xml</code> example that comes with the AsciiDoc
|
233
|
-
distribution. The rendering of meta-data elements (or not) is
|
234
|
-
DocBook processor dependent.
|
235
|
-
</dd>
|
236
|
-
</dl></div>
|
237
|
-
</div>
|
238
|
-
</div>
|
239
|
-
<div class="section" lang="en" xml:lang="en">
|
240
|
-
<div class="titlepage"><div><div><h3 class="title">
|
241
|
-
<a id="X86"></a>Preamble</h3></div></div></div>
|
242
|
-
<p>The Preamble is an optional untitled section body between the document
|
243
|
-
Header and the first Section title.</p>
|
244
|
-
</div>
|
245
|
-
<div class="section" lang="en" xml:lang="en">
|
246
|
-
<div class="titlepage"><div><div><h3 class="title">
|
247
|
-
<a id="_sections"></a>Sections</h3></div></div></div>
|
248
|
-
<p>In addition to the document title (level 0), AsciiDoc supports four
|
249
|
-
section levels: 1 (top) to 4 (bottom). Section levels are delimited
|
250
|
-
by section <a class="link" href="titles.html" title="Titles">titles</a>. Sections are translated using
|
251
|
-
configuration file <a class="link" href="document_structure.html#X93" title="Section markup templates">section markup templates</a>. AsciiDoc
|
252
|
-
generates the following <a class="link" href="intrinsic_attributes.html" title="Intrinsic Attributes">intrinsic attributes</a> specifically for
|
253
|
-
use in section markup templates:</p>
|
254
|
-
<div class="variablelist"><dl>
|
255
|
-
<dt><span class="term">
|
256
|
-
level
|
257
|
-
</span></dt>
|
258
|
-
<dd>
|
259
|
-
The <code class="literal">level</code> attribute is the section level number, it is normally just
|
260
|
-
the <a class="link" href="titles.html" title="Titles">title</a> level number (1..4). However, if the <code class="literal">leveloffset</code>
|
261
|
-
attribute is defined it will be added to the <code class="literal">level</code> attribute. The
|
262
|
-
<code class="literal">leveloffset</code> attribute is useful for <a class="link" href="tips_and_tricks.html#X90" title="Combining separate documents">combining documents</a>.
|
263
|
-
</dd>
|
264
|
-
<dt><span class="term">
|
265
|
-
sectnum
|
266
|
-
</span></dt>
|
267
|
-
<dd>
|
268
|
-
The <code class="literal">-n</code> (<code class="literal">--section-numbers</code>) command-line option generates the
|
269
|
-
<code class="literal">sectnum</code> (section number) attribute. The <code class="literal">sectnum</code> attribute is used
|
270
|
-
for section numbers in HTML outputs (DocBook section numbering are
|
271
|
-
handled automatically by the DocBook toolchain commands).
|
272
|
-
</dd>
|
273
|
-
</dl></div>
|
274
|
-
<div class="section" lang="en" xml:lang="en">
|
275
|
-
<div class="titlepage"><div><div><h4 class="title">
|
276
|
-
<a id="X93"></a>Section markup templates</h4></div></div></div>
|
277
|
-
<p>Section markup templates specify output markup and are defined in
|
278
|
-
AsciiDoc configuration files. Section markup template names are
|
279
|
-
derived as follows (in order of precedence):</p>
|
280
|
-
<div class="orderedlist"><ol type="1">
|
281
|
-
<li>
|
282
|
-
<p>
|
283
|
-
From the title’s first positional attribute or <span class="emphasis"><em>template</em></span>
|
284
|
-
attribute. For example, the following three section titles are
|
285
|
-
functionally equivalent:
|
286
|
-
</p>
|
287
|
-
<pre class="literallayout">[[terms]]
|
288
|
-
[glossary]
|
289
|
-
List of Terms
|
290
|
-
-------------
|
291
|
-
|
292
|
-
["glossary",id="terms"]
|
293
|
-
List of Terms
|
294
|
-
-------------
|
295
|
-
|
296
|
-
[template="glossary",id="terms"]
|
297
|
-
List of Terms
|
298
|
-
-------------</pre>
|
299
|
-
</li>
|
300
|
-
<li>
|
301
|
-
When the title text matches a configuration file
|
302
|
-
<a class="link" href="document_structure.html#X16" title="Special Section Titles"><code class="literal">[specialsections]</code></a> entry.
|
303
|
-
</li>
|
304
|
-
<li>
|
305
|
-
If neither of the above the default <code class="literal">sect<level></code> template is used
|
306
|
-
(where <code class="literal"><level></code> is a number from 1 to 4).
|
307
|
-
</li>
|
308
|
-
</ol></div>
|
309
|
-
<p>In addition to the normal section template names (<span class="emphasis"><em>sect1</em></span>, <span class="emphasis"><em>sect2</em></span>,
|
310
|
-
<span class="emphasis"><em>sect3</em></span>, <span class="emphasis"><em>sect4</em></span>) AsciiDoc has the following templates for
|
311
|
-
frontmatter, backmatter and other special sections: <span class="emphasis"><em>abstract</em></span>,
|
312
|
-
<span class="emphasis"><em>preface</em></span>, <span class="emphasis"><em>colophon</em></span>, <span class="emphasis"><em>dedication</em></span>, <span class="emphasis"><em>glossary</em></span>, <span class="emphasis"><em>bibliography</em></span>,
|
313
|
-
<span class="emphasis"><em>synopsis</em></span>, <span class="emphasis"><em>appendix</em></span>, <span class="emphasis"><em>index</em></span>. These special section templates
|
314
|
-
generate the corresponding Docbook elements; for HTML outputs they
|
315
|
-
default to the <span class="emphasis"><em>sect1</em></span> section template.</p>
|
316
|
-
</div>
|
317
|
-
<div class="section" lang="en" xml:lang="en">
|
318
|
-
<div class="titlepage"><div><div><h4 class="title">
|
319
|
-
<a id="_section_ids"></a>Section IDs</h4></div></div></div>
|
320
|
-
<p>If no explicit section ID is specified an ID will be synthesised from
|
321
|
-
the section title. The primary purpose of this feature is to ensure
|
322
|
-
persistence of table of contents links (permalinks): the missing
|
323
|
-
section IDs are generated dynamically by the JavaScript TOC generator
|
324
|
-
<span class="strong"><strong>after</strong></span> the page is loaded. If you link to a dynamically generated TOC
|
325
|
-
address the page will load but the browser will ignore the (as yet
|
326
|
-
ungenerated) section ID.</p>
|
327
|
-
<p>The IDs are generated by the following algorithm:</p>
|
328
|
-
<div class="itemizedlist"><ul type="disc">
|
329
|
-
<li>
|
330
|
-
Replace all non-alphanumeric title characters with underscores.
|
331
|
-
</li>
|
332
|
-
<li>
|
333
|
-
Strip leading or trailing underscores.
|
334
|
-
</li>
|
335
|
-
<li>
|
336
|
-
Convert to lowercase.
|
337
|
-
</li>
|
338
|
-
<li>
|
339
|
-
Prepend the <code class="literal">idprefix</code> attribute (so there’s no possibility of name
|
340
|
-
clashes with existing document IDs). Prepend an underscore if the
|
341
|
-
<code class="literal">idprefix</code> attribute is not defined.
|
342
|
-
</li>
|
343
|
-
<li>
|
344
|
-
A numbered suffix (<code class="literal">_2</code>, <code class="literal">_3</code> …) is added if a same named
|
345
|
-
auto-generated section ID exists.
|
346
|
-
</li>
|
347
|
-
</ul></div>
|
348
|
-
<p>For example the title <span class="emphasis"><em>Jim’s House</em></span> would generate the ID
|
349
|
-
<code class="literal">_jim_s_house</code>.</p>
|
350
|
-
<p>Section ID synthesis can be disabled by undefining the <code class="literal">sectids</code>
|
351
|
-
attribute.</p>
|
352
|
-
</div>
|
353
|
-
<div class="section" lang="en" xml:lang="en">
|
354
|
-
<div class="titlepage"><div><div><h4 class="title">
|
355
|
-
<a id="X16"></a>Special Section Titles</h4></div></div></div>
|
356
|
-
<p>AsciiDoc has a mechanism for mapping predefined section titles
|
357
|
-
auto-magically to specific markup templates. For example a title
|
358
|
-
<span class="emphasis"><em>Appendix A: Code Reference</em></span> will automatically use the <span class="emphasis"><em>appendix</em></span>
|
359
|
-
<a class="link" href="document_structure.html#X93" title="Section markup templates">section markup template</a>. The mappings from title to template
|
360
|
-
name are specified in <code class="literal">[specialsections]</code> sections in the Asciidoc
|
361
|
-
language configuration files (<code class="literal">lang-*.conf</code>). Section entries are
|
362
|
-
formatted like:</p>
|
363
|
-
<pre class="literallayout"><title>=<template></pre>
|
364
|
-
<p><code class="literal"><title></code> is a Python regular expression and <code class="literal"><template></code> is the name
|
365
|
-
of a configuration file markup template section. If the <code class="literal"><title></code>
|
366
|
-
matches an AsciiDoc document section title then the backend output is
|
367
|
-
marked up using the <code class="literal"><template></code> markup template (instead of the
|
368
|
-
default <code class="literal">sect<level></code> section template). The <code class="literal">{title}</code> attribute value
|
369
|
-
is set to the value of the matched regular expression group named
|
370
|
-
<span class="emphasis"><em>title</em></span>, if there is no <span class="emphasis"><em>title</em></span> group <code class="literal">{title}</code> defaults to the whole
|
371
|
-
of the AsciiDoc section title. If <code class="literal"><template></code> is blank then any
|
372
|
-
existing entry with the same <code class="literal"><title></code> will be deleted.</p>
|
373
|
-
<div class="sidebar">
|
374
|
-
<p class="title"><b>Special section titles vs. explicit template names</b></p>
|
375
|
-
<p>AsciiDoc has two mechanisms for specifying non-default section markup
|
376
|
-
templates: you can specify the template name explicitly (using the
|
377
|
-
<span class="emphasis"><em>template</em></span> attribute) or indirectly (using <span class="emphasis"><em>special section titles</em></span>).
|
378
|
-
Specifying a <a class="link" href="document_structure.html#X93" title="Section markup templates">section template</a> attribute explicitly is
|
379
|
-
preferred. Auto-magical <span class="emphasis"><em>special section titles</em></span> have the following
|
380
|
-
drawbacks:</p>
|
381
|
-
<div class="itemizedlist"><ul type="disc">
|
382
|
-
<li>
|
383
|
-
They are non-obvious, you have to know the exact matching
|
384
|
-
title for each special section on a language by language basis.
|
385
|
-
</li>
|
386
|
-
<li>
|
387
|
-
Section titles are predefined and can only be customised with a
|
388
|
-
configuration change.
|
389
|
-
</li>
|
390
|
-
<li>
|
391
|
-
The implementation is complicated by multiple languages: every
|
392
|
-
special section title has to be defined for each language (in each
|
393
|
-
of the <code class="literal">lang-*.conf</code> files).
|
394
|
-
</li>
|
395
|
-
</ul></div>
|
396
|
-
<p>Specifying special section template names explicitly does add more
|
397
|
-
noise to the source document (the <span class="emphasis"><em>template</em></span> attribute declaration),
|
398
|
-
but the intention is obvious and the syntax is consistent with other
|
399
|
-
AsciiDoc elements c.f. bibliographic, Q&A and glossary lists.</p>
|
400
|
-
<p>Special section titles have been deprecated but are retained for
|
401
|
-
backward compatibility.</p>
|
402
|
-
</div>
|
403
|
-
</div>
|
404
|
-
</div>
|
405
|
-
<div class="section" lang="en" xml:lang="en">
|
406
|
-
<div class="titlepage"><div><div><h3 class="title">
|
407
|
-
<a id="_inline_elements"></a>Inline Elements</h3></div></div></div>
|
408
|
-
<p><a class="link" href="glossary.html#X34">Inline document elements</a> are used to format text and to
|
409
|
-
perform various types of text substitution. Inline elements and inline
|
410
|
-
element syntax is defined in the asciidoc(1) configuration files.</p>
|
411
|
-
<p>Here is a list of AsciiDoc inline elements in the (default) order in
|
412
|
-
which they are processed:</p>
|
413
|
-
<div class="variablelist"><dl>
|
414
|
-
<dt><span class="term">
|
415
|
-
Special characters
|
416
|
-
</span></dt>
|
417
|
-
<dd>
|
418
|
-
These character sequences escape special characters used by
|
419
|
-
the backend markup (typically <code class="literal"><</code>, <code class="literal">></code>, and <code class="literal">&</code> characters).
|
420
|
-
See <code class="literal">[specialcharacters]</code> configuration file sections.
|
421
|
-
</dd>
|
422
|
-
<dt><span class="term">
|
423
|
-
Quotes
|
424
|
-
</span></dt>
|
425
|
-
<dd>
|
426
|
-
Elements that markup words and phrases; usually for character
|
427
|
-
formatting. See <code class="literal">[quotes]</code> configuration file sections.
|
428
|
-
</dd>
|
429
|
-
<dt><span class="term">
|
430
|
-
Special Words
|
431
|
-
</span></dt>
|
432
|
-
<dd>
|
433
|
-
Word or word phrase patterns singled out for markup without
|
434
|
-
the need for further annotation. See <code class="literal">[specialwords]</code>
|
435
|
-
configuration file sections.
|
436
|
-
</dd>
|
437
|
-
<dt><span class="term">
|
438
|
-
Replacements
|
439
|
-
</span></dt>
|
440
|
-
<dd>
|
441
|
-
Each replacement defines a word or word phrase pattern to
|
442
|
-
search for along with corresponding replacement text. See
|
443
|
-
<code class="literal">[replacements]</code> configuration file sections.
|
444
|
-
</dd>
|
445
|
-
<dt><span class="term">
|
446
|
-
Attribute references
|
447
|
-
</span></dt>
|
448
|
-
<dd>
|
449
|
-
Document attribute names enclosed in braces are replaced by
|
450
|
-
the corresponding attribute value.
|
451
|
-
</dd>
|
452
|
-
<dt><span class="term">
|
453
|
-
Inline Macros
|
454
|
-
</span></dt>
|
455
|
-
<dd>
|
456
|
-
Inline macros are replaced by the contents of parametrized
|
457
|
-
configuration file sections.
|
458
|
-
</dd>
|
459
|
-
</dl></div>
|
460
|
-
</div>
|
461
|
-
<div class="footnotes">
|
462
|
-
<br><hr width="100" align="left">
|
463
|
-
<div class="footnote"><p><sup>[<a id="ftn.id36113202" href="#id36113202" class="simpara">1</a>] </sup>This is a rough structural guide, not a rigorous syntax
|
464
|
-
definition</p></div>
|
465
|
-
</div>
|
466
|
-
</div>
|
467
|
-
|
468
|
-
</div>
|
469
|
-
|
470
|
-
<hr/>
|
471
|
-
|
472
|
-
<div class="nav" id="navfooter">
|
473
|
-
<table width="100%">
|
474
|
-
<tr><td width="33%" align="left">
|
475
|
-
|
476
|
-
<a href="asciidoc_backends.html">Prev</a><br/>
|
477
|
-
AsciiDoc Backends
|
478
|
-
|
479
|
-
</td><td width="33%" align="center">
|
480
|
-
|
481
|
-
<a href="index.html">Home</a><br/>
|
482
|
-
AsciiDoc User Guide
|
483
|
-
|
484
|
-
</td><td width="33%" align="right">
|
485
|
-
|
486
|
-
<a href="document_processing.html">Next</a><br/>
|
487
|
-
Document Processing
|
488
|
-
|
489
|
-
</td></tr>
|
490
|
-
</table>
|
491
|
-
</div>
|
492
|
-
</body>
|
493
|
-
</html>
|