metanorma-standoc 2.1.4 → 2.2.0.1
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/lib/metanorma/standoc/base.rb +1 -0
- data/lib/metanorma/standoc/blocks.rb +3 -7
- data/lib/metanorma/standoc/cleanup.rb +4 -2
- data/lib/metanorma/standoc/cleanup_biblio.rb +204 -0
- data/lib/metanorma/standoc/cleanup_block.rb +46 -4
- data/lib/metanorma/standoc/cleanup_maths.rb +2 -15
- data/lib/metanorma/standoc/cleanup_ref.rb +22 -13
- data/lib/metanorma/standoc/cleanup_reqt.rb +37 -4
- data/lib/metanorma/standoc/cleanup_symbols.rb +1 -1
- data/lib/metanorma/standoc/cleanup_terms.rb +6 -2
- data/lib/metanorma/standoc/cleanup_text.rb +10 -8
- data/lib/metanorma/standoc/cleanup_xref.rb +1 -2
- data/lib/metanorma/standoc/converter.rb +2 -0
- data/lib/metanorma/standoc/front.rb +1 -1
- data/lib/metanorma/standoc/inline.rb +8 -4
- data/lib/metanorma/standoc/isodoc.rng +16 -1
- data/lib/metanorma/standoc/macros.rb +1 -180
- data/lib/metanorma/standoc/macros_inline.rb +194 -0
- data/lib/metanorma/standoc/ref_sect.rb +2 -2
- data/lib/metanorma/standoc/ref_utility.rb +5 -6
- data/lib/metanorma/standoc/reqt.rb +5 -5
- data/lib/metanorma/standoc/reqt.rng +1 -1
- data/lib/metanorma/standoc/section.rb +2 -0
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +1 -1
- data/lib/metanorma/standoc/utils.rb +1 -1
- data/lib/metanorma/standoc/validate.rb +1 -69
- data/lib/metanorma/standoc/validate_table.rb +91 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +2 -3
- data/spec/metanorma/{refs_dl_spec.rb → biblio_spec.rb} +84 -1
- data/spec/metanorma/blocks_spec.rb +68 -8
- data/spec/metanorma/cleanup_blocks_spec.rb +107 -27
- data/spec/metanorma/inline_spec.rb +4 -0
- data/spec/metanorma/isobib_cache_spec.rb +6 -4
- data/spec/metanorma/macros_spec.rb +6 -2
- data/spec/metanorma/refs_spec.rb +261 -232
- data/spec/metanorma/validate_spec.rb +106 -7
- data/spec/vcr_cassettes/bsi16341.yml +63 -51
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +62 -62
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
- data/spec/vcr_cassettes/hide_refs.yml +58 -58
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +22 -22
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +33 -33
- data/spec/vcr_cassettes/isobib_get_123_2.yml +295 -0
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +11 -11
- data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +24 -30
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- data/spec/vcr_cassettes/std-link.yml +14 -72
- metadata +9 -6
- data/lib/metanorma/standoc/cleanup_ref_dl.rb +0 -113
@@ -0,0 +1,91 @@
|
|
1
|
+
module Metanorma
|
2
|
+
module Standoc
|
3
|
+
module Validate
|
4
|
+
def table_validate(doc)
|
5
|
+
doc.xpath("//table[colgroup]").each do |t|
|
6
|
+
maxrowcols_validate(t, t.xpath("./colgroup/col").size)
|
7
|
+
end
|
8
|
+
doc.xpath("//table[.//*[@colspan] | .//*[@rowspan]]").each do |t|
|
9
|
+
maxrowcols_validate(t, max_td_count(t), mode: "row_cols")
|
10
|
+
end
|
11
|
+
doc.xpath("//table[.//*[@rowspan]]").each do |t|
|
12
|
+
maxrowcols_validate(t, max_td_count(t), mode: "thead_row")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def max_td_count(table)
|
17
|
+
max = 0
|
18
|
+
table.xpath("./tr").each do |tr|
|
19
|
+
n = tr.xpath("./td | ./th").size
|
20
|
+
max < n and max = n
|
21
|
+
end
|
22
|
+
max
|
23
|
+
end
|
24
|
+
|
25
|
+
def maxrowcols_validate(table, maxcols, mode: "row_cols")
|
26
|
+
case mode
|
27
|
+
when "row_cols"
|
28
|
+
maxrowcols_validate0(table, maxcols, "*", mode)
|
29
|
+
when "thead_row"
|
30
|
+
%w{thead tbody tfoot}.each do |w|
|
31
|
+
maxrowcols_validate0(table, maxcols, w, mode)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def maxrowcols_validate0(table, maxcols, tablechild, mode)
|
37
|
+
cells2d = table.xpath("./#{tablechild}/tr")
|
38
|
+
.each_with_object([]) { |_r, m| m << {} }
|
39
|
+
table.xpath("./#{tablechild}/tr").each_with_index do |tr, r|
|
40
|
+
curr = 0
|
41
|
+
tr.xpath("./td | ./th").each do |td|
|
42
|
+
curr = maxcols_validate1(td, r, curr, cells2d, maxcols, mode)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
maxrows_validate(table, cells2d, tablechild, mode)
|
46
|
+
end
|
47
|
+
|
48
|
+
# code doesn't actually do anything, since Asciidoctor refuses to generate
|
49
|
+
# table with inconsistent column count
|
50
|
+
def maxcols_validate1(tcell, row, curr, cells2d, maxcols, mode)
|
51
|
+
rs = tcell&.attr("rowspan")&.to_i || 1
|
52
|
+
cs = tcell&.attr("colspan")&.to_i || 1
|
53
|
+
curr = table_tracker_update(cells2d, row, curr, rs, cs)
|
54
|
+
maxcols_check(curr + cs - 1, maxcols, tcell) if mode == "row_cols"
|
55
|
+
curr + cs
|
56
|
+
end
|
57
|
+
|
58
|
+
def table_tracker_update(cells2d, row, curr, rowspan, colspan)
|
59
|
+
cells2d[row] ||= {}
|
60
|
+
while cells2d[row][curr]
|
61
|
+
curr += 1
|
62
|
+
end
|
63
|
+
(row..(row + rowspan - 1)).each do |y2|
|
64
|
+
cells2d[y2] ||= {}
|
65
|
+
(curr..(curr + colspan - 1)).each { |x2| cells2d[y2][x2] = 1 }
|
66
|
+
end
|
67
|
+
curr
|
68
|
+
end
|
69
|
+
|
70
|
+
def maxrows_validate(table, cells2d, tablechild, mode)
|
71
|
+
err = "are inconsistent"
|
72
|
+
mode == "thead_row" and err = "cannot go outside #{tablechild}"
|
73
|
+
err = "Table rows in table #{err}: check rowspan"
|
74
|
+
if cells2d.any? { |x| x.size != cells2d.first.size }
|
75
|
+
@log.add("Table", table, err)
|
76
|
+
@fatalerror << err
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# if maxcols or maxrows negative, do not check them
|
81
|
+
def maxcols_check(col, maxcols, tcell)
|
82
|
+
if maxcols.positive? && col > maxcols
|
83
|
+
@log.add("Table", tcell, "Table exceeds maximum number of columns "\
|
84
|
+
"defined (#{maxcols})")
|
85
|
+
@fatalerror << "Table exceeds maximum number of columns defined "\
|
86
|
+
"(#{maxcols})"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
data/metanorma-standoc.gemspec
CHANGED
@@ -23,12 +23,11 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.bindir = "bin"
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
spec.files = `git ls-files`.split("\n")
|
26
|
-
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
27
26
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
28
27
|
|
29
28
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
30
29
|
spec.add_dependency "iev", "~> 0.3.0"
|
31
|
-
spec.add_dependency "isodoc", "~> 2.
|
30
|
+
spec.add_dependency "isodoc", "~> 2.2.0"
|
32
31
|
spec.add_dependency "metanorma-plugin-datastruct", "~> 0.2.0"
|
33
32
|
spec.add_dependency "metanorma-plugin-lutaml"
|
34
33
|
spec.add_dependency "ruby-jing"
|
@@ -55,5 +54,5 @@ Gem::Specification.new do |spec|
|
|
55
54
|
spec.add_development_dependency "timecop", "~> 0.9"
|
56
55
|
spec.add_development_dependency "vcr", "~> 6.1.0"
|
57
56
|
spec.add_development_dependency "webmock"
|
58
|
-
#spec.metadata["rubygems_mfa_required"] = "true"
|
57
|
+
# spec.metadata["rubygems_mfa_required"] = "true"
|
59
58
|
end
|
@@ -840,7 +840,7 @@ RSpec.describe Metanorma::Standoc do
|
|
840
840
|
|
841
841
|
INPUT
|
842
842
|
output = <<~OUTPUT
|
843
|
-
|
843
|
+
#{BLANK_HDR}
|
844
844
|
<sections>
|
845
845
|
<clause id='_' inline-header='false' obligation='normative'>
|
846
846
|
<title>Section</title>
|
@@ -888,4 +888,87 @@ RSpec.describe Metanorma::Standoc do
|
|
888
888
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
889
889
|
.to be_equivalent_to xmlpp(output)
|
890
890
|
end
|
891
|
+
|
892
|
+
it "processes microformatting of formatted references" do
|
893
|
+
input = <<~INPUT
|
894
|
+
#{ASCIIDOC_BLANK_HDR}
|
895
|
+
|
896
|
+
[bibliography]
|
897
|
+
=== Normative References
|
898
|
+
|
899
|
+
* [[[A, B]]], span:surname[Wozniak], span:initials[S.] & span:givenname[Steve] span:surname[Jobs]. span:pubyear[1996]. span:title[_Work_]. In span:surname.editor[Gates], span:initials.editor[W. H], Collected Essays. span:docid.ISO[ISO 1234]. span:pubplace[Geneva]: span:publisher[International Standardization Organization]. span:uri.citation[http://www.example.com]. span:type[inbook]
|
900
|
+
INPUT
|
901
|
+
output = <<~OUTPUT
|
902
|
+
#{BLANK_HDR}
|
903
|
+
<sections> </sections>
|
904
|
+
<bibliography>
|
905
|
+
<references id='_' normative='true' obligation='informative'>
|
906
|
+
<title>Normative references</title>
|
907
|
+
<p id='_'>
|
908
|
+
The following documents are referred to in the text in such a way that
|
909
|
+
some or all of their content constitutes requirements of this document.
|
910
|
+
For dated references, only the edition cited applies. For undated
|
911
|
+
references, the latest edition of the referenced document (including any
|
912
|
+
amendments) applies.
|
913
|
+
</p>
|
914
|
+
<bibitem id='A' type="inbook">
|
915
|
+
<formattedref format='application/x-isodoc+xml'>
|
916
|
+
Wozniak, S. & Steve Jobs. 1996.
|
917
|
+
<em>Work</em>
|
918
|
+
. In Gates, W. H, Collected Essays. ISO 1234. Geneva: International
|
919
|
+
Standardization Organization.
|
920
|
+
<link target='http://www.example.com'/>
|
921
|
+
.
|
922
|
+
</formattedref>
|
923
|
+
<title>
|
924
|
+
<em>Work</em>
|
925
|
+
</title>
|
926
|
+
<uri type='citation'>
|
927
|
+
<link target='http://www.example.com'/>
|
928
|
+
</uri>
|
929
|
+
<docidentifier>B</docidentifier>
|
930
|
+
<docidentifier type='ISO'>ISO 1234</docidentifier>
|
931
|
+
<date type='published'>1996</date>
|
932
|
+
<contributor>
|
933
|
+
<role type='author'/>
|
934
|
+
<person>
|
935
|
+
<name>
|
936
|
+
<initial>S.</initial>
|
937
|
+
<surname>Wozniak</surname>
|
938
|
+
</name>
|
939
|
+
</person>
|
940
|
+
</contributor>
|
941
|
+
<contributor>
|
942
|
+
<role type='author'/>
|
943
|
+
<person>
|
944
|
+
<name>
|
945
|
+
<forename>Steve</forename>
|
946
|
+
<surname>Jobs</surname>
|
947
|
+
</name>
|
948
|
+
</person>
|
949
|
+
</contributor>
|
950
|
+
<contributor>
|
951
|
+
<role type='editor'/>
|
952
|
+
<person>
|
953
|
+
<name>
|
954
|
+
<initial>W. H</initial>
|
955
|
+
<surname>Gates</surname>
|
956
|
+
</name>
|
957
|
+
</person>
|
958
|
+
</contributor>
|
959
|
+
<contributor>
|
960
|
+
<role type='publisher'/>
|
961
|
+
<organization>
|
962
|
+
<name>International Standardization Organization</name>
|
963
|
+
</organization>
|
964
|
+
</contributor>
|
965
|
+
<place/>
|
966
|
+
</bibitem>
|
967
|
+
</references>
|
968
|
+
</bibliography>
|
969
|
+
</standard-document>
|
970
|
+
OUTPUT
|
971
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
972
|
+
.to be_equivalent_to xmlpp(output)
|
973
|
+
end
|
891
974
|
end
|
@@ -764,7 +764,7 @@ RSpec.describe Metanorma::Standoc do
|
|
764
764
|
====
|
765
765
|
INPUT
|
766
766
|
output = <<~OUTPUT
|
767
|
-
|
767
|
+
#{BLANK_HDR}
|
768
768
|
<sections>
|
769
769
|
<clause id='_' inline-header='false' obligation='normative'>
|
770
770
|
<title>Clause</title>
|
@@ -940,6 +940,9 @@ RSpec.describe Metanorma::Standoc do
|
|
940
940
|
|
941
941
|
.Final stages: All kernels are fully gelatinized
|
942
942
|
image::spec/examples/rice_images/rice_image3_3.png[]
|
943
|
+
|
944
|
+
[%key]
|
945
|
+
A:: B
|
943
946
|
====
|
944
947
|
INPUT
|
945
948
|
output = <<~OUTPUT
|
@@ -956,7 +959,14 @@ RSpec.describe Metanorma::Standoc do
|
|
956
959
|
<figure id="_">
|
957
960
|
<name>Final stages: All kernels are fully gelatinized</name>
|
958
961
|
<image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
959
|
-
</figure
|
962
|
+
</figure>
|
963
|
+
<dl id='_' key='true'>
|
964
|
+
<dt>A</dt>
|
965
|
+
<dd>
|
966
|
+
<p id='_'>B</p>
|
967
|
+
</dd>
|
968
|
+
</dl>
|
969
|
+
</figure>
|
960
970
|
</sections>
|
961
971
|
</standard-document>
|
962
972
|
OUTPUT
|
@@ -1070,6 +1080,56 @@ RSpec.describe Metanorma::Standoc do
|
|
1070
1080
|
.to be_equivalent_to xmlpp(output)
|
1071
1081
|
end
|
1072
1082
|
|
1083
|
+
it "ignores index terms when processing figures marked up as examples" do
|
1084
|
+
input = <<~INPUT
|
1085
|
+
#{ASCIIDOC_BLANK_HDR}
|
1086
|
+
|
1087
|
+
====
|
1088
|
+
image::spec/examples/rice_images/rice_image3_1.png[]
|
1089
|
+
====
|
1090
|
+
|
1091
|
+
====
|
1092
|
+
((indexterm))
|
1093
|
+
|
1094
|
+
image::spec/examples/rice_images/rice_image3_3.png[]
|
1095
|
+
====
|
1096
|
+
|
1097
|
+
====
|
1098
|
+
(((indexterm2)))
|
1099
|
+
|
1100
|
+
image::spec/examples/rice_images/rice_image3_2.png[]
|
1101
|
+
====
|
1102
|
+
INPUT
|
1103
|
+
output = <<~OUTPUT
|
1104
|
+
#{BLANK_HDR}
|
1105
|
+
<sections>
|
1106
|
+
<figure id='_'>
|
1107
|
+
<image src='spec/examples/rice_images/rice_image3_1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1108
|
+
</figure>
|
1109
|
+
<example id='_'>
|
1110
|
+
<p id='_'>
|
1111
|
+
indexterm
|
1112
|
+
<index>
|
1113
|
+
<primary>indexterm</primary>
|
1114
|
+
</index>
|
1115
|
+
</p>
|
1116
|
+
<figure id='_'>
|
1117
|
+
<image src='spec/examples/rice_images/rice_image3_3.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1118
|
+
</figure>
|
1119
|
+
</example>
|
1120
|
+
<figure id='_'>
|
1121
|
+
<index>
|
1122
|
+
<primary>indexterm2</primary>
|
1123
|
+
</index>
|
1124
|
+
<image src='spec/examples/rice_images/rice_image3_2.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1125
|
+
</figure>
|
1126
|
+
</sections>
|
1127
|
+
</standard-document>
|
1128
|
+
OUTPUT
|
1129
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1130
|
+
.to be_equivalent_to xmlpp(output)
|
1131
|
+
end
|
1132
|
+
|
1073
1133
|
it "processes images" do
|
1074
1134
|
input = <<~INPUT
|
1075
1135
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1559,7 +1619,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1559
1619
|
it "processes recommendation" do
|
1560
1620
|
input = <<~"INPUT"
|
1561
1621
|
#{ASCIIDOC_BLANK_HDR}
|
1562
|
-
[.recommendation,
|
1622
|
+
[.recommendation,identifier="/ogc/recommendation/wfs/2",subject="user;developer, implementer",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc,tag=X,multilingual-rendering=common]
|
1563
1623
|
====
|
1564
1624
|
I recommend this
|
1565
1625
|
====
|
@@ -1568,7 +1628,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1568
1628
|
#{BLANK_HDR}
|
1569
1629
|
<sections>
|
1570
1630
|
<recommendation id="_" unnumbered="true" type="verification" model="ogc" tag='X' multilingual-rendering='common'>
|
1571
|
-
<
|
1631
|
+
<identifier>/ogc/recommendation/wfs/2</identifier>
|
1572
1632
|
<subject>user</subject>
|
1573
1633
|
<subject>developer, implementer</subject>
|
1574
1634
|
<inherit>/ss/584/2015/level/1</inherit>
|
@@ -1669,7 +1729,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1669
1729
|
. List
|
1670
1730
|
=====
|
1671
1731
|
|
1672
|
-
[requirement,type="general",
|
1732
|
+
[requirement,type="general",identifier="/req/core/quantities-uom"]
|
1673
1733
|
======
|
1674
1734
|
======
|
1675
1735
|
====
|
@@ -1694,7 +1754,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1694
1754
|
</description>
|
1695
1755
|
</permission>
|
1696
1756
|
<requirement id='_' type='general'>
|
1697
|
-
<
|
1757
|
+
<identifier>/req/core/quantities-uom</identifier>
|
1698
1758
|
</requirement>
|
1699
1759
|
</permission>
|
1700
1760
|
</sections>
|
@@ -1710,7 +1770,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1710
1770
|
#{ASCIIDOC_BLANK_HDR}
|
1711
1771
|
|
1712
1772
|
[[ABC]]
|
1713
|
-
[.recommendation,
|
1773
|
+
[.recommendation,identifier="/ogc/recommendation/wfs/2",subject="user",classification="control-class:Technical;priority:P0;family:System & Communications Protection,System and Communications Protocols",obligation="permission,recommendation",filename="reqt1.rq"]
|
1714
1774
|
====
|
1715
1775
|
I recommend _this_.
|
1716
1776
|
|
@@ -1769,7 +1829,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1769
1829
|
output = <<~"OUTPUT"
|
1770
1830
|
#{BLANK_HDR}
|
1771
1831
|
<sections>
|
1772
|
-
<recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><
|
1832
|
+
<recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><identifier>/ogc/recommendation/wfs/2</identifier><subject>user</subject>
|
1773
1833
|
<classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System & Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
|
1774
1834
|
<description><p id="_">I recommend <em>this</em>.</p>
|
1775
1835
|
</description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td valign="top" align="left">Object</td> <td valign="top" align="left">Value</td> </tr> <tr> <td valign="top" align="left">Mission</td> <td valign="top" align="left">Accomplished</td> </tr> </tbody></table></specification><description>
|
@@ -803,7 +803,7 @@ RSpec.describe Metanorma::Standoc do
|
|
803
803
|
[%metadata]
|
804
804
|
model:: ogc
|
805
805
|
type:: class
|
806
|
-
|
806
|
+
identifier:: http://www.opengis.net/spec/waterml/2.0/req/xsd-xml-rules[*req/core*]
|
807
807
|
subject:: Encoding of logical models
|
808
808
|
inherit:: urn:iso:dis:iso:19156:clause:7.2.2
|
809
809
|
inherit:: urn:iso:dis:iso:19156:clause:8
|
@@ -812,6 +812,7 @@ RSpec.describe Metanorma::Standoc do
|
|
812
812
|
inherit:: http://www.opengis.net/spec/SWE/2.0/req/core/core-concepts-used
|
813
813
|
inherit:: <<ref2>>
|
814
814
|
inherit:: <<ref3>>
|
815
|
+
target:: http://www.example.com
|
815
816
|
classification:: priority:P0
|
816
817
|
classification:: domain:Hydrology,Groundwater
|
817
818
|
classification:: control-class:Technical
|
@@ -826,22 +827,14 @@ RSpec.describe Metanorma::Standoc do
|
|
826
827
|
<clause id='_' inline-header='false' obligation='normative'>
|
827
828
|
<title>Clause</title>
|
828
829
|
<requirement id='_' subsequence='A' obligation='recommendation,requirement' model='ogc' type='class'>
|
829
|
-
<
|
830
|
-
<link target='http://www.opengis.net/spec/waterml/2.0/req/xsd-xml-rules'>
|
831
|
-
<strong>req/core</strong>
|
832
|
-
</link>
|
833
|
-
</label>
|
830
|
+
<identifier>http://www.opengis.net/spec/waterml/2.0/req/xsd-xml-rules</identifier>
|
834
831
|
<subject>Encoding of logical models</subject>
|
835
832
|
<inherit>/ss/584/2015/level/1 & /ss/584/2015/level/2</inherit>
|
836
833
|
<inherit>urn:iso:dis:iso:19156:clause:7.2.2</inherit>
|
837
834
|
<inherit>urn:iso:dis:iso:19156:clause:8</inherit>
|
838
|
-
<inherit>
|
839
|
-
<link target='http://www.opengis.net/doc/IS/GML/3.2/clause/2.4'/>
|
840
|
-
</inherit>
|
835
|
+
<inherit>http://www.opengis.net/doc/IS/GML/3.2/clause/2.4</inherit>
|
841
836
|
<inherit>O&M Abstract model, OGC 10-004r3, clause D.3.4</inherit>
|
842
|
-
<inherit>
|
843
|
-
<link target='http://www.opengis.net/spec/SWE/2.0/req/core/core-concepts-used'/>
|
844
|
-
</inherit>
|
837
|
+
<inherit>http://www.opengis.net/spec/SWE/2.0/req/core/core-concepts-used</inherit>
|
845
838
|
<inherit>
|
846
839
|
<xref target='ref2'/>
|
847
840
|
</inherit>
|
@@ -849,21 +842,25 @@ RSpec.describe Metanorma::Standoc do
|
|
849
842
|
<xref target='ref3'/>
|
850
843
|
</inherit>
|
851
844
|
<classification>
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
845
|
+
<tag>priority</tag>
|
846
|
+
<value>P0</value>
|
847
|
+
</classification>
|
848
|
+
<classification>
|
849
|
+
<tag>domain</tag>
|
850
|
+
<value>Hydrology</value>
|
851
|
+
</classification>
|
852
|
+
<classification>
|
853
|
+
<tag>domain</tag>
|
854
|
+
<value>Groundwater</value>
|
855
|
+
</classification>
|
856
|
+
<classification>
|
857
|
+
<tag>control-class</tag>
|
858
|
+
<value>Technical</value>
|
859
|
+
</classification>
|
860
|
+
<classification>
|
861
|
+
<tag>target</tag>
|
862
|
+
<value><link target='http://www.example.com'/></value>
|
863
|
+
</classification>
|
867
864
|
<description>
|
868
865
|
<p id='_'>I recommend this</p>
|
869
866
|
</description>
|
@@ -1184,4 +1181,87 @@ RSpec.describe Metanorma::Standoc do
|
|
1184
1181
|
.gsub(%r{<style.*?</style>}m, "<style/>")))
|
1185
1182
|
.to be_equivalent_to xmlpp(output)
|
1186
1183
|
end
|
1184
|
+
|
1185
|
+
it "removes paras with indexterms" do
|
1186
|
+
input = <<~INPUT
|
1187
|
+
#{ASCIIDOC_BLANK_HDR}
|
1188
|
+
|
1189
|
+
== Clause 1
|
1190
|
+
|
1191
|
+
Paragraph
|
1192
|
+
|
1193
|
+
(((index)))
|
1194
|
+
|
1195
|
+
[NOTE]
|
1196
|
+
--
|
1197
|
+
|
1198
|
+
(((index)))
|
1199
|
+
|
1200
|
+
Note
|
1201
|
+
--
|
1202
|
+
|
1203
|
+
[NOTE]
|
1204
|
+
--
|
1205
|
+
|
1206
|
+
(((index)))
|
1207
|
+
|
1208
|
+
--
|
1209
|
+
|
1210
|
+
== Clause 2
|
1211
|
+
|
1212
|
+
Paragraph
|
1213
|
+
|
1214
|
+
((index))
|
1215
|
+
|
1216
|
+
INPUT
|
1217
|
+
|
1218
|
+
output = <<~OUTPUT
|
1219
|
+
#{BLANK_HDR}
|
1220
|
+
<sections>
|
1221
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1222
|
+
<title>Clause 1</title>
|
1223
|
+
<p id='_'>
|
1224
|
+
Paragraph
|
1225
|
+
<index>
|
1226
|
+
<primary>index</primary>
|
1227
|
+
</index>
|
1228
|
+
</p>
|
1229
|
+
<note id='_'>
|
1230
|
+
<p id='_'>
|
1231
|
+
<index>
|
1232
|
+
<primary>index</primary>
|
1233
|
+
</index>
|
1234
|
+
Note
|
1235
|
+
</p>
|
1236
|
+
</note>
|
1237
|
+
<note id='_'>
|
1238
|
+
<p id='_'>
|
1239
|
+
<index>
|
1240
|
+
<primary>index</primary>
|
1241
|
+
</index>
|
1242
|
+
</p>
|
1243
|
+
</note>
|
1244
|
+
</clause>
|
1245
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1246
|
+
<title>Clause 2</title>
|
1247
|
+
<p id='_'>Paragraph</p>
|
1248
|
+
<p id='_'>
|
1249
|
+
index
|
1250
|
+
<index>
|
1251
|
+
<primary>index</primary>
|
1252
|
+
</index>
|
1253
|
+
</p>
|
1254
|
+
</clause>
|
1255
|
+
</sections>
|
1256
|
+
</standard-document>
|
1257
|
+
OUTPUT
|
1258
|
+
xml = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
1259
|
+
xml.xpath("//*[local-name() = 'image']").each do |x|
|
1260
|
+
x.replace("<image/>")
|
1261
|
+
end
|
1262
|
+
expect(xmlpp(strip_guid(xml.to_xml)
|
1263
|
+
.gsub(%r{<style.*?</style>}m, "<style/>")))
|
1264
|
+
.to be_equivalent_to xmlpp(output)
|
1265
|
+
end
|
1266
|
+
|
1187
1267
|
end
|
@@ -59,6 +59,8 @@ RSpec.describe Metanorma::Standoc do
|
|
59
59
|
[underline]#underline#
|
60
60
|
[smallcap]#smallcap#
|
61
61
|
[keyword]#keyword#
|
62
|
+
[css font-family:"Noto Sans JP"]#text#
|
63
|
+
[css font-family:'Noto Sans JP']#text#
|
62
64
|
INPUT
|
63
65
|
output = <<~OUTPUT
|
64
66
|
#{BLANK_HDR}
|
@@ -80,6 +82,8 @@ RSpec.describe Metanorma::Standoc do
|
|
80
82
|
<underline>underline</underline>
|
81
83
|
<smallcap>smallcap</smallcap>
|
82
84
|
<keyword>keyword</keyword>
|
85
|
+
<span style="font-family:"Noto Sans JP"">text</span>
|
86
|
+
<span style="font-family:'Noto Sans JP'">text</span>
|
83
87
|
</sections>
|
84
88
|
</standard-document>
|
85
89
|
OUTPUT
|
@@ -50,7 +50,7 @@ ISO_124_DATED = <<~XML.freeze
|
|
50
50
|
<uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
|
51
51
|
<uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
|
52
52
|
<docidentifier type="ISO" primary="true">ISO 124:2014</docidentifier>
|
53
|
-
<docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7
|
53
|
+
<docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7</docidentifier>
|
54
54
|
<docnumber>124</docnumber>
|
55
55
|
<date type="published">
|
56
56
|
<on>2014-03</on>
|
@@ -82,6 +82,7 @@ ISO_124_DATED = <<~XML.freeze
|
|
82
82
|
<relation type="obsoletes">
|
83
83
|
<bibitem type="standard">
|
84
84
|
<formattedref format="text/plain">ISO 124:2011</formattedref>
|
85
|
+
<docidentifier type='ISO' primary='true'>ISO 124:2011</docidentifier>
|
85
86
|
</bibitem>
|
86
87
|
</relation>
|
87
88
|
<place>Geneva</place>
|
@@ -95,7 +96,7 @@ ISO_124_DATED = <<~XML.freeze
|
|
95
96
|
<text>Latex and raw rubber</text>
|
96
97
|
</ics>
|
97
98
|
<structuredidentifier type="ISO">
|
98
|
-
<project-number
|
99
|
+
<project-number>ISO 124</project-number>
|
99
100
|
</structuredidentifier>
|
100
101
|
</ext>
|
101
102
|
</bibdata>
|
@@ -209,7 +210,7 @@ ISO_123_DATED = <<~XML.freeze
|
|
209
210
|
<uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
|
210
211
|
<uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
|
211
212
|
<docidentifier type="ISO" primary="true">ISO 123:2001</docidentifier>
|
212
|
-
<docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3
|
213
|
+
<docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3</docidentifier>
|
213
214
|
<docnumber>123</docnumber>
|
214
215
|
<date type="published">
|
215
216
|
<on>2001-05</on>
|
@@ -247,6 +248,7 @@ ISO_123_DATED = <<~XML.freeze
|
|
247
248
|
<relation type="obsoletes">
|
248
249
|
<bibitem type="standard">
|
249
250
|
<formattedref format="text/plain">ISO 123:1985</formattedref>
|
251
|
+
<docidentifier type='ISO' primary='true'>ISO 123:1985</docidentifier>
|
250
252
|
</bibitem>
|
251
253
|
</relation>
|
252
254
|
<place>Geneva</place>
|
@@ -260,7 +262,7 @@ ISO_123_DATED = <<~XML.freeze
|
|
260
262
|
<text>Latex and raw rubber</text>
|
261
263
|
</ics>
|
262
264
|
<structuredidentifier type="ISO">
|
263
|
-
<project-number
|
265
|
+
<project-number>ISO 123</project-number>
|
264
266
|
</structuredidentifier>
|
265
267
|
</ext>
|
266
268
|
</bibdata>
|
@@ -13,6 +13,7 @@ RSpec.describe Metanorma::Standoc do
|
|
13
13
|
autonumber:table[3]
|
14
14
|
add:[a <<clause>>] del:[B]
|
15
15
|
identifier:[a http://example.com]
|
16
|
+
span:category[text]
|
16
17
|
|
17
18
|
[bibliography]
|
18
19
|
== Bibliography
|
@@ -38,6 +39,7 @@ RSpec.describe Metanorma::Standoc do
|
|
38
39
|
</add>
|
39
40
|
<del>B</del>
|
40
41
|
<identifier>a http://example.com</identifier>
|
42
|
+
<span class='category'>text</span>
|
41
43
|
</foreword>
|
42
44
|
</preface>
|
43
45
|
<sections> </sections>
|
@@ -1706,7 +1708,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1706
1708
|
<uri type='src'>https://www.iso.org/standard/3944.html</uri>
|
1707
1709
|
<uri type='rss'>https://www.iso.org/contents/data/standard/00/39/3944.detail.rss</uri>
|
1708
1710
|
<docidentifier type='ISO' primary='true'>ISO 131</docidentifier>
|
1709
|
-
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1
|
1711
|
+
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1</docidentifier>
|
1710
1712
|
<docnumber>131</docnumber>
|
1711
1713
|
<contributor>
|
1712
1714
|
<role type='publisher'/>
|
@@ -1734,6 +1736,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1734
1736
|
<relation type='obsoletes'>
|
1735
1737
|
<bibitem type='standard'>
|
1736
1738
|
<formattedref format='text/plain'>ISO/R 357:1963</formattedref>
|
1739
|
+
<docidentifier type='ISO' primary='true'>ISO/R 357:1963</docidentifier>
|
1737
1740
|
</bibitem>
|
1738
1741
|
</relation>
|
1739
1742
|
<relation type='instance'>
|
@@ -1748,7 +1751,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1748
1751
|
<uri type='src'>https://www.iso.org/standard/3944.html</uri>
|
1749
1752
|
<uri type='rss'>https://www.iso.org/contents/data/standard/00/39/3944.detail.rss</uri>
|
1750
1753
|
<docidentifier type='ISO' primary='true'>ISO 131:1979</docidentifier>
|
1751
|
-
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1
|
1754
|
+
<docidentifier type='URN'>urn:iso:std:iso:131:stage-95.99:ed-1</docidentifier>
|
1752
1755
|
<docnumber>131</docnumber>
|
1753
1756
|
<date type='published'>
|
1754
1757
|
<on>1979-11</on>
|
@@ -1779,6 +1782,7 @@ RSpec.describe Metanorma::Standoc do
|
|
1779
1782
|
<relation type='obsoletes'>
|
1780
1783
|
<bibitem type='standard'>
|
1781
1784
|
<formattedref format='text/plain'>ISO/R 357:1963</formattedref>
|
1785
|
+
<docidentifier type='ISO' primary='true'>ISO/R 357:1963</docidentifier>
|
1782
1786
|
</bibitem>
|
1783
1787
|
</relation>
|
1784
1788
|
<place>Geneva</place>
|