isodoc 1.6.4 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/.rubocop.yml +1 -1
- data/isodoc.gemspec +2 -1
- data/lib/isodoc-yaml/i18n-ar.yaml +19 -25
- data/lib/isodoc-yaml/i18n-de.yaml +1 -0
- data/lib/isodoc-yaml/i18n-en.yaml +2 -0
- data/lib/isodoc-yaml/i18n-es.yaml +1 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +2 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +1 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +2 -0
- data/lib/isodoc/convert.rb +4 -2
- data/lib/isodoc/function/blocks.rb +6 -5
- data/lib/isodoc/function/references.rb +33 -52
- data/lib/isodoc/function/section.rb +0 -1
- data/lib/isodoc/function/table.rb +21 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/gem_tasks.rb +8 -9
- data/lib/isodoc/html_convert.rb +5 -1
- data/lib/isodoc/html_function/comments.rb +12 -12
- data/lib/isodoc/html_function/html.rb +2 -2
- data/lib/isodoc/html_function/postprocess.rb +195 -185
- data/lib/isodoc/html_function/sectionsplit.rb +244 -0
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/presentation_function/bibdata.rb +7 -0
- data/lib/isodoc/presentation_function/block.rb +7 -4
- data/lib/isodoc/presentation_function/inline.rb +7 -12
- data/lib/isodoc/presentation_function/section.rb +38 -1
- data/lib/isodoc/presentation_xml_convert.rb +2 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref.rb +10 -7
- data/lib/isodoc/xref/xref_anchor.rb +45 -44
- data/lib/isodoc/xref/xref_counter.rb +113 -103
- data/lib/isodoc/xref/xref_gen.rb +39 -11
- data/spec/isodoc/blocks_spec.rb +184 -447
- data/spec/isodoc/cleanup_spec.rb +40 -42
- data/spec/isodoc/i18n_spec.rb +694 -821
- data/spec/isodoc/inline_spec.rb +197 -208
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +121 -30
- data/spec/isodoc/presentation_xml_spec.rb +4 -4
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/isodoc/xref_spec.rb +684 -1020
- metadata +19 -3
data/lib/isodoc/xref/xref_gen.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative "xref_gen_seq"
|
|
3
3
|
module IsoDoc::XrefGen
|
4
4
|
module Blocks
|
5
5
|
NUMBERED_BLOCKS = %w(termnote termexample note example requirement
|
6
|
-
|
6
|
+
recommendation permission figure table formula admonition sourcecode).freeze
|
7
7
|
|
8
8
|
def amend_preprocess(xmldoc)
|
9
9
|
xmldoc.xpath(ns("//amend[newcontent]")).each do |a|
|
@@ -60,9 +60,9 @@ module IsoDoc::XrefGen
|
|
60
60
|
|
61
61
|
c.increment(n)
|
62
62
|
idx = increment_label(examples, n, c, false)
|
63
|
-
@anchors[n["id"]] =
|
64
|
-
type: "termexample", label: idx, value: c.print,
|
65
|
-
|
63
|
+
@anchors[n["id"]] =
|
64
|
+
{ type: "termexample", label: idx, value: c.print,
|
65
|
+
xref: l10n("#{anchor(t['id'], :xref)}, "\
|
66
66
|
"#{@labels['example_xref']} #{c.print}") }
|
67
67
|
end
|
68
68
|
end
|
@@ -86,9 +86,8 @@ module IsoDoc::XrefGen
|
|
86
86
|
|
87
87
|
def note_anchor_names(sections)
|
88
88
|
sections.each do |s|
|
89
|
-
notes = s.xpath(CHILD_NOTES_XPATH)
|
90
89
|
c = Counter.new
|
91
|
-
notes.each do |n|
|
90
|
+
(notes = s.xpath(CHILD_NOTES_XPATH)).each do |n|
|
92
91
|
next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
|
93
92
|
|
94
93
|
@anchors[n["id"]] =
|
@@ -105,13 +104,12 @@ module IsoDoc::XrefGen
|
|
105
104
|
"xmlns:example | ./xmlns:example".freeze
|
106
105
|
|
107
106
|
CHILD_SECTIONS = "./clause | ./appendix | ./terms | ./definitions | "\
|
108
|
-
"./references"
|
107
|
+
"./references".freeze
|
109
108
|
|
110
109
|
def example_anchor_names(sections)
|
111
110
|
sections.each do |s|
|
112
|
-
notes = s.xpath(CHILD_EXAMPLES_XPATH)
|
113
111
|
c = Counter.new
|
114
|
-
notes.each do |n|
|
112
|
+
(notes = s.xpath(CHILD_EXAMPLES_XPATH)).each do |n|
|
115
113
|
next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
|
116
114
|
|
117
115
|
@anchors[n["id"]] =
|
@@ -145,14 +143,44 @@ module IsoDoc::XrefGen
|
|
145
143
|
label = "#{prev_label}.#{label}" unless prev_label.empty?
|
146
144
|
label = "#{list_anchor[:xref]} #{label}" if refer_list
|
147
145
|
li["id"] and @anchors[li["id"]] =
|
148
|
-
|
149
|
-
|
146
|
+
{ xref: "#{label})", type: "listitem",
|
147
|
+
container: list_anchor[:container] }
|
150
148
|
li.xpath(ns("./ol")).each do |ol|
|
151
149
|
list_item_anchor_names(ol, list_anchor, depth + 1, label, false)
|
152
150
|
end
|
153
151
|
end
|
154
152
|
end
|
155
153
|
|
154
|
+
def deflist_anchor_names(sections)
|
155
|
+
sections.each do |s|
|
156
|
+
notes = s.xpath(ns(".//dl")) - s.xpath(ns(".//clause//dl")) -
|
157
|
+
s.xpath(ns(".//appendix//dl")) - s.xpath(ns(".//dl//dl"))
|
158
|
+
c = Counter.new
|
159
|
+
notes.each do |n|
|
160
|
+
next if n["id"].nil? || n["id"].empty?
|
161
|
+
|
162
|
+
@anchors[n["id"]] =
|
163
|
+
anchor_struct(increment_label(notes, n, c), n,
|
164
|
+
@labels["deflist"], "deflist", false)
|
165
|
+
deflist_term_anchor_names(n, @anchors[n["id"]])
|
166
|
+
end
|
167
|
+
deflist_anchor_names(s.xpath(ns(CHILD_SECTIONS)))
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def deflist_term_anchor_names(list, list_anchor)
|
172
|
+
list.xpath(ns("./dt")).each do |li|
|
173
|
+
label = li.text
|
174
|
+
label = l10n("#{list_anchor[:xref]}: #{label}")
|
175
|
+
li["id"] and @anchors[li["id"]] =
|
176
|
+
{ xref: label, type: "deflistitem",
|
177
|
+
container: list_anchor[:container] }
|
178
|
+
li.xpath(ns("./dl")).each do |dl|
|
179
|
+
deflist_term_anchor_names(dl, list_anchor)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
156
184
|
def bookmark_anchor_names(docxml)
|
157
185
|
docxml.xpath(ns(".//bookmark")).each do |n|
|
158
186
|
next if n["id"].nil? || n["id"].empty?
|
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -100,7 +100,7 @@ RSpec.describe IsoDoc do
|
|
100
100
|
</ext>
|
101
101
|
</bibdata>
|
102
102
|
<sections>
|
103
|
-
<clause id="A" inline-header="false" obligation="normative">
|
103
|
+
<clause id="A" inline-header="false" obligation="normative" displayorder="1">
|
104
104
|
<title depth="1">1.<tab/>Change Clause</title>
|
105
105
|
<p id="C">
|
106
106
|
<em>
|
@@ -256,7 +256,7 @@ RSpec.describe IsoDoc do
|
|
256
256
|
<?xml version='1.0'?>
|
257
257
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
258
258
|
<preface>
|
259
|
-
<foreword>
|
259
|
+
<foreword displayorder="1">
|
260
260
|
<note id='A' keep-with-next='true' keep-lines-together='true'>
|
261
261
|
<name>NOTE</name>
|
262
262
|
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
@@ -332,7 +332,7 @@ RSpec.describe IsoDoc do
|
|
332
332
|
<?xml version='1.0'?>
|
333
333
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
334
334
|
<preface>
|
335
|
-
<foreword>
|
335
|
+
<foreword displayorder="1">
|
336
336
|
<note id='note1'>
|
337
337
|
<name>NOTE 1</name>
|
338
338
|
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
@@ -591,7 +591,7 @@ RSpec.describe IsoDoc do
|
|
591
591
|
presxml = <<~OUTPUT
|
592
592
|
<?xml version='1.0'?>
|
593
593
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
594
|
-
<preface><foreword>
|
594
|
+
<preface><foreword displayorder="1">
|
595
595
|
<figure id="figureA-1" keep-with-next="true" keep-lines-together="true">
|
596
596
|
<name>Figure 1 — Split-it-right <em>sample</em> divider<fn reference="1"><p>X</p></fn></name>
|
597
597
|
<image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
|
@@ -735,7 +735,7 @@ RSpec.describe IsoDoc do
|
|
735
735
|
presxml = <<~OUTPUT
|
736
736
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
737
737
|
<preface>
|
738
|
-
<foreword>
|
738
|
+
<foreword displayorder="1">
|
739
739
|
<figure id='figureA-1'>
|
740
740
|
<name>Figure 1</name>
|
741
741
|
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'>
|
@@ -955,7 +955,7 @@ RSpec.describe IsoDoc do
|
|
955
955
|
<?xml version='1.0'?>
|
956
956
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
957
957
|
<preface>
|
958
|
-
<foreword>
|
958
|
+
<foreword displayorder="1">
|
959
959
|
<example id='samplecode' keep-with-next='true' keep-lines-together='true'>
|
960
960
|
<name>EXAMPLE — Title</name>
|
961
961
|
<p>Hello</p>
|
@@ -1030,9 +1030,12 @@ RSpec.describe IsoDoc do
|
|
1030
1030
|
</body>
|
1031
1031
|
</html>
|
1032
1032
|
OUTPUT
|
1033
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1034
|
-
|
1035
|
-
expect(xmlpp(IsoDoc::
|
1033
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1034
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1035
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1036
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1037
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
1038
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(doc)
|
1036
1039
|
end
|
1037
1040
|
|
1038
1041
|
it "processes sequences of examples" do
|
@@ -1056,7 +1059,7 @@ RSpec.describe IsoDoc do
|
|
1056
1059
|
<?xml version='1.0'?>
|
1057
1060
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1058
1061
|
<preface>
|
1059
|
-
<foreword>
|
1062
|
+
<foreword displayorder="1">
|
1060
1063
|
<example id='samplecode'>
|
1061
1064
|
<name>EXAMPLE 1</name>
|
1062
1065
|
<p>Hello</p>
|
@@ -1073,7 +1076,8 @@ RSpec.describe IsoDoc do
|
|
1073
1076
|
</preface>
|
1074
1077
|
</iso-standard>
|
1075
1078
|
OUTPUT
|
1076
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1079
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1080
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1077
1081
|
end
|
1078
1082
|
|
1079
1083
|
it "processes sourcecode" do
|
@@ -1094,7 +1098,7 @@ RSpec.describe IsoDoc do
|
|
1094
1098
|
<?xml version='1.0'?>
|
1095
1099
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1096
1100
|
<preface>
|
1097
|
-
<foreword>
|
1101
|
+
<foreword displayorder="1">
|
1098
1102
|
<sourcecode lang='ruby' id='samplecode'>
|
1099
1103
|
<name>
|
1100
1104
|
Figure 1 — Ruby
|
@@ -1153,13 +1157,16 @@ RSpec.describe IsoDoc do
|
|
1153
1157
|
</body>
|
1154
1158
|
</html>
|
1155
1159
|
OUTPUT
|
1156
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1157
|
-
|
1158
|
-
expect(xmlpp(IsoDoc::
|
1160
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1161
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1162
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1163
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1164
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
1165
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(doc)
|
1159
1166
|
end
|
1160
1167
|
|
1161
1168
|
it "processes sourcecode with escapes preserved" do
|
1162
|
-
|
1169
|
+
input = <<~INPUT
|
1163
1170
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1164
1171
|
<preface><foreword>
|
1165
1172
|
<sourcecode id="samplecode">
|
@@ -1169,6 +1176,7 @@ RSpec.describe IsoDoc do
|
|
1169
1176
|
</foreword></preface>
|
1170
1177
|
</iso-standard>
|
1171
1178
|
INPUT
|
1179
|
+
output = <<~OUTPUT
|
1172
1180
|
#{HTML_HDR}
|
1173
1181
|
<br/>
|
1174
1182
|
<div>
|
@@ -1181,10 +1189,12 @@ RSpec.describe IsoDoc do
|
|
1181
1189
|
</body>
|
1182
1190
|
</html>
|
1183
1191
|
OUTPUT
|
1192
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1193
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1184
1194
|
end
|
1185
1195
|
|
1186
1196
|
it "processes sourcecode with annotations" do
|
1187
|
-
|
1197
|
+
input = <<~INPUT
|
1188
1198
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1189
1199
|
<preface><foreword>
|
1190
1200
|
<sourcecode id="_">puts "Hello, world." <callout target="A">1</callout>
|
@@ -1198,6 +1208,7 @@ RSpec.describe IsoDoc do
|
|
1198
1208
|
</foreword></preface>
|
1199
1209
|
</iso-standard>
|
1200
1210
|
INPUT
|
1211
|
+
output = <<~OUTPUT
|
1201
1212
|
#{HTML_HDR}
|
1202
1213
|
<br/>
|
1203
1214
|
<div>
|
@@ -1209,10 +1220,12 @@ RSpec.describe IsoDoc do
|
|
1209
1220
|
</body>
|
1210
1221
|
</html>
|
1211
1222
|
OUTPUT
|
1223
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1224
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1212
1225
|
end
|
1213
1226
|
|
1214
1227
|
it "processes admonitions" do
|
1215
|
-
|
1228
|
+
input = <<~INPUT
|
1216
1229
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1217
1230
|
<preface><foreword>
|
1218
1231
|
<admonition id="_70234f78-64e5-4dfc-8b6f-f3f037348b6a" type="caution" keep-with-next="true" keep-lines-together="true">
|
@@ -1221,6 +1234,7 @@ RSpec.describe IsoDoc do
|
|
1221
1234
|
</foreword></preface>
|
1222
1235
|
</iso-standard>
|
1223
1236
|
INPUT
|
1237
|
+
output = <<~OUTPUT
|
1224
1238
|
#{HTML_HDR}
|
1225
1239
|
<br/>
|
1226
1240
|
<div>
|
@@ -1234,10 +1248,12 @@ RSpec.describe IsoDoc do
|
|
1234
1248
|
</body>
|
1235
1249
|
</html>
|
1236
1250
|
OUTPUT
|
1251
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1252
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1237
1253
|
end
|
1238
1254
|
|
1239
1255
|
it "processes admonitions with titles" do
|
1240
|
-
|
1256
|
+
input = <<~INPUT
|
1241
1257
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1242
1258
|
<preface><foreword>
|
1243
1259
|
<admonition id="_70234f78-64e5-4dfc-8b6f-f3f037348b6a" type="caution">
|
@@ -1247,6 +1263,7 @@ RSpec.describe IsoDoc do
|
|
1247
1263
|
</foreword></preface>
|
1248
1264
|
</iso-standard>
|
1249
1265
|
INPUT
|
1266
|
+
output = <<~OUTPUT
|
1250
1267
|
#{HTML_HDR}
|
1251
1268
|
<br/>
|
1252
1269
|
<div>
|
@@ -1260,10 +1277,12 @@ RSpec.describe IsoDoc do
|
|
1260
1277
|
</body>
|
1261
1278
|
</html>
|
1262
1279
|
OUTPUT
|
1280
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1281
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1263
1282
|
end
|
1264
1283
|
|
1265
|
-
it "processes formulae
|
1266
|
-
|
1284
|
+
it "processes formulae" do
|
1285
|
+
input = <<~INPUT
|
1267
1286
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1268
1287
|
<preface><foreword>
|
1269
1288
|
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true" keep-with-next="true" keep-lines-together="true">
|
@@ -1286,43 +1305,9 @@ RSpec.describe IsoDoc do
|
|
1286
1305
|
</foreword></preface>
|
1287
1306
|
</iso-standard>
|
1288
1307
|
INPUT
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
<foreword>
|
1293
|
-
<formula id='_be9158af-7e93-4ee2-90c5-26d31c181934' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
|
1294
|
-
<stem type='AsciiMath'>r = 1 %</stem>
|
1295
|
-
<dl id='_e4fe94fe-1cde-49d9-b1ad-743293b7e21d'>
|
1296
|
-
<dt>
|
1297
|
-
<stem type='AsciiMath'>r</stem>
|
1298
|
-
</dt>
|
1299
|
-
<dd>
|
1300
|
-
<p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the repeatability limit.</p>
|
1301
|
-
</dd>
|
1302
|
-
</dl>
|
1303
|
-
<note id='_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0'>
|
1304
|
-
<name>NOTE</name>
|
1305
|
-
<p id='_511aaa98-4116-42af-8e5b-c87cdf5bfdc8'>
|
1306
|
-
[durationUnits] is essentially a duration statement without the "P"
|
1307
|
-
prefix. "P" is unnecessary because between "G" and "U" duration is
|
1308
|
-
always expressed.
|
1309
|
-
</p>
|
1310
|
-
</note>
|
1311
|
-
</formula>
|
1312
|
-
<formula id='_be9158af-7e93-4ee2-90c5-26d31c181935'>
|
1313
|
-
<name>1</name>
|
1314
|
-
<stem type='AsciiMath'>r = 1 %</stem>
|
1315
|
-
</formula>
|
1316
|
-
</foreword>
|
1317
|
-
</preface>
|
1318
|
-
</iso-standard>
|
1319
|
-
OUTPUT
|
1320
|
-
end
|
1321
|
-
|
1322
|
-
it "processes formulae (HTML)" do
|
1323
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1324
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1325
|
-
<preface><foreword>
|
1308
|
+
presxml = <<~INPUT
|
1309
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type='presentation'>
|
1310
|
+
<preface><foreword displayorder="1">
|
1326
1311
|
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true" keep-with-next="true" keep-lines-together="true">
|
1327
1312
|
<stem type="AsciiMath">r = 1 %</stem>
|
1328
1313
|
<dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
|
@@ -1344,6 +1329,7 @@ RSpec.describe IsoDoc do
|
|
1344
1329
|
</foreword></preface>
|
1345
1330
|
</iso-standard>
|
1346
1331
|
INPUT
|
1332
|
+
html = <<~OUTPUT
|
1347
1333
|
#{HTML_HDR}
|
1348
1334
|
<br/>
|
1349
1335
|
<div>
|
@@ -1364,33 +1350,8 @@ RSpec.describe IsoDoc do
|
|
1364
1350
|
</body>
|
1365
1351
|
</html>
|
1366
1352
|
OUTPUT
|
1367
|
-
end
|
1368
1353
|
|
1369
|
-
|
1370
|
-
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1371
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1372
|
-
<preface><foreword>
|
1373
|
-
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true" keep-with-next="true" keep-lines-together="true">
|
1374
|
-
<stem type="AsciiMath">r = 1 %</stem>
|
1375
|
-
<dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
|
1376
|
-
<dt>
|
1377
|
-
<stem type="AsciiMath">r</stem>
|
1378
|
-
</dt>
|
1379
|
-
<dd>
|
1380
|
-
<p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
|
1381
|
-
</dd>
|
1382
|
-
</dl>
|
1383
|
-
<note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
|
1384
|
-
<name>NOTE</name>
|
1385
|
-
<p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
|
1386
|
-
</note>
|
1387
|
-
</formula>
|
1388
|
-
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181935"><name>1</name>
|
1389
|
-
<stem type="AsciiMath">r = 1 %</stem>
|
1390
|
-
</formula>
|
1391
|
-
</foreword></preface>
|
1392
|
-
</iso-standard>
|
1393
|
-
INPUT
|
1354
|
+
word = <<~OUTPUT
|
1394
1355
|
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
1395
1356
|
<head>
|
1396
1357
|
<style>
|
@@ -1458,10 +1419,16 @@ RSpec.describe IsoDoc do
|
|
1458
1419
|
</body>
|
1459
1420
|
</html>
|
1460
1421
|
OUTPUT
|
1422
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1423
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1424
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1425
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1426
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
1427
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
|
1461
1428
|
end
|
1462
1429
|
|
1463
1430
|
it "processes paragraph attributes" do
|
1464
|
-
|
1431
|
+
input = <<~INPUT
|
1465
1432
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1466
1433
|
<preface><foreword>
|
1467
1434
|
<p align="left" id="_08bfe952-d57f-4150-9c95-5d52098cc2a8">Vache Equipment<br/>
|
@@ -1471,6 +1438,7 @@ RSpec.describe IsoDoc do
|
|
1471
1438
|
</foreword></preface>
|
1472
1439
|
</iso-standard>
|
1473
1440
|
INPUT
|
1441
|
+
html = <<~OUTPUT
|
1474
1442
|
#{HTML_HDR}
|
1475
1443
|
<br/>
|
1476
1444
|
<div>
|
@@ -1486,19 +1454,8 @@ RSpec.describe IsoDoc do
|
|
1486
1454
|
</body>
|
1487
1455
|
</html>
|
1488
1456
|
OUTPUT
|
1489
|
-
end
|
1490
1457
|
|
1491
|
-
|
1492
|
-
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1493
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1494
|
-
<preface><foreword>
|
1495
|
-
<p align="left" id="_08bfe952-d57f-4150-9c95-5d52098cc2a8">Vache Equipment<br/>
|
1496
|
-
Fictitious<br/>
|
1497
|
-
World</p>
|
1498
|
-
<p align="justify" keep-with-next="true" keep-lines-together="true">Justify</p>
|
1499
|
-
</foreword></preface>
|
1500
|
-
</iso-standard>
|
1501
|
-
INPUT
|
1458
|
+
word = <<~OUTPUT
|
1502
1459
|
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
|
1503
1460
|
<head><style/></head>
|
1504
1461
|
<body lang="EN-US" link="blue" vlink="#954F72">
|
@@ -1525,10 +1482,14 @@ RSpec.describe IsoDoc do
|
|
1525
1482
|
</body>
|
1526
1483
|
</html>
|
1527
1484
|
OUTPUT
|
1485
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1486
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(html)
|
1487
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
1488
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(word)
|
1528
1489
|
end
|
1529
1490
|
|
1530
|
-
it "processes blockquotes
|
1531
|
-
|
1491
|
+
it "processes blockquotes" do
|
1492
|
+
input = <<~INPUT
|
1532
1493
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1533
1494
|
<preface><foreword>
|
1534
1495
|
<quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
|
@@ -1539,37 +1500,10 @@ RSpec.describe IsoDoc do
|
|
1539
1500
|
</foreword></preface>
|
1540
1501
|
</iso-standard>
|
1541
1502
|
INPUT
|
1542
|
-
<?xml version='1.0'?>
|
1543
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1544
|
-
<preface>
|
1545
|
-
<foreword>
|
1546
|
-
<quote id='_044bd364-c832-4b78-8fea-92242402a1d1'>
|
1547
|
-
<source type='inline' bibitemid='ISO7301' citeas='ISO 7301:2011'>
|
1548
|
-
<locality type='clause'>
|
1549
|
-
<referenceFrom>1</referenceFrom>
|
1550
|
-
</locality>ISO 7301:2011, Clause 1
|
1551
|
-
</source>
|
1552
|
-
<author>ISO</author>
|
1553
|
-
<p id='_d4fd0a61-f300-4285-abe6-602707590e53'>
|
1554
|
-
This International Standard gives the minimum specifications for rice
|
1555
|
-
(
|
1556
|
-
<em>Oryza sativa</em>
|
1557
|
-
L.) which is subject to international trade. It is applicable to the
|
1558
|
-
following types: husked rice and milled rice, parboiled or not,
|
1559
|
-
intended for direct human consumption. It is neither applicable to
|
1560
|
-
other products derived from rice, nor to waxy rice (glutinous rice).
|
1561
|
-
</p>
|
1562
|
-
</quote>
|
1563
|
-
</foreword>
|
1564
|
-
</preface>
|
1565
|
-
</iso-standard>
|
1566
|
-
OUTPUT
|
1567
|
-
end
|
1568
1503
|
|
1569
|
-
|
1570
|
-
|
1571
|
-
<
|
1572
|
-
<preface><foreword>
|
1504
|
+
presxml = <<~INPUT
|
1505
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type='presentation'>
|
1506
|
+
<preface><foreword displayorder="1">
|
1573
1507
|
<quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
|
1574
1508
|
<source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 7301:2011, Clause 1</source>
|
1575
1509
|
<author>ISO</author>
|
@@ -1578,21 +1512,26 @@ RSpec.describe IsoDoc do
|
|
1578
1512
|
</foreword></preface>
|
1579
1513
|
</iso-standard>
|
1580
1514
|
INPUT
|
1515
|
+
html = <<~OUTPUT
|
1581
1516
|
#{HTML_HDR}
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1517
|
+
<br/>
|
1518
|
+
<div>
|
1519
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
1520
|
+
<div class="Quote" id="_044bd364-c832-4b78-8fea-92242402a1d1">
|
1586
1521
|
|
1587
1522
|
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1523
|
+
<p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<i>Oryza sativa</i> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
|
1524
|
+
<p class="QuoteAttribution">— ISO, <a href="#ISO7301">ISO 7301:2011, Clause 1</a></p></div>
|
1525
|
+
</div>
|
1526
|
+
<p class="zzSTDTitle1"/>
|
1527
|
+
</div>
|
1528
|
+
</body>
|
1529
|
+
</html>
|
1595
1530
|
OUTPUT
|
1531
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1532
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1533
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1534
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1596
1535
|
end
|
1597
1536
|
|
1598
1537
|
it "processes term domains" do
|
@@ -1621,273 +1560,11 @@ RSpec.describe IsoDoc do
|
|
1621
1560
|
OUTPUT
|
1622
1561
|
end
|
1623
1562
|
|
1624
|
-
it "processes permissions
|
1625
|
-
|
1626
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1627
|
-
<preface><foreword>
|
1628
|
-
<permission id="_" keep-with-next="true" keep-lines-together="true">
|
1629
|
-
<label>/ogc/recommendation/wfs/2</label>
|
1630
|
-
<inherit>/ss/584/2015/level/1</inherit>
|
1631
|
-
<inherit><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></inherit>
|
1632
|
-
<subject>user</subject>
|
1633
|
-
<classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
|
1634
|
-
<description>
|
1635
|
-
<p id="_">I recommend <em>this</em>.</p>
|
1636
|
-
</description>
|
1637
|
-
<specification exclude="true" type="tabular">
|
1638
|
-
<p id="_">This is the object of the recommendation:</p>
|
1639
|
-
<table id="_">
|
1640
|
-
<tbody>
|
1641
|
-
<tr>
|
1642
|
-
<td style="text-align:left;">Object</td>
|
1643
|
-
<td style="text-align:left;">Value</td>
|
1644
|
-
</tr>
|
1645
|
-
<tr>
|
1646
|
-
<td style="text-align:left;">Mission</td>
|
1647
|
-
<td style="text-align:left;">Accomplished</td>
|
1648
|
-
</tr>
|
1649
|
-
</tbody>
|
1650
|
-
</table>
|
1651
|
-
</specification>
|
1652
|
-
<description>
|
1653
|
-
<p id="_">As for the measurement targets,</p>
|
1654
|
-
</description>
|
1655
|
-
<measurement-target exclude="false">
|
1656
|
-
<p id="_">The measurement target shall be measured as:</p>
|
1657
|
-
<formula id="_">
|
1658
|
-
<stem type="AsciiMath">r/1 = 0</stem>
|
1659
|
-
</formula>
|
1660
|
-
</measurement-target>
|
1661
|
-
<verification exclude="false">
|
1662
|
-
<p id="_">The following code will be run for verification:</p>
|
1663
|
-
<sourcecode id="_">CoreRoot(success): HttpResponse
|
1664
|
-
if (success)
|
1665
|
-
recommendation(label: success-response)
|
1666
|
-
end
|
1667
|
-
</sourcecode>
|
1668
|
-
</verification>
|
1669
|
-
<import exclude="true">
|
1670
|
-
<sourcecode id="_">success-response()</sourcecode>
|
1671
|
-
</import>
|
1672
|
-
</permission>
|
1673
|
-
</foreword></preface>
|
1674
|
-
<bibliography><references id="_bibliography" obligation="informative" normative="false">
|
1675
|
-
<title>Bibliography</title>
|
1676
|
-
<bibitem id="rfc2616" type="standard"> <fetched>2020-03-27</fetched> <title format="text/plain" language="en" script="Latn">Hypertext Transfer Protocol — HTTP/1.1</title> <uri type="xml">https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri> <uri type="src">https://www.rfc-editor.org/info/rfc2616</uri> <docidentifier type="IETF">RFC 2616</docidentifier> <docidentifier type="rfc-anchor">RFC2616</docidentifier> <docidentifier type="DOI">10.17487/RFC2616</docidentifier> <date type="published"> <on>1999-06</on> </date> <contributor> <role type="author"/> <person> <name> <completename language="en">R. Fielding</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Gettys</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Mogul</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">H. Frystyk</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">L. Masinter</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">P. Leach</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">T. Berners-Lee</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <language>en</language> <script>Latn</script> <abstract format="text/plain" language="en" script="Latn">HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as “HTTP/1.1”, and is an update to RFC 2068. [STANDARDS-TRACK]</abstract> <series type="main"> <title format="text/plain" language="en" script="Latn">RFC</title> <number>2616</number> </series> <place>Fremont, CA</place></bibitem>
|
1677
|
-
</references></bibliography>
|
1678
|
-
</iso-standard>
|
1679
|
-
INPUT
|
1680
|
-
<?xml version='1.0'?>
|
1681
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1682
|
-
<preface>
|
1683
|
-
<foreword>
|
1684
|
-
<permission id='_' keep-with-next='true' keep-lines-together='true'>
|
1685
|
-
<name>Permission 1</name>
|
1686
|
-
<label>/ogc/recommendation/wfs/2</label>
|
1687
|
-
<inherit>/ss/584/2015/level/1</inherit>
|
1688
|
-
<inherit>
|
1689
|
-
<eref type='inline' bibitemid='rfc2616' citeas='RFC 2616'>RFC 2616 (HTTP/1.1)</eref>
|
1690
|
-
</inherit>
|
1691
|
-
<subject>user</subject>
|
1692
|
-
<classification>
|
1693
|
-
<tag>control-class</tag>
|
1694
|
-
<value>Technical</value>
|
1695
|
-
</classification>
|
1696
|
-
<classification>
|
1697
|
-
<tag>priority</tag>
|
1698
|
-
<value>P0</value>
|
1699
|
-
</classification>
|
1700
|
-
<classification>
|
1701
|
-
<tag>family</tag>
|
1702
|
-
<value>System and Communications Protection</value>
|
1703
|
-
</classification>
|
1704
|
-
<classification>
|
1705
|
-
<tag>family</tag>
|
1706
|
-
<value>System and Communications Protocols</value>
|
1707
|
-
</classification>
|
1708
|
-
<description>
|
1709
|
-
<p id='_'>
|
1710
|
-
I recommend
|
1711
|
-
<em>this</em>
|
1712
|
-
.
|
1713
|
-
</p>
|
1714
|
-
</description>
|
1715
|
-
<specification exclude='true' type='tabular'>
|
1716
|
-
<p id='_'>This is the object of the recommendation:</p>
|
1717
|
-
<table id='_'>
|
1718
|
-
<tbody>
|
1719
|
-
<tr>
|
1720
|
-
<td style='text-align:left;'>Object</td>
|
1721
|
-
<td style='text-align:left;'>Value</td>
|
1722
|
-
</tr>
|
1723
|
-
<tr>
|
1724
|
-
<td style='text-align:left;'>Mission</td>
|
1725
|
-
<td style='text-align:left;'>Accomplished</td>
|
1726
|
-
</tr>
|
1727
|
-
</tbody>
|
1728
|
-
</table>
|
1729
|
-
</specification>
|
1730
|
-
<description>
|
1731
|
-
<p id='_'>As for the measurement targets,</p>
|
1732
|
-
</description>
|
1733
|
-
<measurement-target exclude='false'>
|
1734
|
-
<p id='_'>The measurement target shall be measured as:</p>
|
1735
|
-
<formula id='_'>
|
1736
|
-
<name>1</name>
|
1737
|
-
<stem type='AsciiMath'>r/1 = 0</stem>
|
1738
|
-
</formula>
|
1739
|
-
</measurement-target>
|
1740
|
-
<verification exclude='false'>
|
1741
|
-
<p id='_'>The following code will be run for verification:</p>
|
1742
|
-
<sourcecode id='_'>
|
1743
|
-
CoreRoot(success): HttpResponse if (success) recommendation(label:
|
1744
|
-
success-response) end
|
1745
|
-
</sourcecode>
|
1746
|
-
</verification>
|
1747
|
-
<import exclude='true'>
|
1748
|
-
<sourcecode id='_'>success-response()</sourcecode>
|
1749
|
-
</import>
|
1750
|
-
</permission>
|
1751
|
-
</foreword>
|
1752
|
-
</preface>
|
1753
|
-
<bibliography>
|
1754
|
-
<references id='_bibliography' obligation='informative' normative='false'>
|
1755
|
-
<title depth="1">Bibliography</title>
|
1756
|
-
<bibitem id='rfc2616' type='standard'>
|
1757
|
-
<fetched>2020-03-27</fetched>
|
1758
|
-
<title format='text/plain' language='en' script='Latn'>Hypertext Transfer Protocol — HTTP/1.1</title>
|
1759
|
-
<uri type='xml'>https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri>
|
1760
|
-
<uri type='src'>https://www.rfc-editor.org/info/rfc2616</uri>
|
1761
|
-
<docidentifier type='IETF'>RFC 2616</docidentifier>
|
1762
|
-
<docidentifier type='rfc-anchor'>RFC2616</docidentifier>
|
1763
|
-
<docidentifier type='DOI'>10.17487/RFC2616</docidentifier>
|
1764
|
-
<date type='published'>
|
1765
|
-
<on>1999-06</on>
|
1766
|
-
</date>
|
1767
|
-
<contributor>
|
1768
|
-
<role type='author'/>
|
1769
|
-
<person>
|
1770
|
-
<name>
|
1771
|
-
<completename language='en'>R. Fielding</completename>
|
1772
|
-
</name>
|
1773
|
-
<affiliation>
|
1774
|
-
<organization>
|
1775
|
-
<name>IETF</name>
|
1776
|
-
<abbreviation>IETF</abbreviation>
|
1777
|
-
</organization>
|
1778
|
-
</affiliation>
|
1779
|
-
</person>
|
1780
|
-
</contributor>
|
1781
|
-
<contributor>
|
1782
|
-
<role type='author'/>
|
1783
|
-
<person>
|
1784
|
-
<name>
|
1785
|
-
<completename language='en'>J. Gettys</completename>
|
1786
|
-
</name>
|
1787
|
-
<affiliation>
|
1788
|
-
<organization>
|
1789
|
-
<name>IETF</name>
|
1790
|
-
<abbreviation>IETF</abbreviation>
|
1791
|
-
</organization>
|
1792
|
-
</affiliation>
|
1793
|
-
</person>
|
1794
|
-
</contributor>
|
1795
|
-
<contributor>
|
1796
|
-
<role type='author'/>
|
1797
|
-
<person>
|
1798
|
-
<name>
|
1799
|
-
<completename language='en'>J. Mogul</completename>
|
1800
|
-
</name>
|
1801
|
-
<affiliation>
|
1802
|
-
<organization>
|
1803
|
-
<name>IETF</name>
|
1804
|
-
<abbreviation>IETF</abbreviation>
|
1805
|
-
</organization>
|
1806
|
-
</affiliation>
|
1807
|
-
</person>
|
1808
|
-
</contributor>
|
1809
|
-
<contributor>
|
1810
|
-
<role type='author'/>
|
1811
|
-
<person>
|
1812
|
-
<name>
|
1813
|
-
<completename language='en'>H. Frystyk</completename>
|
1814
|
-
</name>
|
1815
|
-
<affiliation>
|
1816
|
-
<organization>
|
1817
|
-
<name>IETF</name>
|
1818
|
-
<abbreviation>IETF</abbreviation>
|
1819
|
-
</organization>
|
1820
|
-
</affiliation>
|
1821
|
-
</person>
|
1822
|
-
</contributor>
|
1823
|
-
<contributor>
|
1824
|
-
<role type='author'/>
|
1825
|
-
<person>
|
1826
|
-
<name>
|
1827
|
-
<completename language='en'>L. Masinter</completename>
|
1828
|
-
</name>
|
1829
|
-
<affiliation>
|
1830
|
-
<organization>
|
1831
|
-
<name>IETF</name>
|
1832
|
-
<abbreviation>IETF</abbreviation>
|
1833
|
-
</organization>
|
1834
|
-
</affiliation>
|
1835
|
-
</person>
|
1836
|
-
</contributor>
|
1837
|
-
<contributor>
|
1838
|
-
<role type='author'/>
|
1839
|
-
<person>
|
1840
|
-
<name>
|
1841
|
-
<completename language='en'>P. Leach</completename>
|
1842
|
-
</name>
|
1843
|
-
<affiliation>
|
1844
|
-
<organization>
|
1845
|
-
<name>IETF</name>
|
1846
|
-
<abbreviation>IETF</abbreviation>
|
1847
|
-
</organization>
|
1848
|
-
</affiliation>
|
1849
|
-
</person>
|
1850
|
-
</contributor>
|
1851
|
-
<contributor>
|
1852
|
-
<role type='author'/>
|
1853
|
-
<person>
|
1854
|
-
<name>
|
1855
|
-
<completename language='en'>T. Berners-Lee</completename>
|
1856
|
-
</name>
|
1857
|
-
<affiliation>
|
1858
|
-
<organization>
|
1859
|
-
<name>IETF</name>
|
1860
|
-
<abbreviation>IETF</abbreviation>
|
1861
|
-
</organization>
|
1862
|
-
</affiliation>
|
1863
|
-
</person>
|
1864
|
-
</contributor>
|
1865
|
-
<language>en</language>
|
1866
|
-
<script>Latn</script>
|
1867
|
-
<abstract format='text/plain' language='en' script='Latn'>
|
1868
|
-
HTTP has been in use by the World-Wide Web global information
|
1869
|
-
initiative since 1990. This specification defines the protocol
|
1870
|
-
referred to as “HTTP/1.1”, and is an update to RFC 2068.
|
1871
|
-
[STANDARDS-TRACK]
|
1872
|
-
</abstract>
|
1873
|
-
<series type='main'>
|
1874
|
-
<title format='text/plain' language='en' script='Latn'>RFC</title>
|
1875
|
-
<number>2616</number>
|
1876
|
-
</series>
|
1877
|
-
<place>Fremont, CA</place>
|
1878
|
-
</bibitem>
|
1879
|
-
</references>
|
1880
|
-
</bibliography>
|
1881
|
-
</iso-standard>
|
1882
|
-
OUTPUT
|
1883
|
-
end
|
1884
|
-
|
1885
|
-
it "processes permissions (HTML)" do
|
1886
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1563
|
+
it "processes permissions" do
|
1564
|
+
input = <<~INPUT
|
1887
1565
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1888
1566
|
<preface><foreword>
|
1889
1567
|
<permission id="_" keep-with-next="true" keep-lines-together="true">
|
1890
|
-
<name>Permission 1</name>
|
1891
1568
|
<label>/ogc/recommendation/wfs/2</label>
|
1892
1569
|
<inherit>/ss/584/2015/level/1</inherit>
|
1893
1570
|
<inherit><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></inherit>
|
@@ -1933,52 +1610,112 @@ RSpec.describe IsoDoc do
|
|
1933
1610
|
</import>
|
1934
1611
|
</permission>
|
1935
1612
|
</foreword></preface>
|
1936
|
-
<bibliography><references id="_bibliography" obligation="informative" normative="false">
|
1613
|
+
<bibliography><references id="_bibliography" obligation="informative" normative="false" displayorder="2">
|
1937
1614
|
<title>Bibliography</title>
|
1938
1615
|
<bibitem id="rfc2616" type="standard"> <fetched>2020-03-27</fetched> <title format="text/plain" language="en" script="Latn">Hypertext Transfer Protocol — HTTP/1.1</title> <uri type="xml">https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri> <uri type="src">https://www.rfc-editor.org/info/rfc2616</uri> <docidentifier type="IETF">RFC 2616</docidentifier> <docidentifier type="rfc-anchor">RFC2616</docidentifier> <docidentifier type="DOI">10.17487/RFC2616</docidentifier> <date type="published"> <on>1999-06</on> </date> <contributor> <role type="author"/> <person> <name> <completename language="en">R. Fielding</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Gettys</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Mogul</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">H. Frystyk</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">L. Masinter</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">P. Leach</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">T. Berners-Lee</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <language>en</language> <script>Latn</script> <abstract format="text/plain" language="en" script="Latn">HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as “HTTP/1.1”, and is an update to RFC 2068. [STANDARDS-TRACK]</abstract> <series type="main"> <title format="text/plain" language="en" script="Latn">RFC</title> <number>2616</number> </series> <place>Fremont, CA</place></bibitem>
|
1939
1616
|
</references></bibliography>
|
1940
1617
|
</iso-standard>
|
1941
1618
|
INPUT
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1619
|
+
presxml = <<~OUTPUT
|
1620
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type='presentation'>
|
1621
|
+
<preface><foreword displayorder='1'>
|
1622
|
+
<permission id="_" keep-with-next="true" keep-lines-together="true">
|
1623
|
+
<name>Permission 1</name>
|
1624
|
+
<label>/ogc/recommendation/wfs/2</label>
|
1625
|
+
<inherit>/ss/584/2015/level/1</inherit>
|
1626
|
+
<inherit><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></inherit>
|
1627
|
+
<subject>user</subject>
|
1628
|
+
<classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
|
1629
|
+
<description>
|
1630
|
+
<p id="_">I recommend <em>this</em>.</p>
|
1631
|
+
</description>
|
1632
|
+
<specification exclude="true" type="tabular">
|
1633
|
+
<p id="_">This is the object of the recommendation:</p>
|
1634
|
+
<table id="_">
|
1635
|
+
<tbody>
|
1636
|
+
<tr>
|
1637
|
+
<td style="text-align:left;">Object</td>
|
1638
|
+
<td style="text-align:left;">Value</td>
|
1639
|
+
</tr>
|
1640
|
+
<tr>
|
1641
|
+
<td style="text-align:left;">Mission</td>
|
1642
|
+
<td style="text-align:left;">Accomplished</td>
|
1643
|
+
</tr>
|
1644
|
+
</tbody>
|
1645
|
+
</table>
|
1646
|
+
</specification>
|
1647
|
+
<description>
|
1648
|
+
<p id="_">As for the measurement targets,</p>
|
1649
|
+
</description>
|
1650
|
+
<measurement-target exclude="false">
|
1651
|
+
<p id="_">The measurement target shall be measured as:</p>
|
1652
|
+
<formula id="_">
|
1653
|
+
<name>1</name>
|
1654
|
+
<stem type="AsciiMath">r/1 = 0</stem>
|
1655
|
+
</formula>
|
1656
|
+
</measurement-target>
|
1657
|
+
<verification exclude="false">
|
1658
|
+
<p id="_">The following code will be run for verification:</p>
|
1659
|
+
<sourcecode id="_">CoreRoot(success): HttpResponse
|
1660
|
+
if (success)
|
1661
|
+
recommendation(label: success-response)
|
1662
|
+
end
|
1663
|
+
</sourcecode>
|
1664
|
+
</verification>
|
1665
|
+
<import exclude="true">
|
1666
|
+
<sourcecode id="_">success-response()</sourcecode>
|
1667
|
+
</import>
|
1668
|
+
</permission>
|
1669
|
+
</foreword></preface>
|
1670
|
+
<bibliography><references id="_bibliography" obligation="informative" normative="false" displayorder='2'>
|
1671
|
+
<title depth='1'>Bibliography</title>
|
1672
|
+
<bibitem id="rfc2616" type="standard"> <fetched>2020-03-27</fetched> <title format="text/plain" language="en" script="Latn">Hypertext Transfer Protocol — HTTP/1.1</title> <uri type="xml">https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri> <uri type="src">https://www.rfc-editor.org/info/rfc2616</uri> <docidentifier type="IETF">IETF RFC 2616</docidentifier> <docidentifier type="rfc-anchor">RFC2616</docidentifier> <docidentifier type="DOI">DOI 10.17487/RFC2616</docidentifier> <date type="published"> <on>1999-06</on> </date> <contributor> <role type="author"/> <person> <name> <completename language="en">R. Fielding</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Gettys</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Mogul</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">H. Frystyk</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">L. Masinter</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">P. Leach</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">T. Berners-Lee</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <language>en</language> <script>Latn</script> <abstract format="text/plain" language="en" script="Latn">HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as “HTTP/1.1”, and is an update to RFC 2068. [STANDARDS-TRACK]</abstract> <series type="main"> <title format="text/plain" language="en" script="Latn">RFC</title> <number>2616</number> </series> <place>Fremont, CA</place></bibitem>
|
1673
|
+
</references></bibliography>
|
1674
|
+
</iso-standard>
|
1675
|
+
OUTPUT
|
1676
|
+
html = <<~OUTPUT
|
1677
|
+
#{HTML_HDR}
|
1678
|
+
<br/>
|
1679
|
+
<div>
|
1680
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
1681
|
+
<div class="permission" id='_' style='page-break-after: avoid;page-break-inside: avoid;'>
|
1682
|
+
<p class="RecommendationTitle">Permission 1:<br/>/ogc/recommendation/wfs/2</p>
|
1683
|
+
<p><i>Subject: user<br/>
|
1684
|
+
Inherits: /ss/584/2015/level/1
|
1685
|
+
<br/>
|
1686
|
+
Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
|
1687
|
+
<br/>Control-class: Technical<br/>Priority: P0<br/>Family: System and Communications Protection<br/>Family: System and Communications Protocols</i></p>
|
1688
|
+
<div class="requirement-description">
|
1689
|
+
<p id="_">I recommend <i>this</i>.</p>
|
1690
|
+
</div>
|
1691
|
+
<div class="requirement-description">
|
1692
|
+
<p id="_">As for the measurement targets,</p>
|
1693
|
+
</div>
|
1694
|
+
<div class="requirement-measurement-target">
|
1695
|
+
<p id="_">The measurement target shall be measured as:</p>
|
1696
|
+
<div id="_"><div class="formula"><p><span class="stem">(#(r/1 = 0)#)</span>  (1)</p></div></div>
|
1697
|
+
</div>
|
1698
|
+
<div class="requirement-verification">
|
1699
|
+
<p id="_">The following code will be run for verification:</p>
|
1700
|
+
<pre id="_" class="prettyprint ">CoreRoot(success): HttpResponse<br/>      if (success)<br/>      recommendation(label: success-response)<br/>      end<br/>    </pre>
|
1701
|
+
</div>
|
1966
1702
|
</div>
|
1967
|
-
|
1703
|
+
</div>
|
1704
|
+
<p class="zzSTDTitle1"/>
|
1705
|
+
<br/>
|
1706
|
+
<div>
|
1707
|
+
<h1 class='Section3'>Bibliography</h1>
|
1708
|
+
<p id='rfc2616' class='Biblio'>
|
1709
|
+
[1]  IETF RFC 2616,
|
1710
|
+
<i>Hypertext Transfer Protocol — HTTP/1.1</i>
|
1711
|
+
</p>
|
1712
|
+
</div>
|
1968
1713
|
</div>
|
1969
|
-
|
1970
|
-
|
1971
|
-
<div>
|
1972
|
-
<h1 class='Section3'>Bibliography</h1>
|
1973
|
-
<p id='rfc2616' class='Biblio'>
|
1974
|
-
[1]  IETF RFC 2616,
|
1975
|
-
<i>Hypertext Transfer Protocol — HTTP/1.1</i>
|
1976
|
-
</p>
|
1977
|
-
</div>
|
1978
|
-
</div>
|
1979
|
-
</body>
|
1980
|
-
</html>
|
1714
|
+
</body>
|
1715
|
+
</html>
|
1981
1716
|
OUTPUT
|
1717
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1718
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1982
1719
|
end
|
1983
1720
|
|
1984
1721
|
it "processes requirements (Presentation XML)" do
|
@@ -2035,7 +1772,7 @@ RSpec.describe IsoDoc do
|
|
2035
1772
|
<?xml version='1.0'?>
|
2036
1773
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
2037
1774
|
<preface>
|
2038
|
-
<foreword>
|
1775
|
+
<foreword displayorder="1">
|
2039
1776
|
<requirement id='A' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
|
2040
1777
|
<name>Requirement</name>
|
2041
1778
|
<title>A New Requirement</title>
|
@@ -2234,7 +1971,7 @@ RSpec.describe IsoDoc do
|
|
2234
1971
|
<language current="true">fr</language>
|
2235
1972
|
<script current="true">Latn</script>
|
2236
1973
|
</bibdata>
|
2237
|
-
<preface><foreword>
|
1974
|
+
<preface><foreword displayorder="1">
|
2238
1975
|
<requirement id="A" unnumbered="true"><name>Exigence</name>
|
2239
1976
|
<title>A New Requirement</title>
|
2240
1977
|
<label>/ogc/recommendation/wfs/2</label>
|
@@ -2400,7 +2137,7 @@ RSpec.describe IsoDoc do
|
|
2400
2137
|
<?xml version='1.0'?>
|
2401
2138
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
2402
2139
|
<preface>
|
2403
|
-
<foreword>
|
2140
|
+
<foreword displayorder="1">
|
2404
2141
|
<recommendation id='_' obligation='shall,could' keep-with-next='true' keep-lines-together='true'>
|
2405
2142
|
<name>Recommendation 1</name>
|
2406
2143
|
<label>/ogc/recommendation/wfs/2</label>
|
@@ -2563,7 +2300,7 @@ RSpec.describe IsoDoc do
|
|
2563
2300
|
<bibdata>
|
2564
2301
|
<language current="true">en</language>
|
2565
2302
|
</bibdata>
|
2566
|
-
<preface><foreword>
|
2303
|
+
<preface><foreword displayorder="1">
|
2567
2304
|
<figure id="_" class="pseudocode" keep-with-next="true" keep-lines-together="true"><name>Figure 1 — Label</name><p id="_">  <strong>A</strong><br/>
|
2568
2305
|
        <smallcap>B</smallcap></p>
|
2569
2306
|
<p id="_">  <em>C</em></p></figure>
|
@@ -2742,7 +2479,7 @@ RSpec.describe IsoDoc do
|
|
2742
2479
|
</figure>
|
2743
2480
|
</sections>
|
2744
2481
|
<bibliography>
|
2745
|
-
<references hidden='true' normative='false'>
|
2482
|
+
<references hidden='true' normative='false' displayorder="1">
|
2746
2483
|
<bibitem id='express_action_schema' type='internal'>
|
2747
2484
|
<docidentifier type='repository'>express/action_schema</docidentifier>
|
2748
2485
|
</bibitem>
|