metanorma-iec 1.2.16 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +7 -1
  4. data/lib/asciidoctor/iec/biblio.rng +5 -6
  5. data/lib/asciidoctor/iec/front.rb +11 -5
  6. data/lib/asciidoctor/iec/iec_intro_en.xml +1 -1
  7. data/lib/asciidoctor/iec/isodoc.rng +305 -4
  8. data/lib/asciidoctor/iec/isostandard.rng +1 -0
  9. data/lib/isodoc/iec/html/htmlstyle.css +7 -0
  10. data/lib/isodoc/iec/html_convert.rb +0 -1
  11. data/lib/isodoc/iec/iec.international-standard.xsl +462 -61
  12. data/lib/metanorma/iec/version.rb +1 -1
  13. data/metanorma-iec.gemspec +5 -5
  14. data/spec/asciidoctor/base_spec.rb +1062 -0
  15. data/spec/{asciidoctor-iec → asciidoctor}/blocks_spec.rb +214 -154
  16. data/spec/{asciidoctor-iec → asciidoctor}/cleanup_spec.rb +0 -0
  17. data/spec/{asciidoctor-iec → asciidoctor}/iev_spec.rb +0 -0
  18. data/spec/{asciidoctor-iec → asciidoctor}/inline_spec.rb +0 -0
  19. data/spec/{asciidoctor-iec → asciidoctor}/lists_spec.rb +0 -0
  20. data/spec/{asciidoctor-iec → asciidoctor}/section_spec.rb +0 -38
  21. data/spec/{asciidoctor-iec → asciidoctor}/validate_spec.rb +0 -0
  22. data/spec/isodoc/postproc_spec.rb +2 -20
  23. metadata +48 -57
  24. data/spec/asciidoctor-iec/base_spec.rb +0 -1045
  25. data/spec/examples/rice.adoc +0 -723
  26. data/spec/examples/rice.doc +0 -19162
  27. data/spec/examples/rice.html +0 -1787
  28. data/spec/examples/rice.xml +0 -1951
  29. data/spec/examples/rice_img/rice_image1.png +0 -0
  30. data/spec/examples/rice_img/rice_image2.png +0 -0
  31. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  32. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  33. data/spec/examples/rice_img/rice_image3_3.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f08c3f37c821f3bd1cb589899e6fc5a240cedea8314df63683c0983476c7d675
4
- data.tar.gz: 481dd653b8771e900a9c073612920e61e62b9f7b2f985c1bdfd8a71cdd99100a
3
+ metadata.gz: 4a24900a199a0791b4bb2358674e8b34b109c9d8953b656f0d6662c9f8fd0466
4
+ data.tar.gz: b5db833a6cc328ff262ae38411438ca4549d36dacd74bb7ec14695183b41afec
5
5
  SHA512:
6
- metadata.gz: 0c31775a8855a6841150ede2338969ac8d95aa99c930aebc00bc78c0ddf421082b0231a2cf17b53783099033c0f4d0aee510efeeda3da0057dc731927d90c3ef
7
- data.tar.gz: e627ac800e2b2471f559d9f43354524293983477276ddb34e22b37e99a58bfbc8d7bc84b27d58b372a7009d277ad6bce4442b94faaa2d93c4021eb52d9661154
6
+ metadata.gz: 7c7741d485f92f29adc57dfac10b8d842db1fab885f5f220fdcd216644ee78831ea9feee2fa3d028f612e78e44c1bccf074aaeed96fcf237462e4ef0c7621364
7
+ data.tar.gz: 94b6790578314e2bf8fc68c77241a14b4ac68f8bbffa69706593f6345b82ccc9766ac6b80f7931c97c7ed3c5003bd309644863706eef6308ac8cdfe08b8e8852
data/.gitignore CHANGED
@@ -2,3 +2,5 @@
2
2
  .byebug_history
3
3
  .rspec_status
4
4
  coverage/
5
+
6
+ .rubocop-https--*
data/.rubocop.yml CHANGED
@@ -1,6 +1,12 @@
1
1
  # This project follows the Ribose OSS style guide.
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
-
5
4
  inherit_from:
6
5
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
+
7
+ # local repo-specific modifications
8
+
9
+ AllCops:
10
+ DisplayCopNames: false
11
+ StyleGuideCopsOnly: false
12
+ TargetRubyVersion: 2.4
@@ -124,7 +124,7 @@
124
124
  <value>application/tei+xml</value>
125
125
  <value>text/x-asciidoc</value>
126
126
  <value>text/markdown</value>
127
- <value>application/x-isodoc+xml</value>
127
+ <value>application/x-metanorma+xml</value>
128
128
  <text/>
129
129
  </choice>
130
130
  </attribute>
@@ -452,6 +452,7 @@
452
452
  <attribute name="type">
453
453
  <choice>
454
454
  <value>isni</value>
455
+ <value>orcid</value>
455
456
  <value>uri</value>
456
457
  </choice>
457
458
  </attribute>
@@ -461,10 +462,7 @@
461
462
  <define name="org-identifier">
462
463
  <element name="identifier">
463
464
  <attribute name="type">
464
- <choice>
465
- <value>orcid</value>
466
- <value>uri</value>
467
- </choice>
465
+ <data type="string" datatypeLibrary=""/>
468
466
  </attribute>
469
467
  <text/>
470
468
  </element>
@@ -789,6 +787,7 @@
789
787
  <value>adapted</value>
790
788
  <value>vote-started</value>
791
789
  <value>vote-ended</value>
790
+ <value>announced</value>
792
791
  </choice>
793
792
  </define>
794
793
  <define name="bdate">
@@ -1106,7 +1105,7 @@
1106
1105
  <value>complementOf</value>
1107
1106
  <value>obsoletes</value>
1108
1107
  <value>obsoletedBy</value>
1109
- <value>cited</value>
1108
+ <value>cites</value>
1110
1109
  <value>isCitedIn</value>
1111
1110
  </choice>
1112
1111
  </define>
@@ -6,7 +6,7 @@ module Asciidoctor
6
6
  csv_split(publishers)&.each do |p|
7
7
  xml.contributor do |c|
8
8
  c.role **{ type: "author" }
9
- c.organization { |a| organization(a, p, node, !node.attr("publisher")) }
9
+ c.organization { |a| organization(a, p, false, node, !node.attr("publisher")) }
10
10
  end
11
11
  end
12
12
  end
@@ -16,19 +16,21 @@ module Asciidoctor
16
16
  csv_split(publishers)&.each do |p|
17
17
  xml.contributor do |c|
18
18
  c.role **{ type: "publisher" }
19
- c.organization { |a| organization(a, p, node, !node.attr("publisher")) }
19
+ c.organization { |a| organization(a, p, true, node, !node.attr("publisher")) }
20
20
  end
21
21
  end
22
22
  end
23
23
 
24
24
  def metadata_copyright(node, xml)
25
- publishers = node.attr("copyright-holder") || node.attr("publisher") || "IEC"
25
+ publishers = node.attr("copyright-holder") || node.attr("publisher") ||
26
+ "IEC"
26
27
  csv_split(publishers)&.each do |p|
27
28
  xml.copyright do |c|
28
29
  c.from (node.attr("copyright-year") || Date.today.year)
29
30
  c.owner do |owner|
30
31
  owner.organization do |o|
31
- organization(o, p, node, !node.attr("copyright-holder") || node.attr("publisher"))
32
+ organization(o, p, true, node, !node.attr("copyright-holder") ||
33
+ node.attr("publisher"))
32
34
  end
33
35
  end
34
36
  end
@@ -37,6 +39,7 @@ module Asciidoctor
37
39
 
38
40
  def iso_id(node, xml)
39
41
  return unless node.attr("docnumber")
42
+
40
43
  part, subpart = node&.attr("partnumber")&.split(/-/)
41
44
  dn = add_id_parts(node.attr("docnumber"), part, subpart)
42
45
  dn = id_stage_prefix(dn, node, false)
@@ -111,6 +114,7 @@ module Asciidoctor
111
114
 
112
115
  def status_abbrev1(stage, substage, iter, doctype, draft)
113
116
  return "" unless stage
117
+
114
118
  abbr = STAGE_ABBRS.dig(stage, substage) || "??"
115
119
  if stage == "35" && substage == "92"
116
120
  iter = (iter.to_i + 1) % "02"
@@ -136,6 +140,7 @@ module Asciidoctor
136
140
 
137
141
  def stage_abbr(stage, substage)
138
142
  return "PPUB" if stage == "60"
143
+
139
144
  DOC_STAGE[stage.to_sym] || "??"
140
145
  end
141
146
 
@@ -188,7 +193,8 @@ module Asciidoctor
188
193
 
189
194
  def metadata_ext(node, xml)
190
195
  super
191
- a = node.attr("accessibility-color-inside") and xml.accessibility_color_inside a
196
+ a = node.attr("accessibility-color-inside") and
197
+ xml.accessibility_color_inside a
192
198
  a = node.attr("price-code") and xml.price_code a
193
199
  a = node.attr("cen-processing") and xml.cen_processing a
194
200
  a = node.attr("secretary") and xml.secretary a
@@ -50,7 +50,7 @@
50
50
  <license-statement>
51
51
  <clause>
52
52
  {% if stage_int < 50 %}
53
- <p>This document is still under study and subject to change. It should not be used for reference purposes.</p>
53
+ <p>This document is still under study and subject to change. It should not be used for reference purposes.
54
54
  until published as such.</p>
55
55
  {% endif %}
56
56
  {% if stage_int >= 50 %}
@@ -86,6 +86,35 @@
86
86
  <text/>
87
87
  </element>
88
88
  </define>
89
+ <define name="erefType">
90
+ <optional>
91
+ <attribute name="normative">
92
+ <data type="boolean"/>
93
+ </attribute>
94
+ </optional>
95
+ <attribute name="citeas"/>
96
+ <attribute name="type">
97
+ <ref name="ReferenceFormat"/>
98
+ </attribute>
99
+ <optional>
100
+ <attribute name="alt"/>
101
+ </optional>
102
+ <optional>
103
+ <attribute name="case">
104
+ <choice>
105
+ <value>capital</value>
106
+ <value>lowercase</value>
107
+ </choice>
108
+ </attribute>
109
+ </optional>
110
+ <optional>
111
+ <attribute name="droploc">
112
+ <data type="boolean"/>
113
+ </attribute>
114
+ </optional>
115
+ <ref name="CitationType"/>
116
+ <text/>
117
+ </define>
89
118
  <define name="ul">
90
119
  <element name="ul">
91
120
  <attribute name="id">
@@ -775,6 +804,90 @@
775
804
  <ref name="paragraph"/>
776
805
  </element>
777
806
  </define>
807
+ <define name="em">
808
+ <element name="em">
809
+ <zeroOrMore>
810
+ <choice>
811
+ <ref name="PureTextElement"/>
812
+ <ref name="stem"/>
813
+ <ref name="index"/>
814
+ </choice>
815
+ </zeroOrMore>
816
+ </element>
817
+ </define>
818
+ <define name="strong">
819
+ <element name="strong">
820
+ <zeroOrMore>
821
+ <choice>
822
+ <ref name="PureTextElement"/>
823
+ <ref name="stem"/>
824
+ <ref name="index"/>
825
+ </choice>
826
+ </zeroOrMore>
827
+ </element>
828
+ </define>
829
+ <define name="tt">
830
+ <element name="tt">
831
+ <zeroOrMore>
832
+ <choice>
833
+ <ref name="PureTextElement"/>
834
+ <ref name="index"/>
835
+ </choice>
836
+ </zeroOrMore>
837
+ </element>
838
+ </define>
839
+ <define name="keyword">
840
+ <element name="keyword">
841
+ <zeroOrMore>
842
+ <choice>
843
+ <ref name="PureTextElement"/>
844
+ <ref name="index"/>
845
+ </choice>
846
+ </zeroOrMore>
847
+ </element>
848
+ </define>
849
+ <define name="strike">
850
+ <element name="strike">
851
+ <zeroOrMore>
852
+ <choice>
853
+ <ref name="PureTextElement"/>
854
+ <ref name="index"/>
855
+ </choice>
856
+ </zeroOrMore>
857
+ </element>
858
+ </define>
859
+ <define name="underline">
860
+ <element name="underline">
861
+ <zeroOrMore>
862
+ <choice>
863
+ <ref name="PureTextElement"/>
864
+ <ref name="index"/>
865
+ </choice>
866
+ </zeroOrMore>
867
+ </element>
868
+ </define>
869
+ <define name="smallcap">
870
+ <element name="smallcap">
871
+ <zeroOrMore>
872
+ <choice>
873
+ <ref name="PureTextElement"/>
874
+ <ref name="index"/>
875
+ </choice>
876
+ </zeroOrMore>
877
+ </element>
878
+ </define>
879
+ <define name="pagebreak">
880
+ <element name="pagebreak">
881
+ <optional>
882
+ <attribute name="orientation">
883
+ <choice>
884
+ <value>landscape</value>
885
+ <value>portrait</value>
886
+ </choice>
887
+ </attribute>
888
+ </optional>
889
+ </element>
890
+ </define>
778
891
  </include>
779
892
  <!-- end overrides -->
780
893
  <define name="colgroup">
@@ -793,7 +906,35 @@
793
906
  <value>internal</value>
794
907
  </define>
795
908
  <define name="TextElement" combine="choice">
796
- <ref name="concept"/>
909
+ <choice>
910
+ <ref name="concept"/>
911
+ <ref name="add"/>
912
+ <ref name="del"/>
913
+ </choice>
914
+ </define>
915
+ <define name="add">
916
+ <element name="add">
917
+ <choice>
918
+ <ref name="PureTextElement"/>
919
+ <ref name="eref"/>
920
+ <ref name="stem"/>
921
+ <ref name="keyword"/>
922
+ <ref name="xref"/>
923
+ <ref name="hyperlink"/>
924
+ </choice>
925
+ </element>
926
+ </define>
927
+ <define name="del">
928
+ <element name="del">
929
+ <choice>
930
+ <ref name="PureTextElement"/>
931
+ <ref name="eref"/>
932
+ <ref name="stem"/>
933
+ <ref name="keyword"/>
934
+ <ref name="xref"/>
935
+ <ref name="hyperlink"/>
936
+ </choice>
937
+ </element>
797
938
  </define>
798
939
  <define name="concept">
799
940
  <element name="concept">
@@ -814,8 +955,170 @@
814
955
  <ref name="permission"/>
815
956
  <ref name="imagemap"/>
816
957
  <ref name="svgmap"/>
958
+ <ref name="inputform"/>
959
+ </choice>
960
+ </define>
961
+ <define name="inputform">
962
+ <element name="form">
963
+ <attribute name="id">
964
+ <data type="ID"/>
965
+ </attribute>
966
+ <attribute name="name"/>
967
+ <attribute name="action"/>
968
+ <zeroOrMore>
969
+ <choice>
970
+ <ref name="TextElement"/>
971
+ <ref name="FormInput"/>
972
+ </choice>
973
+ </zeroOrMore>
974
+ </element>
975
+ </define>
976
+ <define name="FormInput">
977
+ <choice>
978
+ <ref name="input"/>
979
+ <ref name="formlabel"/>
980
+ <ref name="select"/>
981
+ <ref name="textarea"/>
982
+ </choice>
983
+ </define>
984
+ <define name="InputType">
985
+ <choice>
986
+ <value>button</value>
987
+ <value>checkbox</value>
988
+ <value>date</value>
989
+ <value>file</value>
990
+ <value>password</value>
991
+ <value>radio</value>
992
+ <value>submit</value>
993
+ <value>text</value>
817
994
  </choice>
818
995
  </define>
996
+ <define name="input">
997
+ <element name="input">
998
+ <attribute name="type">
999
+ <ref name="InputType"/>
1000
+ </attribute>
1001
+ <optional>
1002
+ <attribute name="checked">
1003
+ <data type="boolean"/>
1004
+ </attribute>
1005
+ </optional>
1006
+ <optional>
1007
+ <attribute name="disabled">
1008
+ <data type="boolean"/>
1009
+ </attribute>
1010
+ </optional>
1011
+ <optional>
1012
+ <attribute name="readonly">
1013
+ <data type="boolean"/>
1014
+ </attribute>
1015
+ </optional>
1016
+ <optional>
1017
+ <attribute name="maxlength">
1018
+ <data type="int"/>
1019
+ </attribute>
1020
+ </optional>
1021
+ <optional>
1022
+ <attribute name="minlength">
1023
+ <data type="int"/>
1024
+ </attribute>
1025
+ </optional>
1026
+ <optional>
1027
+ <attribute name="name"/>
1028
+ </optional>
1029
+ <optional>
1030
+ <attribute name="value"/>
1031
+ </optional>
1032
+ <optional>
1033
+ <attribute name="id">
1034
+ <data type="ID"/>
1035
+ </attribute>
1036
+ </optional>
1037
+ </element>
1038
+ </define>
1039
+ <define name="formlabel">
1040
+ <element name="label">
1041
+ <attribute name="for">
1042
+ <data type="IDREF"/>
1043
+ </attribute>
1044
+ <zeroOrMore>
1045
+ <ref name="PureTextElement"/>
1046
+ </zeroOrMore>
1047
+ </element>
1048
+ </define>
1049
+ <define name="select">
1050
+ <element name="select">
1051
+ <optional>
1052
+ <attribute name="name"/>
1053
+ </optional>
1054
+ <optional>
1055
+ <attribute name="value"/>
1056
+ </optional>
1057
+ <optional>
1058
+ <attribute name="id">
1059
+ <data type="ID"/>
1060
+ </attribute>
1061
+ </optional>
1062
+ <optional>
1063
+ <attribute name="disabled">
1064
+ <data type="boolean"/>
1065
+ </attribute>
1066
+ </optional>
1067
+ <optional>
1068
+ <attribute name="multiple">
1069
+ <data type="boolean"/>
1070
+ </attribute>
1071
+ </optional>
1072
+ <optional>
1073
+ <attribute name="size">
1074
+ <data type="int"/>
1075
+ </attribute>
1076
+ </optional>
1077
+ <oneOrMore>
1078
+ <ref name="option"/>
1079
+ </oneOrMore>
1080
+ </element>
1081
+ </define>
1082
+ <define name="option">
1083
+ <element name="option">
1084
+ <optional>
1085
+ <attribute name="disabled">
1086
+ <data type="boolean"/>
1087
+ </attribute>
1088
+ </optional>
1089
+ <optional>
1090
+ <attribute name="value"/>
1091
+ </optional>
1092
+ <zeroOrMore>
1093
+ <ref name="PureTextElement"/>
1094
+ </zeroOrMore>
1095
+ </element>
1096
+ </define>
1097
+ <define name="textarea">
1098
+ <element name="textarea">
1099
+ <optional>
1100
+ <attribute name="name"/>
1101
+ </optional>
1102
+ <optional>
1103
+ <attribute name="value"/>
1104
+ </optional>
1105
+ <optional>
1106
+ <attribute name="id">
1107
+ <data type="ID"/>
1108
+ </attribute>
1109
+ </optional>
1110
+ <optional>
1111
+ <attribute name="rows">
1112
+ <data type="int"/>
1113
+ </attribute>
1114
+ </optional>
1115
+ <optional>
1116
+ <attribute name="cols">
1117
+ <data type="int"/>
1118
+ </attribute>
1119
+ </optional>
1120
+ </element>
1121
+ </define>
819
1122
  <define name="bibliography">
820
1123
  <element name="bibliography">
821
1124
  <oneOrMore>
@@ -888,9 +1191,7 @@
888
1191
  </define>
889
1192
  <define name="IsoWorkgroup">
890
1193
  <optional>
891
- <attribute name="number">
892
- <data type="int"/>
893
- </attribute>
1194
+ <attribute name="number"/>
894
1195
  </optional>
895
1196
  <optional>
896
1197
  <attribute name="type"/>