asciidoctor 1.5.3 → 1.5.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 +67 -5
- data/CONTRIBUTING.adoc +171 -0
- data/LICENSE.adoc +1 -1
- data/README.adoc +62 -30
- data/bin/asciidoctor +3 -3
- data/bin/asciidoctor-safe +8 -5
- data/lib/asciidoctor.rb +10 -21
- data/lib/asciidoctor/abstract_block.rb +29 -11
- data/lib/asciidoctor/abstract_node.rb +11 -6
- data/lib/asciidoctor/callouts.rb +6 -10
- data/lib/asciidoctor/cli/options.rb +2 -2
- data/lib/asciidoctor/converter.rb +1 -1
- data/lib/asciidoctor/converter/docbook5.rb +46 -23
- data/lib/asciidoctor/converter/factory.rb +3 -3
- data/lib/asciidoctor/converter/html5.rb +27 -24
- data/lib/asciidoctor/converter/manpage.rb +72 -61
- data/lib/asciidoctor/converter/template.rb +5 -9
- data/lib/asciidoctor/document.rb +18 -18
- data/lib/asciidoctor/extensions.rb +5 -5
- data/lib/asciidoctor/helpers.rb +2 -2
- data/lib/asciidoctor/inline.rb +2 -2
- data/lib/asciidoctor/parser.rb +59 -59
- data/lib/asciidoctor/path_resolver.rb +23 -15
- data/lib/asciidoctor/reader.rb +34 -29
- data/lib/asciidoctor/section.rb +6 -8
- data/lib/asciidoctor/substitutors.rb +2 -2
- data/lib/asciidoctor/table.rb +46 -23
- data/lib/asciidoctor/version.rb +1 -1
- data/man/asciidoctor.1 +11 -11
- data/man/asciidoctor.adoc +2 -2
- data/test/attributes_test.rb +21 -37
- data/test/blocks_test.rb +41 -14
- data/test/converter_test.rb +4 -4
- data/test/document_test.rb +61 -8
- data/test/extensions_test.rb +2 -2
- data/test/invoker_test.rb +3 -3
- data/test/links_test.rb +13 -3
- data/test/lists_test.rb +114 -114
- data/test/manpage_test.rb +203 -0
- data/test/paragraphs_test.rb +3 -3
- data/test/parser_test.rb +4 -4
- data/test/preamble_test.rb +1 -1
- data/test/reader_test.rb +149 -109
- data/test/sections_test.rb +137 -27
- data/test/substitutions_test.rb +24 -16
- data/test/tables_test.rb +183 -31
- data/test/test_helper.rb +10 -22
- metadata +9 -6
- data/compat/asciidoc.conf +0 -395
- data/compat/font-awesome-3-compat.css +0 -397
data/test/test_helper.rb
CHANGED
@@ -10,12 +10,6 @@ require 'simplecov' if ENV['COVERAGE'] == 'true'
|
|
10
10
|
|
11
11
|
require File.join(ASCIIDOCTOR_PROJECT_DIR, 'lib', 'asciidoctor')
|
12
12
|
|
13
|
-
# NOTE we require minitest libraries explicitly to avoid a superfluous warning
|
14
|
-
require 'minitest/unit'
|
15
|
-
require 'minitest/spec'
|
16
|
-
require 'minitest/mock'
|
17
|
-
MiniTest::Unit.autorun
|
18
|
-
|
19
13
|
require 'socket'
|
20
14
|
require 'nokogiri'
|
21
15
|
require 'tmpdir'
|
@@ -26,12 +20,10 @@ autoload :Pathname, 'pathname'
|
|
26
20
|
RE_XMLNS_ATTRIBUTE = / xmlns="[^"]+"/
|
27
21
|
RE_DOCTYPE = /\s*<!DOCTYPE (.*)/
|
28
22
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
Minitest::Test = MiniTest::Unit::TestCase
|
34
|
-
end
|
23
|
+
require 'minitest/autorun'
|
24
|
+
|
25
|
+
# Minitest 4 doesn't have Minitest::Test
|
26
|
+
Minitest::Test = MiniTest::Unit::TestCase unless defined? Minitest::Test
|
35
27
|
|
36
28
|
class Minitest::Test
|
37
29
|
def windows?
|
@@ -234,7 +226,7 @@ class Minitest::Test
|
|
234
226
|
alias :entity :expand_entity
|
235
227
|
|
236
228
|
def invoke_cli_with_filenames(argv = [], filenames = [], &block)
|
237
|
-
|
229
|
+
|
238
230
|
filepaths = Array.new
|
239
231
|
|
240
232
|
filenames.each { |filename|
|
@@ -270,14 +262,10 @@ class Minitest::Test
|
|
270
262
|
end
|
271
263
|
|
272
264
|
def redirect_streams
|
273
|
-
old_stdout = $stdout
|
274
|
-
old_stderr = $stderr
|
275
|
-
stdout = StringIO.new
|
276
|
-
stderr = StringIO.new
|
277
|
-
$stdout = stdout
|
278
|
-
$stderr = stderr
|
265
|
+
old_stdout, $stdout = $stdout, (tmp_stdout = ::StringIO.new)
|
266
|
+
old_stderr, $stderr = $stderr, (tmp_stderr = ::StringIO.new)
|
279
267
|
begin
|
280
|
-
yield
|
268
|
+
yield tmp_stdout, tmp_stderr
|
281
269
|
ensure
|
282
270
|
$stdout = old_stdout
|
283
271
|
$stderr = old_stderr
|
@@ -304,7 +292,7 @@ class Minitest::Test
|
|
304
292
|
session.close
|
305
293
|
break
|
306
294
|
end
|
307
|
-
|
295
|
+
|
308
296
|
if resource == '/name/asciidoctor'
|
309
297
|
session.print %(HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n)
|
310
298
|
session.print %({"name": "asciidoctor"}\n)
|
@@ -343,7 +331,7 @@ class Minitest::Test
|
|
343
331
|
end
|
344
332
|
|
345
333
|
###
|
346
|
-
#
|
334
|
+
#
|
347
335
|
# Context goodness provided by @citrusbyte's contest.
|
348
336
|
# See https://github.com/citrusbyte/contest
|
349
337
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2016-01-05 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: asciimath
|
@@ -21,14 +21,14 @@ dependencies:
|
|
21
21
|
requirements:
|
22
22
|
- - "~>"
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 1.0.
|
24
|
+
version: 1.0.2
|
25
25
|
type: :development
|
26
26
|
prerelease: false
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
28
|
requirements:
|
29
29
|
- - "~>"
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: 1.0.
|
31
|
+
version: 1.0.2
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: coderay
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,16 +220,17 @@ executables:
|
|
220
220
|
- asciidoctor-safe
|
221
221
|
extensions: []
|
222
222
|
extra_rdoc_files:
|
223
|
+
- CHANGELOG.adoc
|
224
|
+
- CONTRIBUTING.adoc
|
223
225
|
- LICENSE.adoc
|
224
226
|
files:
|
225
227
|
- CHANGELOG.adoc
|
228
|
+
- CONTRIBUTING.adoc
|
226
229
|
- LICENSE.adoc
|
227
230
|
- README.adoc
|
228
231
|
- Rakefile
|
229
232
|
- bin/asciidoctor
|
230
233
|
- bin/asciidoctor-safe
|
231
|
-
- compat/asciidoc.conf
|
232
|
-
- compat/font-awesome-3-compat.css
|
233
234
|
- data/stylesheets/asciidoctor-default.css
|
234
235
|
- data/stylesheets/coderay-asciidoctor.css
|
235
236
|
- features/open_block.feature
|
@@ -320,6 +321,7 @@ files:
|
|
320
321
|
- test/invoker_test.rb
|
321
322
|
- test/links_test.rb
|
322
323
|
- test/lists_test.rb
|
324
|
+
- test/manpage_test.rb
|
323
325
|
- test/options_test.rb
|
324
326
|
- test/paragraphs_test.rb
|
325
327
|
- test/parser_test.rb
|
@@ -371,6 +373,7 @@ test_files:
|
|
371
373
|
- test/invoker_test.rb
|
372
374
|
- test/links_test.rb
|
373
375
|
- test/lists_test.rb
|
376
|
+
- test/manpage_test.rb
|
374
377
|
- test/options_test.rb
|
375
378
|
- test/paragraphs_test.rb
|
376
379
|
- test/parser_test.rb
|
data/compat/asciidoc.conf
DELETED
@@ -1,395 +0,0 @@
|
|
1
|
-
# This file is an AsciiDoc configuration file that makes
|
2
|
-
# AsciiDoc conform with Asciidoctor's fixes and customizations.
|
3
|
-
#
|
4
|
-
# Place this file in the same directory as your AsciiDoc document and the
|
5
|
-
# AsciiDoc processor (asciidoc) will automatically use it.
|
6
|
-
|
7
|
-
[miscellaneous]
|
8
|
-
newline=\n
|
9
|
-
|
10
|
-
[attributes]
|
11
|
-
# make html5 the default html backend
|
12
|
-
backend-alias-html=html5
|
13
|
-
asterisk=*
|
14
|
-
backtick=`
|
15
|
-
brvbar=¦
|
16
|
-
caret=^
|
17
|
-
# plus introduced in AsciiDoc 8.6.9
|
18
|
-
plus=+
|
19
|
-
blank=
|
20
|
-
tilde=~
|
21
|
-
cpp=C++
|
22
|
-
user-home={eval:os.path.expanduser('~')}
|
23
|
-
vbar=|
|
24
|
-
# NOTE use -a no-inline-literal to set compat-mode to default when using AsciiDoc Python
|
25
|
-
ifndef::no-inline-literal[]
|
26
|
-
compat-mode=legacy
|
27
|
-
endif::[]
|
28
|
-
|
29
|
-
[replacements]
|
30
|
-
# right single quote
|
31
|
-
(?<!\\)`'=’
|
32
|
-
# escaped right single quote
|
33
|
-
\\`'=`'
|
34
|
-
|
35
|
-
[quotes]
|
36
|
-
# disable single quotes as constrained formatting marks for emphasis
|
37
|
-
# this change can also be made in the document using the attribute entry :quotes.':
|
38
|
-
ifdef::compat-mode[]
|
39
|
-
'=
|
40
|
-
+=
|
41
|
-
++=
|
42
|
-
`=
|
43
|
-
``=#monospaced
|
44
|
-
`|`=monospaced
|
45
|
-
\##=#mark
|
46
|
-
\#=mark
|
47
|
-
endif::[]
|
48
|
-
|
49
|
-
# enables markdown-style headings
|
50
|
-
[titles]
|
51
|
-
sect0=^(=|#) +(?P<title>[\S].*?)(?: +\1)?$
|
52
|
-
sect1=^(==|##) +(?P<title>[\S].*?)(?: +\1)?$
|
53
|
-
sect2=^(===|###) +(?P<title>[\S].*?)(?: +\1)?$
|
54
|
-
sect3=^(====|####) +(?P<title>[\S].*?)(?: +\1)?$
|
55
|
-
sect4=^(=====|#####) +(?P<title>[\S].*?)(?: +\1)?$
|
56
|
-
sect5=^(======|######) +(?P<title>[\S].*?)(?: +\1)?$
|
57
|
-
|
58
|
-
# Disable subs on pass block by default
|
59
|
-
[blockdef-pass]
|
60
|
-
subs=none
|
61
|
-
|
62
|
-
# enables fenced code blocks
|
63
|
-
# FIXME I haven't sorted out yet how to do syntax highlighting
|
64
|
-
[blockdef-fenced-code]
|
65
|
-
delimiter=^```(?:\w+(?:,numbered)?)?$
|
66
|
-
ifdef::language[]
|
67
|
-
style=source
|
68
|
-
template::[source-filter-style]
|
69
|
-
endif::language[]
|
70
|
-
ifndef::language[]
|
71
|
-
template=listingblock
|
72
|
-
subs=verbatim
|
73
|
-
posattrs=style
|
74
|
-
endif::language[]
|
75
|
-
|
76
|
-
# enables blockquotes to be defined using two double quotes
|
77
|
-
[blockdef-air-quote]
|
78
|
-
template::[blockdef-quote]
|
79
|
-
delimiter=^""$
|
80
|
-
|
81
|
-
# markdown-style blockquote (paragraph only)
|
82
|
-
# FIXME does not strip leading > on subsequent lines
|
83
|
-
[paradef-markdown-quote]
|
84
|
-
delimiter=(?s)>\s*(?P<text>\S.*)
|
85
|
-
style=quote
|
86
|
-
quote-style=template="quoteparagraph",posattrs=("style","attribution","citetitle")
|
87
|
-
|
88
|
-
# fix regex for callout list to require number; also makes markdown-style blockquote work
|
89
|
-
[listdef-callout]
|
90
|
-
posattrs=style
|
91
|
-
delimiter=^<?(?P<index>\d+>) +(?P<text>.+)$
|
92
|
-
type=callout
|
93
|
-
tags=callout
|
94
|
-
style=arabic
|
95
|
-
|
96
|
-
# enables literal block to be used as source block
|
97
|
-
[blockdef-literal]
|
98
|
-
template::[source-filter-style]
|
99
|
-
|
100
|
-
# enables source block when source-highlighter is not defined
|
101
|
-
ifndef::source-highlighter[]
|
102
|
-
[source-filter-style]
|
103
|
-
source-style=template="listingblock",subs=("specialcharacters","callouts"),posattrs=("style","language","src_numbered","src_tab")
|
104
|
-
|
105
|
-
[paradef-default]
|
106
|
-
template::[source-filter-style]
|
107
|
-
|
108
|
-
[paradef-literal]
|
109
|
-
template::[source-filter-style]
|
110
|
-
|
111
|
-
[blockdef-open]
|
112
|
-
template::[source-filter-style]
|
113
|
-
|
114
|
-
[blockdef-listing]
|
115
|
-
template::[source-filter-style]
|
116
|
-
endif::source-highlighter[]
|
117
|
-
|
118
|
-
[tabledef-csv]
|
119
|
-
template::[tabledef-default]
|
120
|
-
delimiter=^,={3,}$
|
121
|
-
format=csv
|
122
|
-
|
123
|
-
[tabledef-dsv]
|
124
|
-
template::[tabledef-default]
|
125
|
-
delimiter=^:={3,}$
|
126
|
-
format=dsv
|
127
|
-
|
128
|
-
[macros]
|
129
|
-
ifdef::no-inline-literal[]
|
130
|
-
(?su)\\?\+\+(?P<passtext>.*?)\+\+=pass[specialcharacters]
|
131
|
-
(?su)(?<![+\w])(\\?\+(?P<passtext>\S|\S.*?\S)\+)(?![+\w])=pass[specialcharacters]
|
132
|
-
endif::no-inline-literal[]
|
133
|
-
|
134
|
-
# additional callout match behind line comments
|
135
|
-
#(?://|#|;;) ?\((?P<index>\d+)\)=callout
|
136
|
-
# additional callout match for XML
|
137
|
-
[\\]?<!--(?P<index>\d+)-->=callout
|
138
|
-
|
139
|
-
# --- or *** or ___ or - - - or * * * or _ _ _ (in addition to the built-in ''')
|
140
|
-
^ {0,3}([-\*_])( *)\1\2\1$=#ruler
|
141
|
-
|
142
|
-
# btn:[Save]
|
143
|
-
(?su)(?<!\w)\\?btn:\[(?P<attrlist>(?:\\\]|[^\]])+?)\]=button
|
144
|
-
|
145
|
-
# kbd:[F11] or kbd:[Ctrl+T] or kbd:[Ctrl,T]
|
146
|
-
(?su)(?<!\w)\\?kbd:\[(?P<attrlist>(?:\\\]|[^\]])+?)\]=keyboard
|
147
|
-
|
148
|
-
# menu:Search[] or menu:File[New...] or menu:View[Page Style, No Style]
|
149
|
-
# TODO implement menu:View[Page Style > No Style] syntax
|
150
|
-
(?su)(?<!\w)[\\]?(?P<name>menu):(?P<target>\w|\w.*?\S)?\[(?P<attrlist>.*?)\]=
|
151
|
-
|
152
|
-
ifdef::basebackend-html[]
|
153
|
-
|
154
|
-
[sect5]
|
155
|
-
<div class="sect5{style? {style}}{role? {role}}">
|
156
|
-
<h6{id? id="{id}"}>{title}</h6>
|
157
|
-
|
|
158
|
-
</div>
|
159
|
-
|
160
|
-
[button-inlinemacro]
|
161
|
-
<b class="button">{1}</b>
|
162
|
-
|
163
|
-
[keyboard-inlinemacro]
|
164
|
-
{set2:keys:{eval:re.split(r'(?<!\+ |.\+)\+', '{1}')}}
|
165
|
-
{2%}{eval:len({keys}) == 1}<kbd>{1}</kbd>
|
166
|
-
{2%}{eval:len({keys}) == 2}<kbd class="combo"><kbd>{eval:{keys}[0].strip()}</kbd>+<kbd>{eval:{keys}[1].strip()}</kbd></kbd>
|
167
|
-
{2%}{eval:len({keys}) == 3}<kbd class="combo"><kbd>{eval:{keys}[0].strip()}</kbd>+<kbd>{eval:{keys}[1].strip()}</kbd>+<kbd>{eval:{keys}[2].strip()}</kbd></kbd>
|
168
|
-
{2#}{3%}<kbd class="combo"><kbd>{1}</kbd>+<kbd>{2}</kbd></kbd>
|
169
|
-
{3#}<kbd class="combo"><kbd>{1}</kbd>+<kbd>{2}</kbd>+<kbd>{3}</kbd></kbd>
|
170
|
-
|
171
|
-
[menu-inlinemacro]
|
172
|
-
{1%}<span class="menu">{target}</span>
|
173
|
-
{1#}{2%}<span class="menuseq"><span class="menu">{target}</span> ▸ <span class="menuitem">{1}</span></span>
|
174
|
-
{2#}{3%}<span class="menuseq"><span class="menu">{target}</span> ▸ <span class="submenu">{1}</span> ▸ <span class="menuitem">{2}</span></span>
|
175
|
-
{3#}<span class="menuseq"><span class="menu">{target}</span> ▸ <span class="submenu">{1}</span> ▸ <span class="submenu">{2}</span> ▸ <span class="menuitem">{3}</span></span>
|
176
|
-
|
177
|
-
[literal-inlinemacro]
|
178
|
-
<code>{passtext}</code>
|
179
|
-
|
180
|
-
[tags]
|
181
|
-
emphasis=<em{1? class="{1}"}>|</em>
|
182
|
-
strong=<strong{1? class="{1}"}>|</strong>
|
183
|
-
monospaced=<code{1? class="{1}"}>|</code>
|
184
|
-
superscript=<sup{1? class="{1}"}>|</sup>
|
185
|
-
subscript=<sub{1? class="{1}"}>|</sub>
|
186
|
-
mark={1=<mark>}{1?<span class="{1}">}|{1?</span>}{1=</mark>}
|
187
|
-
|
188
|
-
[monospacedwords]
|
189
|
-
<code>{words}</code>
|
190
|
-
|
191
|
-
ifdef::linkattrs[]
|
192
|
-
[http-inlinemacro]
|
193
|
-
<a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a>
|
194
|
-
[https-inlinemacro]
|
195
|
-
<a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a>
|
196
|
-
[ftp-inlinemacro]
|
197
|
-
<a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a>
|
198
|
-
[file-inlinemacro]
|
199
|
-
<a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a>
|
200
|
-
[irc-inlinemacro]
|
201
|
-
<a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a>
|
202
|
-
[mailto-inlinemacro]
|
203
|
-
<a href="mailto:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={target}}</a>
|
204
|
-
[link-inlinemacro]
|
205
|
-
<a href="{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={target}}</a>
|
206
|
-
endif::linkattrs[]
|
207
|
-
|
208
|
-
[listtags-numbered]
|
209
|
-
list=<div class="olist{style? {style}}{compact-option? compact}{role? {role}}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<ol class="{style}"{style@loweralpha: type="a"}{style@lowerroman: type="i"}{style@upperalpha: type="A"}{style@upperroman: type="I"}{start? start="{start}"}>|</ol></div>
|
210
|
-
|
211
|
-
[tabletags-monospaced]
|
212
|
-
paragraph=<p class="tableblock"><code>|</code></p>
|
213
|
-
|
214
|
-
[sect0]
|
215
|
-
<h1{id? id="{id}"} class="sect0">{title}</h1>
|
216
|
-
|
|
217
|
-
|
218
|
-
# support for document title in embedded documents
|
219
|
-
ifeval::[not config.header_footer]
|
220
|
-
[preamble]
|
221
|
-
<h1>{title={doctitle}}</h1>{set:title-rendered:}
|
222
|
-
<div id="preamble">
|
223
|
-
<div class="sectionbody">
|
224
|
-
|
|
225
|
-
</div>
|
226
|
-
{toc,toc2#}{toc-placement$preamble:}{template:toc}
|
227
|
-
</div>
|
228
|
-
|
229
|
-
[sect1]
|
230
|
-
{title-rendered%}<h1>{doctitle}</h1>
|
231
|
-
<div class="sect1{style? {style}}{role? {role}}">
|
232
|
-
<h2{id? id="{id}"}>{numbered?{sectnum} }{title}</h2>
|
233
|
-
<div class="sectionbody">
|
234
|
-
|
|
235
|
-
</div>
|
236
|
-
</div>
|
237
|
-
endif::[]
|
238
|
-
|
239
|
-
# override to add the admonition name to the class attribute of the outer element
|
240
|
-
[admonitionblock]
|
241
|
-
<div class="admonitionblock {name}{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}>
|
242
|
-
<table><tr>
|
243
|
-
<td class="icon">
|
244
|
-
{data-uri%}{icons#}<img src="{icon={iconsdir}/{name}.png}" alt="{caption}">
|
245
|
-
{data-uri#}{icons#}<img alt="{caption}" src="data:image/png;base64,
|
246
|
-
{data-uri#}{icons#}{sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/{name}.png}")}"}">
|
247
|
-
{icons%}<div class="title">{caption}</div>
|
248
|
-
</td>
|
249
|
-
<td class="content">
|
250
|
-
<div class="title">{title}</div>
|
251
|
-
|
|
252
|
-
</td>
|
253
|
-
</tr></table>
|
254
|
-
</div>
|
255
|
-
|
256
|
-
# modified so that:
|
257
|
-
# a. imagesdir is only prepended if target is not a uri or absolute path (relative path only)
|
258
|
-
# b. automatic alt text is calculated from basename of target without extension
|
259
|
-
# note that the escaped_target attribute must be set in order to use a uri in the conditional attribute reference
|
260
|
-
[image-inlinemacro]
|
261
|
-
<span class="image{role? {role}}"{float? style="float: {float}"}>{set2:escaped_target:{eval:'{target}'.replace(':','\:')}}
|
262
|
-
<a class="image" href="{link}">
|
263
|
-
{data-uri%}<img src="{target@^(/|https?\://).*:{escaped_target}:{imagesdir?{imagesdir}}{imagesdir?/}{escaped_target}}" alt="{alt={eval:os.path.splitext(os.path.basename('{target}'))[0]}}"{width? width="{width}"}{height? height="{height}"}{title? title="{title}"}>
|
264
|
-
{data-uri#}<img alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}{title? title="{title}"}
|
265
|
-
{data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print 'src=\"data:'+mimetypes.guess_type(r'{target}')[0]+';base64,'; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}">
|
266
|
-
{link#}</a>
|
267
|
-
</span>
|
268
|
-
|
269
|
-
# modified so that:
|
270
|
-
# a. imagesdir is only prepended if target is not a uri or absolute path (relative path only)
|
271
|
-
# b. automatic alt text is calculated from basename of target without extension
|
272
|
-
# note that the escaped_target attribute must be set in order to use a uri in the conditional attribute reference
|
273
|
-
[image-blockmacro]
|
274
|
-
<div class="imageblock{style? {style}}{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}{align? style="text-align:{align};"}{float? style="float: {float}"}>
|
275
|
-
<div class="content">{set2:escaped_target:{eval:'{target}'.replace(':','\:')}}
|
276
|
-
<a class="image" href="{link}">
|
277
|
-
{data-uri%}<img src="{target@^(/|https?\://).*:{escaped_target}:{imagesdir?{imagesdir}}{imagesdir?/}{escaped_target}}" alt="{alt={eval:os.path.splitext(os.path.basename('{target}'))[0]}}"{width? width="{width}"}{height? height="{height}"}>
|
278
|
-
{data-uri#}<img alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}
|
279
|
-
{data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print 'src=\"data:'+mimetypes.guess_type(r'{target}')[0]+';base64,'; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}">
|
280
|
-
{link#}</a>
|
281
|
-
</div>
|
282
|
-
<div class="title">{caption={figure-caption} {counter:figure-number}. }{title}</div>
|
283
|
-
</div>
|
284
|
-
|
285
|
-
# a common template for emitting the attribute for a quote or verse block
|
286
|
-
# don't output attribution div if attribution or citetitle are both empty
|
287
|
-
[attribution]
|
288
|
-
{attribution,citetitle#}<div class="attribution">
|
289
|
-
— {attribution}{citetitle?<br>}
|
290
|
-
<cite>{citetitle}</cite>
|
291
|
-
{attribution,citetitle#}</div>
|
292
|
-
|
293
|
-
# override to use blockquote element for content and cite element for cite title
|
294
|
-
[quoteblock]
|
295
|
-
<div class="quoteblock{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}>
|
296
|
-
<div class="title">{title}</div>
|
297
|
-
<blockquote>
|
298
|
-
|
|
299
|
-
</blockquote>
|
300
|
-
template::[attribution]
|
301
|
-
</div>
|
302
|
-
|
303
|
-
# override to use cite element for cite title
|
304
|
-
[verseblock]
|
305
|
-
<div class="verseblock{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}>
|
306
|
-
<div class="title">{title}</div>
|
307
|
-
<pre class="content">
|
308
|
-
|
|
309
|
-
</pre>
|
310
|
-
template::[attribution]
|
311
|
-
</div>
|
312
|
-
|
313
|
-
# override tabletags to support cellbgcolor
|
314
|
-
[tabletags-default]
|
315
|
-
headdata=<th class="tableblock halign-{halign=left} valign-{valign=top}"{colspan@1:: colspan="{colspan}"}{rowspan@1:: rowspan="{rowspan}"}{cellbgcolor? style="background-color:{cellbgcolor};"}>|</th>
|
316
|
-
bodydata=<td class="tableblock halign-{halign=left} valign-{valign=top}"{colspan@1:: colspan="{colspan}"}{rowspan@1:: rowspan="{rowspan}"}{cellbgcolor? style="background-color:{cellbgcolor};"}>|</td>
|
317
|
-
|
318
|
-
# override header cells to use th
|
319
|
-
[tabletags-header]
|
320
|
-
bodydata=<th class="tableblock halign-{halign=left} valign-{valign=top}" {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }>|</th>
|
321
|
-
paragraph=<p class="tableblock">|</p>
|
322
|
-
|
323
|
-
[toc]
|
324
|
-
<div id="toc">
|
325
|
-
<div id="toctitle">{toc-title}</div>
|
326
|
-
ifdef::toc2[]
|
327
|
-
<script type="text/javascript">
|
328
|
-
document.body.className += ' toc2';
|
329
|
-
document.getElementById('toc').className = 'toc2';
|
330
|
-
</script>
|
331
|
-
endif::toc2[]
|
332
|
-
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
|
333
|
-
</div>
|
334
|
-
|
335
|
-
endif::basebackend-html[]
|
336
|
-
|
337
|
-
# Override docinfo to support subtitle
|
338
|
-
ifdef::basebackend-docbook[]
|
339
|
-
|
340
|
-
[sect5]
|
341
|
-
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
|
342
|
-
<title>{title}</title>
|
343
|
-
|
|
344
|
-
</section>
|
345
|
-
|
346
|
-
[tags]
|
347
|
-
monospaced=<literal{1? role="{1}"}>|</literal>
|
348
|
-
subscript=<subscript{1? role="{1}"}>|</subscript>
|
349
|
-
superscript=<superscript{1? role="{1}"}>|</superscript>
|
350
|
-
|
351
|
-
[button-inlinemacro]
|
352
|
-
<guibutton>{1}</guibutton>
|
353
|
-
|
354
|
-
[keyboard-inlinemacro]
|
355
|
-
{set2:keys:{eval:re.split(r'(?<!\+ |.\+)\+', '{1}')}}
|
356
|
-
{2%}{eval:len({keys}) == 1}<keycap>{1}</keycap>
|
357
|
-
{2%}{eval:len({keys}) == 2}<keycombo><keycap>{eval:{keys}[0].strip()}</keycap><keycap>{eval:{keys}[1].strip()}</keycap></keycombo>
|
358
|
-
{2%}{eval:len({keys}) == 3}<keycombo><keycap>{eval:{keys}[0].strip()}</keycap><keycap>{eval:{keys}[1].strip()}</keycap><keycap>{eval:{keys}[2].strip()}</keycap></keycombo>
|
359
|
-
{2#}{3%}<keycombo><keycap>{1}</keycap><keycap>{2}</keycap></keycombo>
|
360
|
-
{3#}<keycombo><keycap>{1}</keycap><keycap>{2}</keycap><keycap>{3}</keycap></keycombo>
|
361
|
-
|
362
|
-
[menu-inlinemacro]
|
363
|
-
{1%}<guimenu>{target}</guimenu>
|
364
|
-
{1#}{2%}<menuchoice><guimenu>{target}</guimenu> <guimenuitem>{1}</guimenuitem></menuchoice>
|
365
|
-
{2#}{3%}<menuchoice><guimenu>{target}</guimenu> <guisubmenu>{1}</guisubmenu> <guimenuitem>{2}</guimenuitem></menuchoice>
|
366
|
-
{3#}<menuchoice><guimenu>{target}</guimenu> <guisubmenu>{1}</guisubmenu> <guisubmenu>{2}</guisubmenu> <guimenuitem>{3}</guimenuitem></menuchoice>
|
367
|
-
|
368
|
-
# override tabletags to support cellbgcolor
|
369
|
-
[tabletags-default]
|
370
|
-
headdata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}>{cellbgcolor?<?dbfo bgcolor="{cellbgcolor}"?>}|</entry>
|
371
|
-
bodydata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}>{cellbgcolor?<?dbfo bgcolor="{cellbgcolor}"?>}|</entry>
|
372
|
-
|
373
|
-
[docinfo]
|
374
|
-
ifndef::notitle[]
|
375
|
-
{set2:subtitle_offset:{eval:'{doctitle}'.rfind(': ')}}
|
376
|
-
{eval:{subtitle_offset} != -1}<title>{eval:'{doctitle}'[0:{subtitle_offset}]}</title>
|
377
|
-
{eval:{subtitle_offset} != -1}<subtitle>{eval:'{doctitle}'[{subtitle_offset} + 2:]}</subtitle>
|
378
|
-
{eval:{subtitle_offset} < 0}<title>{doctitle}</title>
|
379
|
-
endif::notitle[]
|
380
|
-
<date>{revdate}</date>
|
381
|
-
# To ensure valid articleinfo/bookinfo when there is no AsciiDoc header.
|
382
|
-
{doctitle%}{revdate%}<date>{docdate}</date>
|
383
|
-
{authored#}<author>
|
384
|
-
<firstname>{firstname}</firstname>
|
385
|
-
<othername>{middlename}</othername>
|
386
|
-
<surname>{lastname}</surname>
|
387
|
-
<email>{email}</email>
|
388
|
-
{authored#}</author>
|
389
|
-
<authorinitials>{authorinitials}</authorinitials>
|
390
|
-
<revhistory><revision>{revnumber?<revnumber>{revnumber}</revnumber>}<date>{revdate}</date>{authorinitials?<authorinitials>{authorinitials}</authorinitials>}{revremark?<revremark>{revremark}</revremark>}</revision></revhistory>
|
391
|
-
{docinfo1,docinfo2#}{include:{docdir}/docinfo.xml}
|
392
|
-
{docinfo,docinfo2#}{include:{docdir}/{docname}-docinfo.xml}
|
393
|
-
<orgname>{orgname}</orgname>
|
394
|
-
|
395
|
-
endif::basebackend-docbook[]
|