asciidoctor 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of asciidoctor might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +387 -0
- data/README.adoc +358 -348
- data/asciidoctor.gemspec +30 -9
- data/bin/asciidoctor +3 -0
- data/bin/asciidoctor-safe +3 -0
- data/compat/asciidoc.conf +76 -4
- data/lib/asciidoctor.rb +174 -79
- data/lib/asciidoctor/abstract_block.rb +131 -101
- data/lib/asciidoctor/abstract_node.rb +108 -26
- data/lib/asciidoctor/attribute_list.rb +1 -1
- data/lib/asciidoctor/backends/_stylesheets.rb +204 -62
- data/lib/asciidoctor/backends/base_template.rb +11 -22
- data/lib/asciidoctor/backends/docbook45.rb +158 -163
- data/lib/asciidoctor/backends/docbook5.rb +103 -0
- data/lib/asciidoctor/backends/html5.rb +662 -445
- data/lib/asciidoctor/block.rb +54 -44
- data/lib/asciidoctor/cli/invoker.rb +41 -20
- data/lib/asciidoctor/cli/options.rb +66 -20
- data/lib/asciidoctor/debug.rb +1 -1
- data/lib/asciidoctor/document.rb +265 -100
- data/lib/asciidoctor/extensions.rb +443 -0
- data/lib/asciidoctor/helpers.rb +38 -6
- data/lib/asciidoctor/inline.rb +5 -5
- data/lib/asciidoctor/lexer.rb +532 -250
- data/lib/asciidoctor/{list_item.rb → list.rb} +33 -13
- data/lib/asciidoctor/path_resolver.rb +28 -2
- data/lib/asciidoctor/reader.rb +814 -455
- data/lib/asciidoctor/renderer.rb +128 -42
- data/lib/asciidoctor/section.rb +55 -41
- data/lib/asciidoctor/substituters.rb +380 -107
- data/lib/asciidoctor/table.rb +40 -30
- data/lib/asciidoctor/version.rb +1 -1
- data/man/asciidoctor.1 +32 -96
- data/man/{asciidoctor.ad → asciidoctor.adoc} +57 -48
- data/test/attributes_test.rb +200 -27
- data/test/blocks_test.rb +361 -22
- data/test/document_test.rb +496 -81
- data/test/extensions_test.rb +448 -0
- data/test/fixtures/basic-docinfo-footer.html +6 -0
- data/test/fixtures/basic-docinfo-footer.xml +8 -0
- data/test/fixtures/basic-docinfo.xml +3 -3
- data/test/fixtures/basic.asciidoc +1 -0
- data/test/fixtures/child-include.adoc +5 -0
- data/test/fixtures/custom-backends/haml/docbook45/block_paragraph.xml.haml +6 -0
- data/test/fixtures/custom-backends/haml/html5-tweaks/block_paragraph.html.haml +1 -0
- data/test/fixtures/custom-backends/haml/html5/block_paragraph.html.haml +3 -0
- data/test/fixtures/custom-backends/haml/html5/block_sidebar.html.haml +5 -0
- data/test/fixtures/custom-backends/slim/docbook45/block_paragraph.xml.slim +6 -0
- data/test/fixtures/custom-backends/slim/html5/block_paragraph.html.slim +3 -0
- data/test/fixtures/custom-backends/slim/html5/block_sidebar.html.slim +5 -0
- data/test/fixtures/docinfo-footer.html +1 -0
- data/test/fixtures/docinfo-footer.xml +9 -0
- data/test/fixtures/docinfo.xml +1 -0
- data/test/fixtures/grandchild-include.adoc +3 -0
- data/test/fixtures/parent-include-restricted.adoc +5 -0
- data/test/fixtures/parent-include.adoc +5 -0
- data/test/invoker_test.rb +82 -8
- data/test/lexer_test.rb +21 -3
- data/test/links_test.rb +34 -2
- data/test/lists_test.rb +304 -7
- data/test/options_test.rb +19 -3
- data/test/paragraphs_test.rb +13 -0
- data/test/paths_test.rb +22 -0
- data/test/preamble_test.rb +20 -0
- data/test/reader_test.rb +1096 -644
- data/test/renderer_test.rb +152 -12
- data/test/sections_test.rb +417 -76
- data/test/substitutions_test.rb +339 -138
- data/test/tables_test.rb +109 -4
- data/test/test_helper.rb +79 -13
- data/test/text_test.rb +111 -11
- metadata +54 -18
data/lib/asciidoctor/table.rb
CHANGED
@@ -52,7 +52,7 @@ class Table < AbstractBlock
|
|
52
52
|
attr_accessor :rows
|
53
53
|
|
54
54
|
# Public: Boolean specifies whether this table has a header row
|
55
|
-
|
55
|
+
attr_accessor :has_header_option
|
56
56
|
|
57
57
|
def initialize(parent, attributes)
|
58
58
|
super(parent, :table)
|
@@ -110,10 +110,10 @@ class Table < AbstractBlock
|
|
110
110
|
# set rowcount before splitting up body rows
|
111
111
|
@attributes['rowcount'] = @rows.body.size
|
112
112
|
|
113
|
-
if !rows.body.empty? &&
|
113
|
+
if !rows.body.empty? && @has_header_option
|
114
114
|
head = rows.body.shift
|
115
115
|
# styles aren't applied to header row
|
116
|
-
head.each {|c| c.
|
116
|
+
head.each {|c| c.style = nil }
|
117
117
|
# QUESTION why does AsciiDoc use an array for head? is it
|
118
118
|
# possible to have more than one based on the syntax?
|
119
119
|
rows.head = [head]
|
@@ -125,16 +125,6 @@ class Table < AbstractBlock
|
|
125
125
|
|
126
126
|
nil
|
127
127
|
end
|
128
|
-
|
129
|
-
# Public: Get the rendered String content for this Block. If the block
|
130
|
-
# has child blocks, the content method should cause them to be
|
131
|
-
# rendered and returned as content that can be included in the
|
132
|
-
# parent block's template.
|
133
|
-
def render
|
134
|
-
@document.playback_attributes @attributes
|
135
|
-
renderer.render('block_table', self)
|
136
|
-
end
|
137
|
-
|
138
128
|
end
|
139
129
|
|
140
130
|
# Public: A struct that encapsulates the collection of rows (head, foot, body) for a table
|
@@ -143,8 +133,12 @@ Table::Rows = Struct.new(:head, :foot, :body)
|
|
143
133
|
# Public: Methods to manage the columns of an AsciiDoc table. In particular, it
|
144
134
|
# keeps track of the column specs
|
145
135
|
class Table::Column < AbstractNode
|
136
|
+
# Public: Get/Set the Symbol style for this column.
|
137
|
+
attr_accessor :style
|
138
|
+
|
146
139
|
def initialize(table, index, attributes = {})
|
147
140
|
super(table, :column)
|
141
|
+
@style = attributes['style']
|
148
142
|
attributes['colnumber'] = index + 1
|
149
143
|
attributes['width'] ||= 1
|
150
144
|
attributes['halign'] ||= 'left'
|
@@ -177,6 +171,8 @@ end
|
|
177
171
|
|
178
172
|
# Public: Methods for managing the a cell in an AsciiDoc table.
|
179
173
|
class Table::Cell < AbstractNode
|
174
|
+
# Public: Get/Set the Symbol style for this cell (default: nil)
|
175
|
+
attr_accessor :style
|
180
176
|
|
181
177
|
# Public: An Integer of the number of columns this cell will span (default: nil)
|
182
178
|
attr_accessor :colspan
|
@@ -190,32 +186,43 @@ class Table::Cell < AbstractNode
|
|
190
186
|
# Public: The internal Asciidoctor::Document for a cell that has the asciidoc style
|
191
187
|
attr_reader :inner_document
|
192
188
|
|
193
|
-
def initialize(column, text, attributes = {})
|
189
|
+
def initialize(column, text, attributes = {}, cursor = nil)
|
194
190
|
super(column, :cell)
|
195
191
|
@text = text
|
192
|
+
@style = nil
|
196
193
|
@colspan = nil
|
197
194
|
@rowspan = nil
|
198
195
|
# TODO feels hacky
|
199
196
|
if !column.nil?
|
197
|
+
@style = column.attributes['style']
|
200
198
|
update_attributes(column.attributes)
|
201
199
|
end
|
202
200
|
if !attributes.nil?
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
if attributes.has_key? '
|
208
|
-
@rowspan = attributes['rowspan']
|
209
|
-
attributes.delete('rowspan')
|
210
|
-
end
|
201
|
+
@colspan = attributes.delete('colspan')
|
202
|
+
@rowspan = attributes.delete('rowspan')
|
203
|
+
# TODO eventualy remove the style attribute from the attributes hash
|
204
|
+
#@style = attributes.delete('style') if attributes.has_key? 'style'
|
205
|
+
@style = attributes['style'] if attributes.has_key? 'style'
|
211
206
|
update_attributes(attributes)
|
212
207
|
end
|
213
208
|
# only allow AsciiDoc cells in non-header rows
|
214
|
-
if @
|
209
|
+
if @style == :asciidoc && !column.table.header_row?
|
215
210
|
# FIXME hide doctitle from nested document; temporary workaround to fix
|
216
211
|
# nested document seeing doctitle and assuming it has its own document title
|
217
212
|
parent_doctitle = @document.attributes.delete('doctitle')
|
218
|
-
|
213
|
+
# NOTE we need to process the first line of content as it may not have been processed
|
214
|
+
# the included content cannot expect to match conditional terminators in the remaining
|
215
|
+
# lines of table cell content, it must be self-contained logic
|
216
|
+
inner_document_lines = @text.each_line.to_a
|
217
|
+
unless inner_document_lines.empty? || !inner_document_lines.first.include?('::')
|
218
|
+
unprocessed_lines = inner_document_lines[0..0]
|
219
|
+
processed_lines = PreprocessorReader.new(@document, unprocessed_lines).readlines
|
220
|
+
if processed_lines != unprocessed_lines
|
221
|
+
inner_document_lines.shift
|
222
|
+
inner_document_lines.unshift(*processed_lines)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
@inner_document = Document.new(inner_document_lines, :header_footer => false, :parent => @document, :cursor => cursor)
|
219
226
|
@document.attributes['doctitle'] = parent_doctitle unless parent_doctitle.nil?
|
220
227
|
end
|
221
228
|
end
|
@@ -227,12 +234,11 @@ class Table::Cell < AbstractNode
|
|
227
234
|
|
228
235
|
# Public: Handles the body data (tbody, tfoot), applying styles and partitioning into paragraphs
|
229
236
|
def content
|
230
|
-
style
|
231
|
-
if style == :asciidoc
|
237
|
+
if @style == :asciidoc
|
232
238
|
@inner_document.render
|
233
239
|
else
|
234
240
|
text.split(BLANK_LINE_PATTERN).map {|p|
|
235
|
-
|
241
|
+
!@style || @style == :header ? p : Inline.new(parent, :quoted, p, :type => @style).render
|
236
242
|
}
|
237
243
|
end
|
238
244
|
end
|
@@ -272,8 +278,11 @@ class Table::ParserContext
|
|
272
278
|
# Public: The cell delimiter compiled Regexp for this table.
|
273
279
|
attr_reader :delimiter_re
|
274
280
|
|
275
|
-
def initialize(table, attributes = {})
|
281
|
+
def initialize(reader, table, attributes = {})
|
282
|
+
@reader = reader
|
276
283
|
@table = table
|
284
|
+
# TODO if reader.cursor becomes a reference, this would require .dup
|
285
|
+
@last_cursor = reader.cursor
|
277
286
|
if attributes.has_key? 'format'
|
278
287
|
@format = attributes['format']
|
279
288
|
if !Table::DATA_FORMATS.include? @format
|
@@ -416,7 +425,7 @@ class Table::ParserContext
|
|
416
425
|
if format == 'psv'
|
417
426
|
cell_spec = take_cell_spec
|
418
427
|
if cell_spec.nil?
|
419
|
-
|
428
|
+
warn "asciidoctor: ERROR: #{@last_cursor.line_info}: table missing leading separator, recovering automatically"
|
420
429
|
cell_spec = {}
|
421
430
|
repeat = 1
|
422
431
|
else
|
@@ -450,7 +459,8 @@ class Table::ParserContext
|
|
450
459
|
column = @table.columns[@current_row.size]
|
451
460
|
end
|
452
461
|
|
453
|
-
cell = Table::Cell.new(column, cell_text, cell_spec)
|
462
|
+
cell = Table::Cell.new(column, cell_text, cell_spec, @last_cursor)
|
463
|
+
@last_cursor = @reader.cursor
|
454
464
|
unless cell.rowspan.nil? || cell.rowspan == 1
|
455
465
|
activate_rowspan(cell.rowspan, (cell.colspan || 1))
|
456
466
|
end
|
data/lib/asciidoctor/version.rb
CHANGED
data/man/asciidoctor.1
CHANGED
@@ -1,40 +1,23 @@
|
|
1
1
|
'\" t
|
2
2
|
.\" Title: asciidoctor
|
3
|
-
.\" Author:
|
4
|
-
.\" Generator:
|
5
|
-
.\" Date: 05
|
6
|
-
.\" Manual:
|
7
|
-
.\" Source:
|
3
|
+
.\" Author: Dan Allen
|
4
|
+
.\" Generator: Asciidoctor 0.1.4
|
5
|
+
.\" Date: 2013-09-05
|
6
|
+
.\" Manual: Asciidoctor Manual
|
7
|
+
.\" Source: Asciidoctor 0.1.4
|
8
8
|
.\" Language: English
|
9
9
|
.\"
|
10
|
-
.TH "ASCIIDOCTOR" "1" "05
|
11
|
-
.\" -----------------------------------------------------------------
|
12
|
-
.\" * Define some portability stuff
|
13
|
-
.\" -----------------------------------------------------------------
|
14
|
-
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
15
|
-
.\" http://bugs.debian.org/507673
|
16
|
-
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
17
|
-
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
10
|
+
.TH "ASCIIDOCTOR" "1" "2013-09-05" "Asciidoctor 0\&.1\&.4" "Asciidoctor Manual"
|
18
11
|
.ie \n(.g .ds Aq \(aq
|
19
12
|
.el .ds Aq '
|
20
|
-
.\" -----------------------------------------------------------------
|
21
|
-
.\" * set default formatting
|
22
|
-
.\" -----------------------------------------------------------------
|
23
|
-
.\" disable hyphenation
|
24
13
|
.nh
|
25
|
-
.\" disable justification (adjust text to left margin only)
|
26
14
|
.ad l
|
27
|
-
.\" -----------------------------------------------------------------
|
28
|
-
.\" * MAIN CONTENT STARTS HERE *
|
29
|
-
.\" -----------------------------------------------------------------
|
30
|
-
.SH "NAME"
|
31
|
-
asciidoctor \- converts an AsciiDoc source file to HTML, DocBook and other formats
|
32
15
|
.SH "SYNOPSIS"
|
33
16
|
.sp
|
34
|
-
\fBasciidoctor\fR [\fIOPTION\fR]\&... \fIFILE\fR
|
17
|
+
\fBasciidoctor\fR [\fIOPTION\fR]\&... \fIFILE\fR\&...
|
35
18
|
.SH "DESCRIPTION"
|
36
19
|
.sp
|
37
|
-
The asciidoctor(1) command converts the AsciiDoc source file \fIFILE\fR to HTML 5, DocBook 4\&.5 and other output formats\&.
|
20
|
+
The asciidoctor(1) command converts the AsciiDoc source file(s) \fIFILE\fR to HTML 5, DocBook 4\&.5, DocBook 5\&.0 and other custom output formats\&.
|
38
21
|
.sp
|
39
22
|
If \fIFILE\fR is \fI\-\fR then the AsciiDoc source is read from standard input\&.
|
40
23
|
.SH "OPTIONS"
|
@@ -47,22 +30,12 @@ Base directory containing the document and resources\&. Defaults to the director
|
|
47
30
|
.PP
|
48
31
|
\fB\-S, \-\-safe\-mode\fR=\fISAFE_MODE\fR
|
49
32
|
.RS 4
|
50
|
-
Set safe mode level:
|
51
|
-
\fIunsafe\fR,
|
52
|
-
\fIsafe\fR,
|
53
|
-
\fIserver\fR
|
54
|
-
or
|
55
|
-
\fIsecure\fR\&. Disables potentially dangerous macros in source files, such as include::[]\&. If not set, the safe mode level defaults to
|
56
|
-
\fIunsafe\fR
|
57
|
-
when Asciidoctor is invoked using this script\&.
|
33
|
+
Set safe mode level: \fIunsafe\fR, \fIsafe\fR, \fIserver\fR or \fIsecure\fR\&. Disables potentially dangerous macros in source files, such as include::[]\&. If not set, the safe mode level defaults to \fIunsafe\fR when Asciidoctor is invoked using this script\&.
|
58
34
|
.RE
|
59
35
|
.PP
|
60
36
|
\fB\-\-safe\fR
|
61
37
|
.RS 4
|
62
|
-
Set safe mode level to
|
63
|
-
\fIsafe\fR\&. Enables include macros, but restricts access to ancestor paths of source file\&. Provided for compatibility with the asciidoc command\&. If not set, the safe mode level defaults to
|
64
|
-
\fIunsafe\fR
|
65
|
-
when Asciidoctor is invoked using this script\&.
|
38
|
+
Set safe mode level to \fIsafe\fR\&. Enables include macros, but restricts access to ancestor paths of source file\&. Provided for compatibility with the asciidoc command\&. If not set, the safe mode level defaults to \fIunsafe\fR when Asciidoctor is invoked using this script\&.
|
66
39
|
.RE
|
67
40
|
.SS "Document Settings"
|
68
41
|
.PP
|
@@ -70,59 +43,19 @@ when Asciidoctor is invoked using this script\&.
|
|
70
43
|
.RS 4
|
71
44
|
Define, override or delete a document attribute\&. Command\-line attributes take precedence over attributes defined in the source file\&.
|
72
45
|
.sp
|
73
|
-
\fIATTRIBUTE\fR
|
74
|
-
is normally formatted as a key\-value pair, in the form
|
75
|
-
\fINAME=VALUE\fR\&. Alternate acceptable forms are
|
76
|
-
\fINAME\fR
|
77
|
-
(where the
|
78
|
-
\fIVALUE\fR
|
79
|
-
defaults to an empty string),
|
80
|
-
\fINAME!\fR
|
81
|
-
(unassigns the
|
82
|
-
\fINAME\fR
|
83
|
-
attribute) and
|
84
|
-
\fINAME=VALUE@\fR
|
85
|
-
(where
|
86
|
-
\fIVALUE\fR
|
87
|
-
does not override value of
|
88
|
-
\fINAME\fR
|
89
|
-
attribute if it\(cqs already defined in the source document)\&. Values containing spaces should be enclosed in quotes\&.
|
46
|
+
\fIATTRIBUTE\fR is normally formatted as a key\-value pair, in the form \fINAME=VALUE\fR\&. Alternate acceptable forms are \fINAME\fR (where the \fIVALUE\fR defaults to an empty string), \fINAME!\fR (unassigns the \fINAME\fR attribute) and \fINAME=VALUE@\fR (where \fIVALUE\fR does not override value of \fINAME\fR attribute if it\(cqs already defined in the source document)\&. Values containing spaces should be enclosed in quotes\&.
|
90
47
|
.sp
|
91
48
|
This option may be specified more than once\&.
|
92
49
|
.RE
|
93
50
|
.PP
|
94
51
|
\fB\-b, \-\-backend\fR=\fIBACKEND\fR
|
95
52
|
.RS 4
|
96
|
-
Backend output file format:
|
97
|
-
\fIdocbook45\fR
|
98
|
-
or
|
99
|
-
\fIhtml5\fR
|
100
|
-
supported out of the box\&. You can also use the backend alias names
|
101
|
-
\fIhtml\fR
|
102
|
-
(aliased to
|
103
|
-
\fIhtml5\fR) or
|
104
|
-
\fIdocbook\fR
|
105
|
-
(aliased to
|
106
|
-
\fIdocbook45\fR)\&. Defaults to
|
107
|
-
\fIhtml5\fR\&. Other options can be passed, but if Asciidoctor cannot find the backend, it will fail during rendering\&.
|
53
|
+
Backend output file format: \fIhtml5\fR, \fIdocbook45\fR and \fIdocbook5\fR supported out of the box\&. You can also use the backend alias names \fIhtml\fR (aliased to \fIhtml5\fR) or \fIdocbook\fR (aliased to \fIdocbook45\fR)\&. Defaults to \fIhtml5\fR\&. Other options can be passed, but if Asciidoctor cannot find the backend, it will fail during rendering\&.
|
108
54
|
.RE
|
109
55
|
.PP
|
110
56
|
\fB\-d, \-\-doctype\fR=\fIDOCTYPE\fR
|
111
57
|
.RS 4
|
112
|
-
Document type:
|
113
|
-
\fIarticle\fR,
|
114
|
-
\fIbook\fR
|
115
|
-
or
|
116
|
-
\fIinline\fR\&. Sets the root element when using the
|
117
|
-
\fIdocbook\fR
|
118
|
-
backend and the style class on the HTML body element when using the
|
119
|
-
\fIhtml\fR
|
120
|
-
backend\&. The
|
121
|
-
\fIbook\fR
|
122
|
-
document type allows multiple level\-0 section titles in a single document\&. The
|
123
|
-
\fIinline\fR
|
124
|
-
document type allows the content of a single paragraph to be formatted and returned without wrapping it in a containing element\&. Defaults to
|
125
|
-
\fIarticle\fR\&.
|
58
|
+
Document type: \fIarticle\fR, \fIbook\fR, \fImanpage\fR or \fIinline\fR\&. Sets the root element when using the \fIdocbook\fR backend and the style class on the HTML body element when using the \fIhtml\fR backend\&. The \fIbook\fR document type allows multiple level\-0 section titles in a single document\&. The \fImanpage\fR document type enables parsing of metadata necessary to produce a manpage\&. The \fIinline\fR document type allows the content of a single paragraph to be formatted and returned without wrapping it in a containing element\&. Defaults to \fIarticle\fR\&.
|
126
59
|
.RE
|
127
60
|
.SS "Rendering Control"
|
128
61
|
.PP
|
@@ -136,31 +69,24 @@ Compact the output by removing blank lines\&. Not enabled by default\&.
|
|
136
69
|
Destination output directory\&. Defaults to the directory containing the source file, or the working directory if the source is read from a stream\&. If specified, the directory is resolved relative to the working directory\&.
|
137
70
|
.RE
|
138
71
|
.PP
|
72
|
+
\fB\-E, \-\-template\-engine\fR=\fINAME\fR
|
73
|
+
.RS 4
|
74
|
+
Template engine to use for the custom render templates\&. The gem with the same name as the engine will be loaded automatically\&. This name is also used to build the full path to the custom templates\&.
|
75
|
+
.RE
|
76
|
+
.PP
|
139
77
|
\fB\-e, \-\-eruby\fR
|
140
78
|
.RS 4
|
141
|
-
Specifies the eRuby implementation to use for rendering the built\-in templates\&. Supported values are
|
142
|
-
\fIerb\fR
|
143
|
-
and
|
144
|
-
\fIerubis\fR\&. Defaults to
|
145
|
-
\fIerb\fR\&.
|
79
|
+
Specifies the eRuby implementation to use for rendering the built\-in templates\&. Supported values are \fIerb\fR and \fIerubis\fR\&. Defaults to \fIerb\fR\&.
|
146
80
|
.RE
|
147
81
|
.PP
|
148
82
|
\fB\-n, \-\-section\-numbers\fR
|
149
83
|
.RS 4
|
150
|
-
Auto\-number section titles\&. Synonym for
|
151
|
-
\fB\-\-attribute numbered\fR\&.
|
84
|
+
Auto\-number section titles\&. Synonym for \fB\-\-attribute numbered\fR\&.
|
152
85
|
.RE
|
153
86
|
.PP
|
154
87
|
\fB\-o, \-\-out\-file\fR=\fIOUT_FILE\fR
|
155
88
|
.RS 4
|
156
|
-
Write output to file
|
157
|
-
\fIOUT_FILE\fR\&. Defaults to the base name of the input file suffixed with
|
158
|
-
\fIbackend\fR
|
159
|
-
extension\&. If the input is read from standard input, then the output file defaults to stdout\&. If
|
160
|
-
\fIOUT_FILE\fR
|
161
|
-
is
|
162
|
-
\fI\-\fR
|
163
|
-
then the standard output is also used\&. If specified, the file is resolved relative to the working directory\&.
|
89
|
+
Write output to file \fIOUT_FILE\fR\&. Defaults to the base name of the input file suffixed with \fIbackend\fR extension\&. If the input is read from standard input, then the output file defaults to stdout\&. If \fIOUT_FILE\fR is \fI\-\fR then the standard output is also used\&. If specified, the file is resolved relative to the working directory\&.
|
164
90
|
.RE
|
165
91
|
.PP
|
166
92
|
\fB\-s, \-\-no\-header\-footer\fR
|
@@ -170,7 +96,11 @@ Suppress the document header and footer in the output\&.
|
|
170
96
|
.PP
|
171
97
|
\fB\-T, \-\-template\-dir\fR=\fIDIR\fR
|
172
98
|
.RS 4
|
173
|
-
|
99
|
+
A directory containing custom render templates that override one or more templates from the built\-in set\&. (requires \fItilt\fR gem)
|
100
|
+
.sp
|
101
|
+
If there is a subfolder that matches the engine name (if specified), that folder is appended to the template directory path\&. Similarly, if there is a subfolder in the resulting template directory that matches the name of the backend, that folder is appended to the template directory path\&.
|
102
|
+
.sp
|
103
|
+
This option may be specified more than once\&. Matching templates found in subsequent directories override ones previously discovered\&.
|
174
104
|
.RE
|
175
105
|
.SS "Processing Information"
|
176
106
|
.PP
|
@@ -225,3 +155,9 @@ Mailinglist / forum: <\fBhttp://discuss\&.asciidoctor\&.org\fR>
|
|
225
155
|
.SH "COPYING"
|
226
156
|
.sp
|
227
157
|
Copyright (C) 2012\-2013 Dan Allen and Ryan Waldron\&. Free use of this software is granted under the terms of the MIT License\&.
|
158
|
+
.SH "AUTHOR"
|
159
|
+
.PP
|
160
|
+
\fBDan Allen\fR
|
161
|
+
.RS 4
|
162
|
+
Author.
|
163
|
+
.RE
|
@@ -1,32 +1,31 @@
|
|
1
|
-
asciidoctor(1)
|
2
|
-
|
1
|
+
= asciidoctor(1)
|
2
|
+
Dan Allen; Ryan Waldron
|
3
3
|
:doctype: manpage
|
4
|
+
:man manual: Asciidoctor Manual
|
5
|
+
:man source: Asciidoctor 0.1.4
|
4
6
|
:awestruct-layout: base
|
5
7
|
|
8
|
+
== NAME
|
6
9
|
|
7
|
-
|
8
|
-
----
|
9
|
-
asciidoctor - converts an AsciiDoc source file to HTML, DocBook and other formats
|
10
|
+
asciidoctor - converts AsciiDoc source files to HTML, DocBook and other formats
|
10
11
|
|
11
12
|
|
12
|
-
SYNOPSIS
|
13
|
-
--------
|
14
|
-
*asciidoctor* ['OPTION']... 'FILE'
|
13
|
+
== SYNOPSIS
|
15
14
|
|
15
|
+
*asciidoctor* ['OPTION']... 'FILE'...
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
|
18
|
+
== DESCRIPTION
|
19
|
+
|
20
|
+
The asciidoctor(1) command converts the AsciiDoc source file(s) 'FILE' to HTML 5,
|
21
|
+
DocBook 4.5, DocBook 5.0 and other custom output formats.
|
21
22
|
|
22
23
|
If 'FILE' is '-' then the AsciiDoc source is read from standard input.
|
23
24
|
|
24
25
|
|
25
|
-
OPTIONS
|
26
|
-
-------
|
26
|
+
== OPTIONS
|
27
27
|
|
28
|
-
Security Settings
|
29
|
-
~~~~~~~~~~~~~~~~~
|
28
|
+
=== Security Settings
|
30
29
|
|
31
30
|
*-B, --base-dir*='DIR'::
|
32
31
|
Base directory containing the document and resources. Defaults to the
|
@@ -46,8 +45,7 @@ Security Settings
|
|
46
45
|
asciidoc command. If not set, the safe mode level defaults to 'unsafe' when
|
47
46
|
Asciidoctor is invoked using this script.
|
48
47
|
|
49
|
-
Document Settings
|
50
|
-
~~~~~~~~~~~~~~~~~
|
48
|
+
=== Document Settings
|
51
49
|
|
52
50
|
*-a, --attribute*='ATTRIBUTE'::
|
53
51
|
Define, override or delete a document attribute. Command-line attributes
|
@@ -62,22 +60,23 @@ the source document). Values containing spaces should be enclosed in quotes.
|
|
62
60
|
This option may be specified more than once.
|
63
61
|
|
64
62
|
*-b, --backend*='BACKEND'::
|
65
|
-
Backend output file format: 'docbook45'
|
66
|
-
You can also use the backend alias names 'html' (aliased to
|
67
|
-
'docbook' (aliased to 'docbook45'). Defaults to 'html5'. Other
|
68
|
-
be passed, but if Asciidoctor cannot find the backend, it will
|
69
|
-
rendering.
|
63
|
+
Backend output file format: 'html5', 'docbook45' and 'docbook5' supported
|
64
|
+
out of the box. You can also use the backend alias names 'html' (aliased to
|
65
|
+
'html5') or 'docbook' (aliased to 'docbook45'). Defaults to 'html5'. Other
|
66
|
+
options can be passed, but if Asciidoctor cannot find the backend, it will
|
67
|
+
fail during rendering.
|
70
68
|
|
71
69
|
*-d, --doctype*='DOCTYPE'::
|
72
|
-
Document type: 'article', 'book' or 'inline'. Sets the root
|
73
|
-
using the 'docbook' backend and the style class on the HTML
|
74
|
-
when using the 'html' backend. The 'book' document type allows
|
75
|
-
level-0 section titles in a single document. The '
|
76
|
-
|
77
|
-
|
70
|
+
Document type: 'article', 'book', 'manpage' or 'inline'. Sets the root
|
71
|
+
element when using the 'docbook' backend and the style class on the HTML
|
72
|
+
body element when using the 'html' backend. The 'book' document type allows
|
73
|
+
multiple level-0 section titles in a single document. The 'manpage' document
|
74
|
+
type enables parsing of metadata necessary to produce a manpage. The
|
75
|
+
'inline' document type allows the content of a single paragraph to be
|
76
|
+
formatted and returned without wrapping it in a containing element. Defaults
|
77
|
+
to 'article'.
|
78
78
|
|
79
|
-
Rendering Control
|
80
|
-
~~~~~~~~~~~~~~~~~
|
79
|
+
=== Rendering Control
|
81
80
|
|
82
81
|
*-C, --compact*::
|
83
82
|
Compact the output by removing blank lines. Not enabled by default.
|
@@ -87,6 +86,11 @@ Rendering Control
|
|
87
86
|
source file, or the working directory if the source is read from a stream.
|
88
87
|
If specified, the directory is resolved relative to the working directory.
|
89
88
|
|
89
|
+
*-E, --template-engine*='NAME'::
|
90
|
+
Template engine to use for the custom render templates. The gem with the
|
91
|
+
same name as the engine will be loaded automatically. This name is also
|
92
|
+
used to build the full path to the custom templates.
|
93
|
+
|
90
94
|
*-e, --eruby*::
|
91
95
|
Specifies the eRuby implementation to use for rendering the built-in
|
92
96
|
templates. Supported values are 'erb' and 'erubis'. Defaults to 'erb'.
|
@@ -105,12 +109,18 @@ Rendering Control
|
|
105
109
|
Suppress the document header and footer in the output.
|
106
110
|
|
107
111
|
*-T, --template-dir*='DIR'::
|
108
|
-
|
109
|
-
templates from the built-in set.
|
110
|
-
|
112
|
+
A directory containing custom render templates that override one or more
|
113
|
+
templates from the built-in set. (requires 'tilt' gem)
|
114
|
+
+
|
115
|
+
If there is a subfolder that matches the engine name (if specified), that folder
|
116
|
+
is appended to the template directory path. Similarly, if there is a subfolder
|
117
|
+
in the resulting template directory that matches the name of the backend, that
|
118
|
+
folder is appended to the template directory path.
|
119
|
+
+
|
120
|
+
This option may be specified more than once. Matching templates found in
|
121
|
+
subsequent directories override ones previously discovered.
|
111
122
|
|
112
|
-
Processing Information
|
113
|
-
~~~~~~~~~~~~~~~~~~~~~~
|
123
|
+
=== Processing Information
|
114
124
|
|
115
125
|
*--trace*::
|
116
126
|
Include backtrace information on errors. Not enabled by default.
|
@@ -119,8 +129,7 @@ Processing Information
|
|
119
129
|
Verbosely print processing information and configuration file checks to
|
120
130
|
stderr.
|
121
131
|
|
122
|
-
Program Information
|
123
|
-
~~~~~~~~~~~~~~~~~~~
|
132
|
+
=== Program Information
|
124
133
|
|
125
134
|
*-h, --help*::
|
126
135
|
Show the help message.
|
@@ -129,8 +138,8 @@ Program Information
|
|
129
138
|
Print program version number.
|
130
139
|
|
131
140
|
|
132
|
-
EXIT STATUS
|
133
|
-
|
141
|
+
== EXIT STATUS
|
142
|
+
|
134
143
|
*0*::
|
135
144
|
Success
|
136
145
|
|
@@ -139,13 +148,13 @@ EXIT STATUS
|
|
139
148
|
failure; unexpected error).
|
140
149
|
|
141
150
|
|
142
|
-
BUGS
|
143
|
-
|
151
|
+
== BUGS
|
152
|
+
|
144
153
|
See the *Asciidoctor* issue tracker: <**https://github.com/asciidoctor/asciidoctor/issues?state=open**>
|
145
154
|
|
146
155
|
|
147
|
-
AUTHORS
|
148
|
-
|
156
|
+
== AUTHORS
|
157
|
+
|
149
158
|
*Asciidoctor* was written by Dan Allen, Ryan Waldron, Jason Porter, Nick
|
150
159
|
Hengeveld and other contributors.
|
151
160
|
|
@@ -153,8 +162,8 @@ Hengeveld and other contributors.
|
|
153
162
|
many other individuals.
|
154
163
|
|
155
164
|
|
156
|
-
RESOURCES
|
157
|
-
|
165
|
+
== RESOURCES
|
166
|
+
|
158
167
|
Git source repository on GitHub: <**https://github.com/asciidoctor/asciidoctor**>
|
159
168
|
|
160
169
|
Project web site: <**http://asciidoctor.org**>
|
@@ -164,8 +173,8 @@ GitHub organization: <**http://github.com/asciidoctor**>
|
|
164
173
|
Mailinglist / forum: <**http://discuss.asciidoctor.org**>
|
165
174
|
|
166
175
|
|
167
|
-
COPYING
|
168
|
-
|
176
|
+
== COPYING
|
177
|
+
|
169
178
|
Copyright \(C) 2012-2013 Dan Allen and Ryan Waldron. Free use of this
|
170
179
|
software is granted under the terms of the MIT License.
|
171
180
|
|