metanorma-standoc 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +0 -6
- data/Gemfile.lock +19 -17
- data/lib/asciidoctor/standoc/base.rb +2 -1
- data/lib/asciidoctor/standoc/basicdoc.rng +27 -2
- data/lib/asciidoctor/standoc/blocks.rb +25 -22
- data/lib/asciidoctor/standoc/cleanup.rb +6 -3
- data/lib/asciidoctor/standoc/front.rb +4 -3
- data/lib/asciidoctor/standoc/macros.rb +28 -3
- data/lib/asciidoctor/standoc/reqt.rb +1 -0
- data/lib/asciidoctor/standoc/reqt.rng +3 -0
- data/lib/asciidoctor/standoc/table.rb +3 -1
- data/lib/asciidoctor/standoc/utils.rb +15 -3
- data/lib/metanorma/standoc/latexml_requirement.rb +31 -22
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -0
- data/spec/asciidoctor-standoc/base_spec.rb +13 -7
- data/spec/asciidoctor-standoc/blocks_spec.rb +30 -11
- data/spec/asciidoctor-standoc/cleanup_spec.rb +9 -9
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +24 -29
- data/spec/asciidoctor-standoc/macros_spec.rb +17 -1
- data/spec/asciidoctor-standoc/refs_spec.rb +23 -15
- data/spec/asciidoctor-standoc/table_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +91 -93
- data/spec/vcr_cassettes/isobib_get_123.yml +33 -31
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +34 -32
- data/spec/vcr_cassettes/isobib_get_124.yml +70 -71
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +4 -4
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +35 -35
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c157670399555bab56fdbdd58841925b41d78286554eed8d9a10ad385d3a17d0
|
4
|
+
data.tar.gz: 2d4cb5ef535eb8b5a6ee8903df46f32a7d35089f7fa682c67a3701e0daa3993c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ca6acc2a135f1b13d96600e7b02035e4f1f442f272b9cfc48bf2d4c95eec4a79558a212f592a97509449081cbb390aee4f8f14f0255a4761809108975e2fbb2
|
7
|
+
data.tar.gz: 0c94d48235edbdac98bb5dcc5fc8290bf0d0e2a6ea017aa1ac6b496c5b39bf55c3e21265303cd769b85b82cc70a30790d0ede4f5a4b7612fc097d5f5f54da3cc
|
data/.travis.yml
CHANGED
@@ -9,17 +9,11 @@ rvm:
|
|
9
9
|
- 2.4
|
10
10
|
- ruby-head
|
11
11
|
before_install:
|
12
|
-
- nvm install 8
|
13
|
-
- npm install -g puppeteer
|
14
|
-
- npm install
|
15
12
|
- curl -L https://cpanmin.us | perl - --sudo App::cpanminus
|
16
13
|
- sudo cpanm --notest LaTeXML@0.8.4
|
17
14
|
- curl -L https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/travis.sh | bash
|
18
|
-
- plantuml -version
|
19
15
|
- gem install bundler -v 2.0.1
|
20
16
|
- bundle update
|
21
|
-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo bash -c "apt-get update && curl -L https://raw.githubusercontent.com/metanorma/metanorma-linux-setup/master/ubuntu.sh | bash" ; fi
|
22
|
-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then travis_wait brew install --HEAD https://raw.githubusercontent.com/metanorma/homebrew-metanorma/master/Formula/metanorma.rb ; fi
|
23
17
|
matrix:
|
24
18
|
allow_failures:
|
25
19
|
- rvm: ruby-head
|
data/Gemfile.lock
CHANGED
@@ -7,6 +7,7 @@ PATH
|
|
7
7
|
html2doc (~> 0.8.11)
|
8
8
|
iev (~> 0.2.1)
|
9
9
|
isodoc (~> 1.0.0)
|
10
|
+
mimemagic
|
10
11
|
relaton (~> 0.5.0)
|
11
12
|
relaton-iev (~> 0.1.0)
|
12
13
|
ruby-jing
|
@@ -22,7 +23,7 @@ GEM
|
|
22
23
|
asciimath (1.0.8)
|
23
24
|
ast (2.4.0)
|
24
25
|
byebug (11.0.1)
|
25
|
-
cnccs (0.1.
|
26
|
+
cnccs (0.1.4)
|
26
27
|
coderay (1.1.2)
|
27
28
|
concurrent-ruby (1.1.5)
|
28
29
|
crack (0.4.3)
|
@@ -35,7 +36,7 @@ GEM
|
|
35
36
|
multipart-post (>= 1.2, < 3)
|
36
37
|
ffi (1.11.1)
|
37
38
|
formatador (0.2.5)
|
38
|
-
gb-agencies (0.0.
|
39
|
+
gb-agencies (0.0.6)
|
39
40
|
guard (2.15.1)
|
40
41
|
formatador (>= 0.2.4)
|
41
42
|
listen (>= 2.7, < 4.0)
|
@@ -75,7 +76,7 @@ GEM
|
|
75
76
|
sassc (~> 2)
|
76
77
|
thread_safe
|
77
78
|
uuidtools
|
78
|
-
isoics (0.1.
|
79
|
+
isoics (0.1.8)
|
79
80
|
json (2.2.0)
|
80
81
|
liquid (4.0.3)
|
81
82
|
listen (3.1.5)
|
@@ -90,6 +91,7 @@ GEM
|
|
90
91
|
mime-types (3.3)
|
91
92
|
mime-types-data (~> 3.2015)
|
92
93
|
mime-types-data (3.2019.0904)
|
94
|
+
mimemagic (0.3.3)
|
93
95
|
mini_portile2 (2.4.0)
|
94
96
|
multipart-post (2.1.1)
|
95
97
|
nenv (0.3.0)
|
@@ -112,7 +114,7 @@ GEM
|
|
112
114
|
rb-fsevent (0.10.3)
|
113
115
|
rb-inotify (0.10.0)
|
114
116
|
ffi (~> 1.0)
|
115
|
-
relaton (0.5.
|
117
|
+
relaton (0.5.5)
|
116
118
|
relaton-gb (~> 0.6.0)
|
117
119
|
relaton-iec (~> 0.4.0)
|
118
120
|
relaton-ietf (~> 0.6.0)
|
@@ -120,33 +122,33 @@ GEM
|
|
120
122
|
relaton-itu (~> 0.3.0)
|
121
123
|
relaton-nist (~> 0.3.0)
|
122
124
|
relaton-ogc (~> 0.1.0)
|
123
|
-
relaton-bib (0.3.
|
125
|
+
relaton-bib (0.3.8)
|
124
126
|
addressable
|
125
127
|
nokogiri
|
126
|
-
relaton-gb (0.6.
|
128
|
+
relaton-gb (0.6.4)
|
127
129
|
cnccs (~> 0.1.1)
|
128
130
|
gb-agencies (~> 0.0.1)
|
129
131
|
relaton-iso-bib (~> 0.3.0)
|
130
|
-
relaton-iec (0.4.
|
132
|
+
relaton-iec (0.4.6)
|
131
133
|
addressable
|
132
134
|
relaton-iso-bib (~> 0.3.0)
|
133
|
-
relaton-ietf (0.6.
|
135
|
+
relaton-ietf (0.6.5)
|
134
136
|
relaton-bib (~> 0.3.0)
|
135
137
|
relaton-iev (0.1.1)
|
136
138
|
relaton (~> 0.5.0)
|
137
|
-
relaton-iso (0.6.
|
139
|
+
relaton-iso (0.6.6)
|
138
140
|
relaton-iec (~> 0.4.0)
|
139
141
|
relaton-iso-bib (~> 0.3.0)
|
140
|
-
relaton-iso-bib (0.3.
|
142
|
+
relaton-iso-bib (0.3.7)
|
141
143
|
isoics (~> 0.1.6)
|
142
144
|
relaton-bib (~> 0.3.0)
|
143
145
|
ruby_deep_clone (~> 0.8.0)
|
144
|
-
relaton-itu (0.3.
|
146
|
+
relaton-itu (0.3.4)
|
145
147
|
relaton-iso-bib (~> 0.3.0)
|
146
|
-
relaton-nist (0.3.
|
148
|
+
relaton-nist (0.3.5)
|
147
149
|
relaton-bib (~> 0.3.0)
|
148
150
|
rubyzip
|
149
|
-
relaton-ogc (0.1.
|
151
|
+
relaton-ogc (0.1.1)
|
150
152
|
faraday
|
151
153
|
relaton-iso-bib (~> 0.3.0)
|
152
154
|
roman-numerals (0.3.0)
|
@@ -175,12 +177,12 @@ GEM
|
|
175
177
|
ruby-progressbar (1.10.1)
|
176
178
|
ruby_deep_clone (0.8.0)
|
177
179
|
ruby_dep (1.5.0)
|
178
|
-
rubyzip (
|
180
|
+
rubyzip (2.0.0)
|
179
181
|
safe_yaml (1.0.5)
|
180
|
-
sassc (2.2.
|
182
|
+
sassc (2.2.1)
|
181
183
|
ffi (~> 1.9)
|
182
184
|
shellany (0.0.1)
|
183
|
-
simplecov (0.17.
|
185
|
+
simplecov (0.17.1)
|
184
186
|
docile (~> 1.1)
|
185
187
|
json (>= 1.8, < 3)
|
186
188
|
simplecov-html (~> 0.10.0)
|
@@ -194,7 +196,7 @@ GEM
|
|
194
196
|
unicode2latex (0.0.2)
|
195
197
|
uuidtools (2.1.5)
|
196
198
|
vcr (5.0.0)
|
197
|
-
webmock (3.7.
|
199
|
+
webmock (3.7.5)
|
198
200
|
addressable (>= 2.3.6)
|
199
201
|
crack (>= 0.3.2)
|
200
202
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -16,6 +16,7 @@ module Asciidoctor
|
|
16
16
|
inline_macro Asciidoctor::Standoc::AltTermInlineMacro
|
17
17
|
inline_macro Asciidoctor::Standoc::DeprecatedTermInlineMacro
|
18
18
|
inline_macro Asciidoctor::Standoc::DomainTermInlineMacro
|
19
|
+
inline_macro Asciidoctor::Standoc::HTML5RubyMacro
|
19
20
|
block Asciidoctor::Standoc::ToDoAdmonitionBlock
|
20
21
|
treeprocessor Asciidoctor::Standoc::ToDoInlineAdmonitionBlock
|
21
22
|
block Asciidoctor::Standoc::PlantUMLBlockMacro
|
@@ -120,7 +121,7 @@ module Asciidoctor
|
|
120
121
|
def init_iev_caches(node)
|
121
122
|
unless (@no_isobib_cache || @no_isobib)
|
122
123
|
node.attr("local-cache-only") or
|
123
|
-
@iev_globalname = global_ievcache_name
|
124
|
+
@iev_globalname = global_ievcache_name
|
124
125
|
@iev_localname = local_ievcache_name(node.attr("local-cache") ||
|
125
126
|
node.attr("local-cache-only"))
|
126
127
|
if node.attr("flush-caches")
|
@@ -194,6 +194,14 @@
|
|
194
194
|
<data type="boolean"/>
|
195
195
|
</attribute>
|
196
196
|
</optional>
|
197
|
+
<optional>
|
198
|
+
<attribute name="subsequence"/>
|
199
|
+
</optional>
|
200
|
+
<optional>
|
201
|
+
<attribute name="inequality">
|
202
|
+
<data type="boolean"/>
|
203
|
+
</attribute>
|
204
|
+
</optional>
|
197
205
|
<ref name="stem"/>
|
198
206
|
<optional>
|
199
207
|
<ref name="dl"/>
|
@@ -247,6 +255,9 @@
|
|
247
255
|
<data type="boolean"/>
|
248
256
|
</attribute>
|
249
257
|
</optional>
|
258
|
+
<optional>
|
259
|
+
<attribute name="subsequence"/>
|
260
|
+
</optional>
|
250
261
|
<optional>
|
251
262
|
<attribute name="lang"/>
|
252
263
|
</optional>
|
@@ -291,9 +302,15 @@
|
|
291
302
|
<data type="boolean"/>
|
292
303
|
</attribute>
|
293
304
|
</optional>
|
305
|
+
<optional>
|
306
|
+
<attribute name="subsequence"/>
|
307
|
+
</optional>
|
294
308
|
<optional>
|
295
309
|
<attribute name="alt"/>
|
296
310
|
</optional>
|
311
|
+
<optional>
|
312
|
+
<attribute name="summary"/>
|
313
|
+
</optional>
|
297
314
|
<optional>
|
298
315
|
<attribute name="uri">
|
299
316
|
<data type="anyURI"/>
|
@@ -423,6 +440,9 @@
|
|
423
440
|
<data type="boolean"/>
|
424
441
|
</attribute>
|
425
442
|
</optional>
|
443
|
+
<optional>
|
444
|
+
<attribute name="subsequence"/>
|
445
|
+
</optional>
|
426
446
|
<oneOrMore>
|
427
447
|
<choice>
|
428
448
|
<ref name="formula"/>
|
@@ -486,6 +506,9 @@
|
|
486
506
|
<data type="boolean"/>
|
487
507
|
</attribute>
|
488
508
|
</optional>
|
509
|
+
<optional>
|
510
|
+
<attribute name="subsequence"/>
|
511
|
+
</optional>
|
489
512
|
<optional>
|
490
513
|
<ref name="source"/>
|
491
514
|
</optional>
|
@@ -497,6 +520,8 @@
|
|
497
520
|
</optional>
|
498
521
|
<choice>
|
499
522
|
<ref name="image"/>
|
523
|
+
<ref name="video"/>
|
524
|
+
<ref name="audio"/>
|
500
525
|
<ref name="pre"/>
|
501
526
|
<zeroOrMore>
|
502
527
|
<ref name="figure"/>
|
@@ -792,7 +817,7 @@
|
|
792
817
|
</element>
|
793
818
|
</define>
|
794
819
|
<define name="video">
|
795
|
-
<element name="
|
820
|
+
<element name="video">
|
796
821
|
<attribute name="id">
|
797
822
|
<data type="ID"/>
|
798
823
|
</attribute>
|
@@ -833,7 +858,7 @@
|
|
833
858
|
</element>
|
834
859
|
</define>
|
835
860
|
<define name="audio">
|
836
|
-
<element name="
|
861
|
+
<element name="audio">
|
837
862
|
<attribute name="id">
|
838
863
|
<data type="ID"/>
|
839
864
|
</attribute>
|
@@ -12,7 +12,15 @@ module Asciidoctor
|
|
12
12
|
|
13
13
|
def id_unnum_attr(node)
|
14
14
|
attr_code( id: Utils::anchor_or_uuid(node),
|
15
|
-
unnumbered: node.option?("unnumbered") ? "true" : nil
|
15
|
+
unnumbered: node.option?("unnumbered") ? "true" : nil,
|
16
|
+
subsequence: node.attr("subsequence") )
|
17
|
+
end
|
18
|
+
|
19
|
+
def formula_attr(node)
|
20
|
+
attr_code( id: Utils::anchor_or_uuid(node),
|
21
|
+
inequality: node.option?("inequality") ? "true" : nil,
|
22
|
+
unnumbered: node.option?("unnumbered") ? "true" : nil,
|
23
|
+
subsequence: node.attr("subsequence") )
|
16
24
|
end
|
17
25
|
|
18
26
|
# open block is a container of multiple blocks,
|
@@ -42,7 +50,7 @@ module Asciidoctor
|
|
42
50
|
def stem(node)
|
43
51
|
stem_content = node.lines.join("\n")
|
44
52
|
noko do |xml|
|
45
|
-
xml.formula **
|
53
|
+
xml.formula **formula_attr(node) do |s|
|
46
54
|
stem_parse(stem_content, s, node.style.to_sym)
|
47
55
|
end
|
48
56
|
end
|
@@ -51,13 +59,11 @@ module Asciidoctor
|
|
51
59
|
def sidebar_attrs(node)
|
52
60
|
date = node.attr("date") || Date.today.iso8601.gsub(/\+.*$/, "")
|
53
61
|
date += "T00:00:00Z" unless /T/.match date
|
54
|
-
{
|
55
|
-
reviewer: node.attr("reviewer") || node.attr("source") || "(Unknown)",
|
62
|
+
{ reviewer: node.attr("reviewer") || node.attr("source") || "(Unknown)",
|
56
63
|
id: Utils::anchor_or_uuid(node),
|
57
64
|
date: date,
|
58
65
|
from: node.attr("from"),
|
59
|
-
to: node.attr("to") || node.attr("from")
|
60
|
-
}
|
66
|
+
to: node.attr("to") || node.attr("from") }
|
61
67
|
end
|
62
68
|
|
63
69
|
def sidebar(node)
|
@@ -72,11 +78,9 @@ module Asciidoctor
|
|
72
78
|
def todo_attrs(node)
|
73
79
|
date = node.attr("date") || Date.today.iso8601.gsub(/\+.*$/, "")
|
74
80
|
date += "T00:00:00Z" unless /T/.match date
|
75
|
-
{
|
76
|
-
reviewer: node.attr("reviewer") || node.attr("source") || "(Unknown)",
|
81
|
+
{ reviewer: node.attr("reviewer") || node.attr("source") || "(Unknown)",
|
77
82
|
id: Utils::anchor_or_uuid(node),
|
78
|
-
date: date
|
79
|
-
}
|
83
|
+
date: date }
|
80
84
|
end
|
81
85
|
|
82
86
|
def todo(node)
|
@@ -141,9 +145,8 @@ module Asciidoctor
|
|
141
145
|
def example(node)
|
142
146
|
return term_example(node) if in_terms?
|
143
147
|
role = node.role || node.attr("style")
|
144
|
-
|
145
|
-
|
146
|
-
return requirement(node, "permission") if role == "permission"
|
148
|
+
%w(recommendation requirement permission).include?(role) and
|
149
|
+
return requirement(node, role)
|
147
150
|
noko do |xml|
|
148
151
|
xml.example **id_unnum_attr(node) do |ex|
|
149
152
|
wrap_in_para(node, ex)
|
@@ -162,6 +165,7 @@ module Asciidoctor
|
|
162
165
|
end
|
163
166
|
|
164
167
|
def datauri(uri)
|
168
|
+
return uri if /^data:/.match(uri)
|
165
169
|
types = MIME::Types.type_for(@localdir + uri)
|
166
170
|
type = types ? types.first.to_s : 'text/plain; charset="utf-8"'
|
167
171
|
bin = File.open(@localdir + uri, 'rb') {|io| io.read}
|
@@ -171,10 +175,12 @@ module Asciidoctor
|
|
171
175
|
|
172
176
|
def image_attributes(node)
|
173
177
|
uri = node.image_uri (node.attr("target") || node.target)
|
174
|
-
types = MIME::Types.type_for(uri)
|
178
|
+
types = /^data:/.match(uri) ? datauri2mime(uri) : MIME::Types.type_for(uri)
|
179
|
+
type = types.first.to_s
|
180
|
+
uri = uri.sub(%r{^data:image/\*;}, "data:#{type};")
|
175
181
|
{ src: @datauriimage ? datauri(uri) : uri,
|
176
182
|
id: Utils::anchor_or_uuid,
|
177
|
-
mimetype:
|
183
|
+
mimetype: type,
|
178
184
|
height: node.attr("height") || "auto",
|
179
185
|
width: node.attr("width") || "auto" ,
|
180
186
|
filename: node.attr("filename"),
|
@@ -182,9 +188,8 @@ module Asciidoctor
|
|
182
188
|
end
|
183
189
|
|
184
190
|
def figure_title(node, f)
|
185
|
-
|
186
|
-
|
187
|
-
end
|
191
|
+
return if node.title.nil?
|
192
|
+
f.name { |name| name << node.title }
|
188
193
|
end
|
189
194
|
|
190
195
|
def image(node)
|
@@ -238,11 +243,9 @@ module Asciidoctor
|
|
238
243
|
end
|
239
244
|
|
240
245
|
def listing_attrs(node)
|
241
|
-
{
|
242
|
-
lang: node.attr("language"),
|
246
|
+
{ lang: node.attr("language"),
|
243
247
|
id: Utils::anchor_or_uuid(node),
|
244
|
-
filename: node.attr("filename")
|
245
|
-
}
|
248
|
+
filename: node.attr("filename") }
|
246
249
|
end
|
247
250
|
|
248
251
|
# NOTE: html escaping is performed by Nokogiri
|
@@ -16,7 +16,7 @@ module Asciidoctor
|
|
16
16
|
def textcleanup(result)
|
17
17
|
text = result.flatten.map { |l| l.sub(/\s*$/, "") } * "\n"
|
18
18
|
if !@keepasciimath
|
19
|
-
text = text.gsub(%r{<stem type="AsciiMath">(.+?)</stem>},
|
19
|
+
text = text.gsub(%r{<stem type="AsciiMath">(.+?)</stem>}m,
|
20
20
|
'<amathstem>\1</amathstem>')
|
21
21
|
text = Html2Doc.
|
22
22
|
asciimath_to_mathml(text, ['<amathstem>', "</amathstem>"]).
|
@@ -243,8 +243,11 @@ module Asciidoctor
|
|
243
243
|
xmldoc.xpath("//stem[@type = 'MathML']").each do |x|
|
244
244
|
next if x.children.any? { |y| y.element? }
|
245
245
|
math = x.text.gsub(/</, "<").gsub(/>/, ">").gsub(/"/, '"').
|
246
|
-
gsub(/&
|
247
|
-
gsub(
|
246
|
+
gsub(/'/, "'").gsub(/&/, "&").
|
247
|
+
gsub(/<[^: \r\n\t\/]+:/, "<").
|
248
|
+
gsub(/<\/[^ \r\n\t:]+:/, "</").
|
249
|
+
gsub(/ xmlns[^>"']+/, "").
|
250
|
+
gsub(/<math /, '<math xmlns="http://www.w3.org/1998/Math/MathML" ').
|
248
251
|
gsub(/<math>/, '<math xmlns="http://www.w3.org/1998/Math/MathML">')
|
249
252
|
x.children = math
|
250
253
|
end
|
@@ -195,11 +195,12 @@ module Asciidoctor
|
|
195
195
|
|
196
196
|
def metadata_getrelation(node, xml, type)
|
197
197
|
docs = node.attr(type) || return
|
198
|
-
docs.split(
|
198
|
+
docs.split(/;\s*/).each do |d|
|
199
|
+
id = d.split(/,\s*/)
|
199
200
|
xml.relation **{ type: relation_normalise(type) } do |r|
|
200
201
|
fetch_ref(r, d, nil, {}) or r.bibitem do |b|
|
201
|
-
b.title "--"
|
202
|
-
b.docidentifier
|
202
|
+
b.title id[1] ? id[1] : "--"
|
203
|
+
b.docidentifier id[0]
|
203
204
|
end
|
204
205
|
end
|
205
206
|
end
|
@@ -16,8 +16,7 @@ module Asciidoctor
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
class DeprecatedTermInlineMacro <
|
20
|
-
Asciidoctor::Extensions::InlineMacroProcessor
|
19
|
+
class DeprecatedTermInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
21
20
|
use_dsl
|
22
21
|
named :deprecated
|
23
22
|
parse_content_as :text
|
@@ -41,6 +40,32 @@ module Asciidoctor
|
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
43
|
+
class HTML5RubyMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
44
|
+
use_dsl
|
45
|
+
named :ruby
|
46
|
+
parse_content_as :text
|
47
|
+
|
48
|
+
option :pos_attrs, %w(rpbegin rt rpend)
|
49
|
+
|
50
|
+
def process(parent, target, attributes)
|
51
|
+
rpbegin = '('
|
52
|
+
rpend = ')'
|
53
|
+
if attributes.size == 1 and attributes.key?("text")
|
54
|
+
rt = attributes["text"]
|
55
|
+
elsif attributes.size == 2 and attributes.key?(1) and attributes.key?("rpbegin")
|
56
|
+
# for example, html5ruby:楽聖少女[がくせいしょうじょ]
|
57
|
+
rt = attributes[1]
|
58
|
+
rt ||= ""
|
59
|
+
else
|
60
|
+
rpbegin = attributes['rpbegin']
|
61
|
+
rt = attributes['rt']
|
62
|
+
rpend = attributes['rpend']
|
63
|
+
end
|
64
|
+
|
65
|
+
%(<ruby>#{target}<rp>#{rpbegin}</rp><rt>#{rt}</rt><rp>#{rpend}</rp></ruby>)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
44
69
|
class ToDoAdmonitionBlock < Extensions::BlockProcessor
|
45
70
|
use_dsl
|
46
71
|
named :TODO
|
@@ -93,7 +118,7 @@ module Asciidoctor
|
|
93
118
|
# finish erlier then dot, as result png file maybe not created yet after plantuml finish
|
94
119
|
sleep(2) if Gem.win_platform?
|
95
120
|
outfile = parent.image_uri("#{fn}.png")
|
96
|
-
if outfile == "#{fn}.png"
|
121
|
+
if outfile == "#{fn}.png"
|
97
122
|
(Pathname.new("plantuml") + "#{fn}.png").to_s
|
98
123
|
else
|
99
124
|
FileUtils.mv (Pathname.new(localdir) + "plantuml" + "#{fn}.png").to_s,
|