metanorma-iso 1.7.2 → 1.8.2
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 +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +7 -1
- data/lib/asciidoctor/iso/base.rb +14 -11
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +40 -24
- data/lib/asciidoctor/iso/front.rb +29 -17
- data/lib/asciidoctor/iso/front_id.rb +81 -60
- data/lib/asciidoctor/iso/isodoc.rng +327 -2
- data/lib/asciidoctor/iso/isostandard.rng +12 -97
- data/lib/asciidoctor/iso/section.rb +2 -1
- data/lib/asciidoctor/iso/validate.rb +22 -109
- data/lib/asciidoctor/iso/validate_image.rb +97 -0
- data/lib/asciidoctor/iso/validate_requirements.rb +26 -20
- data/lib/asciidoctor/iso/validate_section.rb +39 -20
- data/lib/asciidoctor/iso/validate_style.rb +36 -24
- data/lib/asciidoctor/iso/validate_title.rb +23 -17
- data/lib/isodoc/iso/base_convert.rb +19 -2
- data/lib/isodoc/iso/html/style-human.css +7 -0
- data/lib/isodoc/iso/html/style-iso.css +7 -0
- data/lib/isodoc/iso/html_convert.rb +0 -1
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1157 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +1157 -208
- data/lib/isodoc/iso/metadata.rb +1 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +45 -37
- data/lib/isodoc/iso/sts_convert.rb +10 -13
- data/lib/isodoc/iso/word_convert.rb +0 -1
- data/lib/isodoc/iso/xref.rb +46 -25
- data/lib/metanorma/iso/processor.rb +1 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +8 -8
- data/spec/{asciidoctor-iso → asciidoctor}/amd_spec.rb +5 -5
- data/spec/asciidoctor/base_spec.rb +825 -0
- data/spec/{asciidoctor-iso → asciidoctor}/blocks_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/cleanup_spec.rb +383 -25
- data/spec/{asciidoctor-iso → asciidoctor}/inline_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/lists_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/refs_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/section_spec.rb +0 -14
- data/spec/{asciidoctor-iso → asciidoctor}/table_spec.rb +0 -0
- data/spec/{asciidoctor-iso → asciidoctor}/validate_spec.rb +188 -83
- data/spec/isodoc/postproc_spec.rb +481 -438
- data/spec/isodoc/section_spec.rb +219 -0
- data/spec/spec_helper.rb +2 -0
- metadata +65 -64
- data/lib/isodoc/iso/html/scripts.html +0 -178
- data/spec/asciidoctor-iso/base_spec.rb +0 -704
@@ -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">
|
@@ -102,7 +131,7 @@
|
|
102
131
|
</attribute>
|
103
132
|
</optional>
|
104
133
|
<oneOrMore>
|
105
|
-
<ref name="
|
134
|
+
<ref name="ul_li"/>
|
106
135
|
</oneOrMore>
|
107
136
|
<zeroOrMore>
|
108
137
|
<ref name="note"/>
|
@@ -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
|
-
<
|
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>
|
@@ -1716,4 +2019,26 @@
|
|
1716
2019
|
</zeroOrMore>
|
1717
2020
|
</element>
|
1718
2021
|
</define>
|
2022
|
+
<define name="ul_li">
|
2023
|
+
<element name="li">
|
2024
|
+
<optional>
|
2025
|
+
<attribute name="id">
|
2026
|
+
<data type="ID"/>
|
2027
|
+
</attribute>
|
2028
|
+
</optional>
|
2029
|
+
<optional>
|
2030
|
+
<attribute name="uncheckedcheckbox">
|
2031
|
+
<data type="boolean"/>
|
2032
|
+
</attribute>
|
2033
|
+
</optional>
|
2034
|
+
<optional>
|
2035
|
+
<attribute name="checkedcheckbox">
|
2036
|
+
<data type="boolean"/>
|
2037
|
+
</attribute>
|
2038
|
+
</optional>
|
2039
|
+
<oneOrMore>
|
2040
|
+
<ref name="BasicBlock"/>
|
2041
|
+
</oneOrMore>
|
2042
|
+
</element>
|
2043
|
+
</define>
|
1719
2044
|
</grammar>
|
@@ -79,19 +79,6 @@
|
|
79
79
|
</choice>
|
80
80
|
</element>
|
81
81
|
</define>
|
82
|
-
<define name="ul">
|
83
|
-
<element name="ul">
|
84
|
-
<attribute name="id">
|
85
|
-
<data type="ID"/>
|
86
|
-
</attribute>
|
87
|
-
<oneOrMore>
|
88
|
-
<ref name="ul_li"/>
|
89
|
-
</oneOrMore>
|
90
|
-
<zeroOrMore>
|
91
|
-
<ref name="note"/>
|
92
|
-
</zeroOrMore>
|
93
|
-
</element>
|
94
|
-
</define>
|
95
82
|
<define name="sections">
|
96
83
|
<element name="sections">
|
97
84
|
<zeroOrMore>
|
@@ -192,17 +179,6 @@
|
|
192
179
|
</zeroOrMore>
|
193
180
|
</element>
|
194
181
|
</define>
|
195
|
-
<define name="definition">
|
196
|
-
<element name="definition">
|
197
|
-
<oneOrMore>
|
198
|
-
<choice>
|
199
|
-
<ref name="paragraph"/>
|
200
|
-
<ref name="figure"/>
|
201
|
-
<ref name="formula"/>
|
202
|
-
</choice>
|
203
|
-
</oneOrMore>
|
204
|
-
</element>
|
205
|
-
</define>
|
206
182
|
<define name="annex">
|
207
183
|
<element name="annex">
|
208
184
|
<optional>
|
@@ -280,6 +256,7 @@
|
|
280
256
|
<value>guide</value>
|
281
257
|
<value>amendment</value>
|
282
258
|
<value>technical-corrigendum</value>
|
259
|
+
<value>directive</value>
|
283
260
|
</choice>
|
284
261
|
</define>
|
285
262
|
<define name="structuredidentifier">
|
@@ -333,6 +310,11 @@
|
|
333
310
|
<optional>
|
334
311
|
<attribute name="script"/>
|
335
312
|
</optional>
|
313
|
+
<optional>
|
314
|
+
<attribute name="inline-header">
|
315
|
+
<data type="boolean"/>
|
316
|
+
</attribute>
|
317
|
+
</optional>
|
336
318
|
<optional>
|
337
319
|
<attribute name="obligation">
|
338
320
|
<choice>
|
@@ -341,6 +323,12 @@
|
|
341
323
|
</choice>
|
342
324
|
</attribute>
|
343
325
|
</optional>
|
326
|
+
<optional>
|
327
|
+
<attribute name="number"/>
|
328
|
+
</optional>
|
329
|
+
<optional>
|
330
|
+
<attribute name="type"/>
|
331
|
+
</optional>
|
344
332
|
<optional>
|
345
333
|
<ref name="section-title"/>
|
346
334
|
</optional>
|
@@ -358,57 +346,6 @@
|
|
358
346
|
</oneOrMore>
|
359
347
|
</choice>
|
360
348
|
</define>
|
361
|
-
<define name="table">
|
362
|
-
<element name="table">
|
363
|
-
<attribute name="id">
|
364
|
-
<data type="ID"/>
|
365
|
-
</attribute>
|
366
|
-
<optional>
|
367
|
-
<attribute name="width"/>
|
368
|
-
</optional>
|
369
|
-
<optional>
|
370
|
-
<attribute name="unnumbered">
|
371
|
-
<data type="boolean"/>
|
372
|
-
</attribute>
|
373
|
-
</optional>
|
374
|
-
<optional>
|
375
|
-
<attribute name="number"/>
|
376
|
-
</optional>
|
377
|
-
<optional>
|
378
|
-
<attribute name="subsequence"/>
|
379
|
-
</optional>
|
380
|
-
<optional>
|
381
|
-
<attribute name="alt"/>
|
382
|
-
</optional>
|
383
|
-
<optional>
|
384
|
-
<attribute name="summary"/>
|
385
|
-
</optional>
|
386
|
-
<optional>
|
387
|
-
<attribute name="uri">
|
388
|
-
<data type="anyURI"/>
|
389
|
-
</attribute>
|
390
|
-
</optional>
|
391
|
-
<optional>
|
392
|
-
<ref name="colgroup"/>
|
393
|
-
</optional>
|
394
|
-
<optional>
|
395
|
-
<ref name="tname"/>
|
396
|
-
</optional>
|
397
|
-
<optional>
|
398
|
-
<ref name="thead"/>
|
399
|
-
</optional>
|
400
|
-
<ref name="tbody"/>
|
401
|
-
<optional>
|
402
|
-
<ref name="tfoot"/>
|
403
|
-
</optional>
|
404
|
-
<zeroOrMore>
|
405
|
-
<ref name="table-note"/>
|
406
|
-
</zeroOrMore>
|
407
|
-
<optional>
|
408
|
-
<ref name="dl"/>
|
409
|
-
</optional>
|
410
|
-
</element>
|
411
|
-
</define>
|
412
349
|
</include>
|
413
350
|
<!-- end overrides -->
|
414
351
|
<!--
|
@@ -533,28 +470,6 @@
|
|
533
470
|
<ref name="Clause-Section"/>
|
534
471
|
</element>
|
535
472
|
</define>
|
536
|
-
<define name="ul_li">
|
537
|
-
<element name="li">
|
538
|
-
<optional>
|
539
|
-
<attribute name="id">
|
540
|
-
<data type="ID"/>
|
541
|
-
</attribute>
|
542
|
-
</optional>
|
543
|
-
<optional>
|
544
|
-
<attribute name="uncheckedcheckbox">
|
545
|
-
<data type="boolean"/>
|
546
|
-
</attribute>
|
547
|
-
</optional>
|
548
|
-
<optional>
|
549
|
-
<attribute name="checkedcheckbox">
|
550
|
-
<data type="boolean"/>
|
551
|
-
</attribute>
|
552
|
-
</optional>
|
553
|
-
<oneOrMore>
|
554
|
-
<ref name="BasicBlock"/>
|
555
|
-
</oneOrMore>
|
556
|
-
</element>
|
557
|
-
</define>
|
558
473
|
<define name="stagename">
|
559
474
|
<element name="stagename">
|
560
475
|
<text/>
|