metanorma-standoc 1.3.10 → 1.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +35 -35
- data/lib/asciidoctor/standoc/basicdoc.rng +14 -2
- data/lib/asciidoctor/standoc/blocks.rb +9 -8
- data/lib/asciidoctor/standoc/cleanup.rb +9 -13
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +6 -0
- data/lib/asciidoctor/standoc/isodoc.rng +6 -6
- data/lib/asciidoctor/standoc/macros.rb +8 -2
- data/lib/asciidoctor/standoc/section.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor-standoc/blocks_spec.rb +2 -2
- data/spec/asciidoctor-standoc/cleanup_spec.rb +58 -2
- data/spec/asciidoctor-standoc/inline_spec.rb +34 -0
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +4 -4
- data/spec/asciidoctor-standoc/refs_spec.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 849cbd5381b880bcb3e5cbd9b6f93a6ec09ca0e45fefbe2ccb5f1bdbce81387c
|
4
|
+
data.tar.gz: 6719ec18705bf478ec7c585ac170a534979ad8eb02f9c1c8db08e88c99f6bc79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4918be4b5e96a0b307f5dc937a48e1e50dbe16dae17f91648913d5ae3ed95c64b6a2ae8473c260c8e4aa95fd7c28d6b6ec38d022ff06617417041b3a7eb4c433
|
7
|
+
data.tar.gz: f4961df85d85193abf1d092fcdb0adbd1178543ddae1c02a462bdbc7038b61747ff914c95e30ccc9e1328311ccf141aaf079bb401b06eb0369b84a93912ad2f4
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
metanorma-standoc (1.3.
|
4
|
+
metanorma-standoc (1.3.11)
|
5
5
|
asciidoctor (~> 2.0.0)
|
6
6
|
concurrent-ruby
|
7
7
|
html2doc (~> 0.9.0)
|
8
8
|
iev (~> 0.2.1)
|
9
9
|
isodoc (~> 1.0.0)
|
10
10
|
mimemagic
|
11
|
-
relaton (~> 0.
|
11
|
+
relaton (~> 0.6.0)
|
12
12
|
relaton-iev (~> 0.1.0)
|
13
13
|
ruby-jing
|
14
14
|
sterile (~> 1.0.14)
|
@@ -64,7 +64,7 @@ GEM
|
|
64
64
|
iev (0.2.3)
|
65
65
|
nokogiri (>= 1.10.4)
|
66
66
|
image_size (2.0.2)
|
67
|
-
isodoc (1.0.
|
67
|
+
isodoc (1.0.11)
|
68
68
|
asciimath
|
69
69
|
html2doc (~> 0.9.0)
|
70
70
|
htmlentities (~> 4.3.4)
|
@@ -113,47 +113,47 @@ GEM
|
|
113
113
|
rb-fsevent (0.10.3)
|
114
114
|
rb-inotify (0.10.0)
|
115
115
|
ffi (~> 1.0)
|
116
|
-
relaton (0.
|
117
|
-
relaton-calconnect (~> 0.
|
118
|
-
relaton-gb (~> 0.
|
119
|
-
relaton-iec (~> 0.
|
120
|
-
relaton-ietf (~> 0.
|
121
|
-
relaton-iso (~> 0.
|
122
|
-
relaton-itu (~> 0.
|
123
|
-
relaton-nist (~> 0.
|
124
|
-
relaton-ogc (~> 0.
|
125
|
-
relaton-bib (0.
|
116
|
+
relaton (0.6.3)
|
117
|
+
relaton-calconnect (~> 0.2.0)
|
118
|
+
relaton-gb (~> 0.7.0)
|
119
|
+
relaton-iec (~> 0.5.0)
|
120
|
+
relaton-ietf (~> 0.7.0)
|
121
|
+
relaton-iso (~> 0.7.0)
|
122
|
+
relaton-itu (~> 0.4.0)
|
123
|
+
relaton-nist (~> 0.4.0)
|
124
|
+
relaton-ogc (~> 0.2.0)
|
125
|
+
relaton-bib (0.4.1)
|
126
126
|
addressable
|
127
127
|
nokogiri
|
128
|
-
relaton-calconnect (0.1
|
128
|
+
relaton-calconnect (0.2.1)
|
129
129
|
faraday
|
130
|
-
relaton-iso-bib (~> 0.
|
131
|
-
relaton-gb (0.
|
130
|
+
relaton-iso-bib (~> 0.4.0)
|
131
|
+
relaton-gb (0.7.1)
|
132
132
|
cnccs (~> 0.1.1)
|
133
133
|
gb-agencies (~> 0.0.1)
|
134
|
-
relaton-iso-bib (~> 0.
|
135
|
-
relaton-iec (0.
|
134
|
+
relaton-iso-bib (~> 0.4.0)
|
135
|
+
relaton-iec (0.5.1)
|
136
136
|
addressable
|
137
|
-
relaton-iso-bib (~> 0.
|
138
|
-
relaton-ietf (0.
|
139
|
-
relaton-bib (~> 0.
|
140
|
-
relaton-iev (0.1.
|
141
|
-
relaton (~> 0.
|
142
|
-
relaton-iso (0.
|
143
|
-
relaton-iec (~> 0.
|
144
|
-
relaton-iso-bib (~> 0.
|
145
|
-
relaton-iso-bib (0.
|
137
|
+
relaton-iso-bib (~> 0.4.0)
|
138
|
+
relaton-ietf (0.7.2)
|
139
|
+
relaton-bib (~> 0.4.0)
|
140
|
+
relaton-iev (0.1.2)
|
141
|
+
relaton (~> 0.6.0)
|
142
|
+
relaton-iso (0.7.1)
|
143
|
+
relaton-iec (~> 0.5.0)
|
144
|
+
relaton-iso-bib (~> 0.4.0)
|
145
|
+
relaton-iso-bib (0.4.1)
|
146
146
|
isoics (~> 0.1.6)
|
147
|
-
relaton-bib (~> 0.
|
147
|
+
relaton-bib (~> 0.4.0)
|
148
148
|
ruby_deep_clone (~> 0.8.0)
|
149
|
-
relaton-itu (0.
|
150
|
-
relaton-iso-bib (~> 0.
|
151
|
-
relaton-nist (0.
|
152
|
-
relaton-bib (~> 0.
|
149
|
+
relaton-itu (0.4.1)
|
150
|
+
relaton-iso-bib (~> 0.4.0)
|
151
|
+
relaton-nist (0.4.1)
|
152
|
+
relaton-bib (~> 0.4.0)
|
153
153
|
rubyzip
|
154
|
-
relaton-ogc (0.1
|
154
|
+
relaton-ogc (0.2.1)
|
155
155
|
faraday
|
156
|
-
relaton-iso-bib (~> 0.
|
156
|
+
relaton-iso-bib (~> 0.4.0)
|
157
157
|
roman-numerals (0.3.0)
|
158
158
|
rspec (3.9.0)
|
159
159
|
rspec-core (~> 3.9.0)
|
@@ -191,7 +191,7 @@ GEM
|
|
191
191
|
simplecov-html (0.10.2)
|
192
192
|
sterile (1.0.14)
|
193
193
|
nokogiri
|
194
|
-
thor (0.
|
194
|
+
thor (1.0.1)
|
195
195
|
thread_safe (0.3.6)
|
196
196
|
timecop (0.9.1)
|
197
197
|
unicode-display_width (1.6.0)
|
@@ -52,9 +52,9 @@
|
|
52
52
|
<optional>
|
53
53
|
<ref name="section-title"/>
|
54
54
|
</optional>
|
55
|
-
<
|
55
|
+
<zeroOrMore>
|
56
56
|
<ref name="BasicBlock"/>
|
57
|
-
</
|
57
|
+
</zeroOrMore>
|
58
58
|
<zeroOrMore>
|
59
59
|
<ref name="note"/>
|
60
60
|
</zeroOrMore>
|
@@ -567,6 +567,7 @@
|
|
567
567
|
<ref name="pagebreak"/>
|
568
568
|
<ref name="bookmark"/>
|
569
569
|
<ref name="image"/>
|
570
|
+
<ref name="index"/>
|
570
571
|
</choice>
|
571
572
|
</define>
|
572
573
|
<define name="PureTextElement">
|
@@ -691,6 +692,17 @@
|
|
691
692
|
<empty/>
|
692
693
|
</element>
|
693
694
|
</define>
|
695
|
+
<define name="index">
|
696
|
+
<element name="index">
|
697
|
+
<attribute name="primary"/>
|
698
|
+
<optional>
|
699
|
+
<attribute name="secondary"/>
|
700
|
+
</optional>
|
701
|
+
<optional>
|
702
|
+
<attribute name="tertiary"/>
|
703
|
+
</optional>
|
704
|
+
</element>
|
705
|
+
</define>
|
694
706
|
<!-- bare ID element, used for referencing arbitrary spans of text -->
|
695
707
|
<define name="bookmark">
|
696
708
|
<element name="bookmark">
|
@@ -94,7 +94,7 @@ module Asciidoctor
|
|
94
94
|
xml.termnote **id_attr(n) do |ex|
|
95
95
|
wrap_in_para(n, ex)
|
96
96
|
end
|
97
|
-
end.join
|
97
|
+
end.join("\n")
|
98
98
|
end
|
99
99
|
|
100
100
|
def note(n)
|
@@ -102,7 +102,7 @@ module Asciidoctor
|
|
102
102
|
xml.note **id_attr(n) do |c|
|
103
103
|
wrap_in_para(n, c)
|
104
104
|
end
|
105
|
-
end.join
|
105
|
+
end.join("\n")
|
106
106
|
end
|
107
107
|
|
108
108
|
def admonition_attrs(node)
|
@@ -124,7 +124,7 @@ module Asciidoctor
|
|
124
124
|
node.title.nil? or a.name { |name| name << node.title }
|
125
125
|
wrap_in_para(node, a)
|
126
126
|
end
|
127
|
-
end.join
|
127
|
+
end.join("\n")
|
128
128
|
end
|
129
129
|
|
130
130
|
def term_example(node)
|
@@ -132,7 +132,7 @@ module Asciidoctor
|
|
132
132
|
xml.termexample **id_attr(node) do |ex|
|
133
133
|
wrap_in_para(node, ex)
|
134
134
|
end
|
135
|
-
end.join
|
135
|
+
end.join("\n")
|
136
136
|
end
|
137
137
|
|
138
138
|
def example(node)
|
@@ -151,7 +151,7 @@ module Asciidoctor
|
|
151
151
|
figure_title(node, ex)
|
152
152
|
wrap_in_para(node, ex)
|
153
153
|
end
|
154
|
-
end.join
|
154
|
+
end.join("\n")
|
155
155
|
end
|
156
156
|
|
157
157
|
def example_attrs(node)
|
@@ -164,7 +164,7 @@ module Asciidoctor
|
|
164
164
|
node.title.nil? or ex.name { |name| name << node.title }
|
165
165
|
wrap_in_para(node, ex)
|
166
166
|
end
|
167
|
-
end.join
|
167
|
+
end.join("\n")
|
168
168
|
end
|
169
169
|
|
170
170
|
def figure_title(node, f)
|
@@ -196,7 +196,7 @@ module Asciidoctor
|
|
196
196
|
xml.p **para_attrs(node) do |xml_t|
|
197
197
|
xml_t << node.content
|
198
198
|
end
|
199
|
-
end.join
|
199
|
+
end.join("\n")
|
200
200
|
end
|
201
201
|
|
202
202
|
def quote_attrs(node)
|
@@ -220,12 +220,13 @@ module Asciidoctor
|
|
220
220
|
quote_attribution(node, q)
|
221
221
|
wrap_in_para(node, q)
|
222
222
|
end
|
223
|
-
end.join
|
223
|
+
end.join("\n")
|
224
224
|
end
|
225
225
|
|
226
226
|
def listing_attrs(node)
|
227
227
|
attr_code(lang: node.attr("language"),
|
228
228
|
id: Utils::anchor_or_uuid(node),
|
229
|
+
unnumbered: node.option?("unnumbered") ? "true" : nil,
|
229
230
|
filename: node.attr("filename"))
|
230
231
|
end
|
231
232
|
|
@@ -57,6 +57,7 @@ module Asciidoctor
|
|
57
57
|
bookmark_cleanup(xmldoc)
|
58
58
|
smartquotes_cleanup(xmldoc)
|
59
59
|
requirement_cleanup(xmldoc)
|
60
|
+
bibdata_cleanup(xmldoc)
|
60
61
|
boilerplate_cleanup(xmldoc)
|
61
62
|
xmldoc
|
62
63
|
end
|
@@ -65,7 +66,8 @@ module Asciidoctor
|
|
65
66
|
xmldoc.traverse do |n|
|
66
67
|
next unless n.text?
|
67
68
|
if @smartquotes
|
68
|
-
next unless n.ancestors("pre, tt, sourcecode, bibdata, on"
|
69
|
+
next unless n.ancestors("pre, tt, sourcecode, bibdata, on, "\
|
70
|
+
"figure[@class = 'pseudocode']").empty?
|
69
71
|
n.replace(Utils::smartformat(n.text))
|
70
72
|
else
|
71
73
|
n.replace(n.text.gsub(/(?<=\p{Alnum})\u2019(?=\p{Alpha})/, "'"))
|
@@ -79,9 +81,8 @@ module Asciidoctor
|
|
79
81
|
|
80
82
|
TEXT_ELEMS =
|
81
83
|
%w{status language script version author name callout phone email
|
82
|
-
street city state country postcode identifier referenceFrom
|
83
|
-
referenceTo docidentifier docnumber prefix initial addition
|
84
|
-
forename
|
84
|
+
street city state country postcode identifier referenceFrom surname
|
85
|
+
referenceTo docidentifier docnumber prefix initial addition forename
|
85
86
|
title draft secretariat title-main title-intro title-part}.freeze
|
86
87
|
|
87
88
|
# it seems Nokogiri::XML is treating the content of <script> as cdata,
|
@@ -112,9 +113,8 @@ module Asciidoctor
|
|
112
113
|
xmldoc.xpath("//sourcecode").each do |x|
|
113
114
|
callouts = x.elements.select { |e| e.name == "callout" }
|
114
115
|
annotations = x.elements.select { |e| e.name == "annotation" }
|
115
|
-
|
116
|
+
callouts.size == annotations.size and
|
116
117
|
link_callouts_to_annotations(callouts, annotations)
|
117
|
-
end
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
@@ -133,8 +133,7 @@ module Asciidoctor
|
|
133
133
|
|
134
134
|
def termdef_stem_cleanup(xmldoc)
|
135
135
|
xmldoc.xpath("//term/p/stem").each do |a|
|
136
|
-
if a.parent.elements.size == 1
|
137
|
-
# para containing just a stem expression
|
136
|
+
if a.parent.elements.size == 1 # para contains just a stem expression
|
138
137
|
t = Nokogiri::XML::Element.new("admitted", xmldoc)
|
139
138
|
parent = a.parent
|
140
139
|
t.children = a.remove
|
@@ -179,15 +178,13 @@ module Asciidoctor
|
|
179
178
|
|
180
179
|
def termdocsource_cleanup(xmldoc)
|
181
180
|
f = xmldoc.at("//preface | //sections")
|
182
|
-
xmldoc.xpath("//
|
183
|
-
"//clause/termdocsource").each do |s|
|
181
|
+
xmldoc.xpath("//termdocsource").each do |s|
|
184
182
|
f.previous = s.remove
|
185
183
|
end
|
186
184
|
end
|
187
185
|
|
188
186
|
def term_children_cleanup(xmldoc)
|
189
187
|
xmldoc.xpath("//term").each do |t|
|
190
|
-
ex = t.xpath("./termexample")
|
191
188
|
t.xpath("./termnote").each { |n| t << n.remove }
|
192
189
|
t.xpath("./termexample").each { |n| t << n.remove }
|
193
190
|
t.xpath("./termsource").each { |n| t << n.remove }
|
@@ -240,8 +237,7 @@ module Asciidoctor
|
|
240
237
|
next if x.children.any? { |y| y.element? }
|
241
238
|
math = x.text.gsub(/</, "<").gsub(/>/, ">").gsub(/"/, '"').
|
242
239
|
gsub(/'/, "'").gsub(/&/, "&").
|
243
|
-
gsub(/<[^: \r\n\t\/]+:/, "<").
|
244
|
-
gsub(/<\/[^ \r\n\t:]+:/, "</").
|
240
|
+
gsub(/<[^: \r\n\t\/]+:/, "<").gsub(/<\/[^ \r\n\t:]+:/, "</").
|
245
241
|
gsub(/ xmlns[^>"']+/, "").
|
246
242
|
gsub(/<math /, '<math xmlns="http://www.w3.org/1998/Math/MathML" ').
|
247
243
|
gsub(/<math>/, '<math xmlns="http://www.w3.org/1998/Math/MathML">')
|
@@ -207,9 +207,9 @@
|
|
207
207
|
</optional>
|
208
208
|
<choice>
|
209
209
|
<group>
|
210
|
-
<
|
210
|
+
<zeroOrMore>
|
211
211
|
<ref name="BasicBlock"/>
|
212
|
-
</
|
212
|
+
</zeroOrMore>
|
213
213
|
<zeroOrMore>
|
214
214
|
<ref name="note"/>
|
215
215
|
</zeroOrMore>
|
@@ -244,9 +244,9 @@
|
|
244
244
|
</optional>
|
245
245
|
<choice>
|
246
246
|
<group>
|
247
|
-
<
|
247
|
+
<zeroOrMore>
|
248
248
|
<ref name="BasicBlock"/>
|
249
|
-
</
|
249
|
+
</zeroOrMore>
|
250
250
|
<zeroOrMore>
|
251
251
|
<ref name="note"/>
|
252
252
|
</zeroOrMore>
|
@@ -289,9 +289,9 @@
|
|
289
289
|
</optional>
|
290
290
|
<choice>
|
291
291
|
<group>
|
292
|
-
<
|
292
|
+
<zeroOrMore>
|
293
293
|
<ref name="BasicBlock"/>
|
294
|
-
</
|
294
|
+
</zeroOrMore>
|
295
295
|
<zeroOrMore>
|
296
296
|
<ref name="note"/>
|
297
297
|
</zeroOrMore>
|
@@ -62,9 +62,13 @@ module Asciidoctor
|
|
62
62
|
lines
|
63
63
|
end
|
64
64
|
|
65
|
+
def prevent_smart_quotes(m)
|
66
|
+
m.gsub(/'/, "'").gsub(/"/, """)
|
67
|
+
end
|
68
|
+
|
65
69
|
def process parent, reader, attrs
|
66
70
|
attrs['role'] = 'pseudocode'
|
67
|
-
lines = reader.lines.map { |m| init_indent(m) }
|
71
|
+
lines = reader.lines.map { |m| prevent_smart_quotes(init_indent(m)) }
|
68
72
|
create_block(parent, :example,
|
69
73
|
supply_br(lines),
|
70
74
|
attrs, content_model: :compound)
|
@@ -147,7 +151,9 @@ module Asciidoctor
|
|
147
151
|
system "plantuml #{umlfile}"
|
148
152
|
# sleep need for windows because dot works in separate process and plantuml process may
|
149
153
|
# finish erlier then dot, as result png file maybe not created yet after plantuml finish
|
150
|
-
|
154
|
+
until !Gem.win_platform? || File.exist?(Pathname.new(localdir) + "plantuml" + "#{fn}.png")
|
155
|
+
sleep(1)
|
156
|
+
end
|
151
157
|
outfile = parent.image_uri("#{fn}.png")
|
152
158
|
if outfile == "#{fn}.png"
|
153
159
|
(Pathname.new("plantuml") + "#{fn}.png").to_s
|
data/metanorma-standoc.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
31
|
spec.add_dependency "isodoc", "~> 1.0.0"
|
32
32
|
spec.add_dependency "iev", "~> 0.2.1"
|
33
|
-
spec.add_dependency "relaton", "~> 0.
|
33
|
+
spec.add_dependency "relaton", "~> 0.6.0"
|
34
34
|
spec.add_dependency "relaton-iev", "~> 0.1.0"
|
35
35
|
spec.add_dependency "sterile", "~> 1.0.14"
|
36
36
|
spec.add_dependency "concurrent-ruby"
|
@@ -851,7 +851,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
851
851
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
852
852
|
#{ASCIIDOC_BLANK_HDR}
|
853
853
|
.Caption
|
854
|
-
[source,ruby,filename=sourcecode1.rb]
|
854
|
+
[source%unnumbered,ruby,filename=sourcecode1.rb]
|
855
855
|
--
|
856
856
|
puts "Hello, world."
|
857
857
|
%w{a b c}.each do |x|
|
@@ -861,7 +861,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
861
861
|
INPUT
|
862
862
|
#{BLANK_HDR}
|
863
863
|
<sections>
|
864
|
-
<sourcecode id="_" lang="ruby" filename="sourcecode1.rb"><name>Caption</name>puts "Hello, world."
|
864
|
+
<sourcecode id="_" lang="ruby" filename="sourcecode1.rb" unnumbered="true"><name>Caption</name>puts "Hello, world."
|
865
865
|
%w{a b c}.each do |x|
|
866
866
|
puts x
|
867
867
|
end</sourcecode>
|
@@ -67,7 +67,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
67
67
|
OUTPUT
|
68
68
|
end
|
69
69
|
|
70
|
-
it "does not apply smartquotes to sourcecode, tt, pre" do
|
70
|
+
it "does not apply smartquotes to sourcecode, tt, pre, pseudocode" do
|
71
71
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
72
72
|
= Document title
|
73
73
|
Author
|
@@ -88,6 +88,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
88
88
|
"quote" A's
|
89
89
|
----
|
90
90
|
|
91
|
+
[pseudocode]
|
92
|
+
====
|
93
|
+
"quote" A's
|
94
|
+
====
|
95
|
+
|
91
96
|
INPUT
|
92
97
|
#{BLANK_HDR}
|
93
98
|
<sections>
|
@@ -95,7 +100,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
95
100
|
<p id="_">
|
96
101
|
<tt>"quote" A’s</tt>
|
97
102
|
</p>
|
98
|
-
<sourcecode id="_">"quote" A's</sourcecode
|
103
|
+
<sourcecode id="_">"quote" A's</sourcecode>
|
104
|
+
<figure id='_' class='pseudocode'>
|
105
|
+
<p id='_'>"quote" A's</p>
|
106
|
+
</figure>
|
107
|
+
</clause>
|
99
108
|
</sections>
|
100
109
|
</standard-document>
|
101
110
|
OUTPUT
|
@@ -1362,6 +1371,53 @@ it "inserts boilerplate before empty Normative References in French" do
|
|
1362
1371
|
OUTPUT
|
1363
1372
|
end
|
1364
1373
|
|
1374
|
+
it "removes bibdata bibitem IDs" do
|
1375
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1376
|
+
= Document title
|
1377
|
+
Author
|
1378
|
+
:docfile: test.adoc
|
1379
|
+
:nodoc:
|
1380
|
+
:novalid:
|
1381
|
+
:no-isobib:
|
1382
|
+
:translated-from: IEC 60050-102
|
1383
|
+
|
1384
|
+
[bibliography]
|
1385
|
+
== Normative References
|
1386
|
+
|
1387
|
+
INPUT
|
1388
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
1389
|
+
<standard-document xmlns='http://riboseinc.com/isoxml'>
|
1390
|
+
<bibdata type='standard'>
|
1391
|
+
<title language='en' format='text/plain'>Document title</title>
|
1392
|
+
<language>en</language>
|
1393
|
+
<script>Latn</script>
|
1394
|
+
<status>
|
1395
|
+
<stage>published</stage>
|
1396
|
+
</status>
|
1397
|
+
<copyright>
|
1398
|
+
<from>2019</from>
|
1399
|
+
</copyright>
|
1400
|
+
<relation type='translatedFrom'>
|
1401
|
+
<bibitem>
|
1402
|
+
<title>--</title>
|
1403
|
+
<docidentifier>IEC 60050-102</docidentifier>
|
1404
|
+
</bibitem>
|
1405
|
+
</relation>
|
1406
|
+
<ext>
|
1407
|
+
<doctype>article</doctype>
|
1408
|
+
</ext>
|
1409
|
+
</bibdata>
|
1410
|
+
<sections> </sections>
|
1411
|
+
<bibliography>
|
1412
|
+
<references id='_' obligation='informative'>
|
1413
|
+
<title>Normative References</title>
|
1414
|
+
<p>There are no normative references in this document.</p>
|
1415
|
+
</references>
|
1416
|
+
</bibliography>
|
1417
|
+
</standard-document>
|
1418
|
+
OUTPUT
|
1419
|
+
end
|
1420
|
+
|
1365
1421
|
|
1366
1422
|
private
|
1367
1423
|
|
@@ -1,6 +1,40 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
|
+
it "handles spacing around markup" do
|
5
|
+
expect((strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to (<<~"OUTPUT")
|
6
|
+
#{ASCIIDOC_BLANK_HDR}
|
7
|
+
This is
|
8
|
+
a paragraph with <<x>>
|
9
|
+
markup _for_
|
10
|
+
text, including **__nest__**ed markup.
|
11
|
+
INPUT
|
12
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
13
|
+
<standard-document xmlns="http://riboseinc.com/isoxml">
|
14
|
+
<bibdata type="standard">
|
15
|
+
<title language="en" format="text/plain">Document title</title>
|
16
|
+
<language>en</language>
|
17
|
+
<script>Latn</script>
|
18
|
+
<status>
|
19
|
+
<stage>published</stage>
|
20
|
+
</status>
|
21
|
+
<copyright>
|
22
|
+
<from>2019</from>
|
23
|
+
</copyright>
|
24
|
+
<ext>
|
25
|
+
<doctype>article</doctype>
|
26
|
+
</ext>
|
27
|
+
</bibdata>
|
28
|
+
<sections>
|
29
|
+
<p id="_">This is
|
30
|
+
a paragraph with <xref target="x"/>
|
31
|
+
markup <em>for</em>
|
32
|
+
text, including <strong><em>nest</em></strong>ed markup.</p>
|
33
|
+
</sections>
|
34
|
+
</standard-document>
|
35
|
+
OUTPUT
|
36
|
+
end
|
37
|
+
|
4
38
|
it "processes inline_quoted formatting" do
|
5
39
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
40
|
#{DUMBQUOTE_BLANK_HDR}
|
@@ -424,9 +424,9 @@ home run record in 1998.</note>
|
|
424
424
|
<scale>medium scale</scale>
|
425
425
|
</medium>
|
426
426
|
<place>bib place</place>
|
427
|
-
<
|
427
|
+
<extent type="section">
|
428
428
|
<referenceFrom>7</referenceFrom>
|
429
|
-
</
|
429
|
+
</extent>
|
430
430
|
<accesslocation>accesslocation1</accesslocation>
|
431
431
|
<accesslocation>accesslocation2</accesslocation>
|
432
432
|
<classification type="type">value</classification>
|
@@ -742,9 +742,9 @@ home run record in 1998.</note>
|
|
742
742
|
<scale>medium scale</scale>
|
743
743
|
</medium>
|
744
744
|
<place>bib place</place>
|
745
|
-
<
|
745
|
+
<extent type="section">
|
746
746
|
<referenceFrom>7</referenceFrom>
|
747
|
-
</
|
747
|
+
</extent>
|
748
748
|
<accesslocation>accesslocation1</accesslocation>
|
749
749
|
<accesslocation>accesslocation2</accesslocation>
|
750
750
|
<classification type="type">value</classification>
|
@@ -596,7 +596,7 @@ OUTPUT
|
|
596
596
|
</sections><bibliography><references id="_" obligation="informative">
|
597
597
|
<title>Normative References</title>
|
598
598
|
#{NORM_REF_BOILERPLATE}
|
599
|
-
<bibitem id="iso123">
|
599
|
+
<bibitem id="iso123" type="standard">
|
600
600
|
<fetched>#{Date.today}</fetched>
|
601
601
|
<title format="text/plain" language="en" script="Latn">Network Configuration Access Control Model</title>
|
602
602
|
<uri type='xml'>https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml</uri>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-standoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.6.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.6.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: relaton-iev
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|