metanorma-iso 2.0.7 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/iso/base.rb +0 -1
  3. data/lib/asciidoctor/iso/cleanup.rb +0 -1
  4. data/lib/asciidoctor/iso/converter.rb +0 -1
  5. data/lib/asciidoctor/iso/deprecated.rb +4 -2
  6. data/lib/asciidoctor/iso/front.rb +0 -1
  7. data/lib/asciidoctor/iso/front_id.rb +0 -1
  8. data/lib/asciidoctor/iso/section.rb +0 -1
  9. data/lib/asciidoctor/iso/validate.rb +0 -1
  10. data/lib/asciidoctor/iso/validate_image.rb +0 -1
  11. data/lib/asciidoctor/iso/validate_requirements.rb +0 -1
  12. data/lib/asciidoctor/iso/validate_section.rb +0 -1
  13. data/lib/asciidoctor/iso/validate_style.rb +0 -1
  14. data/lib/asciidoctor/iso/validate_title.rb +0 -1
  15. data/lib/html2doc/lists.rb +37 -0
  16. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -2
  17. data/lib/isodoc/iso/html/isodoc-dis.css +196 -156
  18. data/lib/isodoc/iso/html/isodoc-dis.scss +193 -156
  19. data/lib/isodoc/iso/html/word_iso_intro-dis.html +7 -0
  20. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +3 -2
  21. data/lib/isodoc/iso/html/word_iso_titlepage.html +8 -2
  22. data/lib/isodoc/iso/html/wordstyle-dis.css +204 -34
  23. data/lib/isodoc/iso/html/wordstyle-dis.scss +198 -34
  24. data/lib/isodoc/iso/i18n-en.yaml +2 -1
  25. data/lib/isodoc/iso/i18n-fr.yaml +1 -0
  26. data/lib/isodoc/iso/i18n-ru.yaml +1 -0
  27. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  28. data/lib/isodoc/iso/index.rb +1 -1
  29. data/lib/isodoc/iso/init.rb +17 -1
  30. data/lib/isodoc/iso/iso.amendment.xsl +726 -299
  31. data/lib/isodoc/iso/iso.international-standard.xsl +726 -299
  32. data/lib/isodoc/iso/metadata.rb +75 -63
  33. data/lib/isodoc/iso/presentation_inline.rb +90 -0
  34. data/lib/isodoc/iso/presentation_xml_convert.rb +39 -100
  35. data/lib/isodoc/iso/presentation_xref.rb +126 -0
  36. data/lib/isodoc/iso/word_cleanup.rb +16 -2
  37. data/lib/isodoc/iso/word_convert.rb +27 -10
  38. data/lib/isodoc/iso/word_dis_convert.rb +174 -0
  39. data/lib/isodoc/iso/xref.rb +50 -30
  40. data/lib/metanorma/iso/biblio.rng +62 -10
  41. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  42. data/lib/metanorma/iso/boilerplate-ru.xml +1 -3
  43. data/lib/metanorma/iso/boilerplate.xml +1 -3
  44. data/lib/metanorma/iso/cleanup.rb +7 -6
  45. data/lib/metanorma/iso/front_id.rb +28 -11
  46. data/lib/metanorma/iso/isodoc.rng +56 -0
  47. data/lib/metanorma/iso/version.rb +1 -1
  48. data/lib/metanorma-iso.rb +1 -0
  49. data/lib/relaton/render/config.yml +4 -0
  50. data/lib/relaton/render/general.rb +13 -0
  51. data/metanorma-iso.gemspec +1 -1
  52. data/spec/isodoc/amd_spec.rb +15 -14
  53. data/spec/isodoc/blocks_spec.rb +286 -179
  54. data/spec/isodoc/i18n_spec.rb +296 -133
  55. data/spec/isodoc/inline_spec.rb +35 -42
  56. data/spec/isodoc/iso_spec.rb +43 -27
  57. data/spec/isodoc/postproc_spec.rb +25 -0
  58. data/spec/isodoc/ref_spec.rb +66 -69
  59. data/spec/isodoc/section_spec.rb +78 -76
  60. data/spec/isodoc/table_spec.rb +2 -2
  61. data/spec/isodoc/terms_spec.rb +2 -2
  62. data/spec/isodoc/word_dis_spec.rb +760 -0
  63. data/spec/isodoc/xref_spec.rb +51 -51
  64. data/spec/metanorma/amd_spec.rb +39 -16
  65. data/spec/metanorma/base_spec.rb +17 -9
  66. data/spec/metanorma/blocks_spec.rb +4 -4
  67. data/spec/metanorma/cleanup_spec.rb +11 -11
  68. data/spec/metanorma/section_spec.rb +3 -3
  69. data/spec/spec_helper.rb +5 -2
  70. data/spec/vcr_cassettes/withdrawn_iso.yml +26 -26
  71. metadata +11 -5
  72. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -32,6 +32,43 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="admonition">
36
+ <element name="admonition">
37
+ <attribute name="type">
38
+ <ref name="AdmonitionType"/>
39
+ </attribute>
40
+ <optional>
41
+ <attribute name="class"/>
42
+ </optional>
43
+ <attribute name="id">
44
+ <data type="ID"/>
45
+ </attribute>
46
+ <optional>
47
+ <attribute name="uri">
48
+ <data type="anyURI"/>
49
+ </attribute>
50
+ </optional>
51
+ <optional>
52
+ <attribute name="coverpage">
53
+ <data type="boolean"/>
54
+ </attribute>
55
+ </optional>
56
+ <optional>
57
+ <attribute name="notag">
58
+ <data type="boolean"/>
59
+ </attribute>
60
+ </optional>
61
+ <optional>
62
+ <ref name="tname"/>
63
+ </optional>
64
+ <zeroOrMore>
65
+ <ref name="paragraph-with-footnote"/>
66
+ </zeroOrMore>
67
+ <zeroOrMore>
68
+ <ref name="note"/>
69
+ </zeroOrMore>
70
+ </element>
71
+ </define>
35
72
  <define name="index">
36
73
  <element name="index">
37
74
  <optional>
@@ -851,6 +888,16 @@
851
888
  <ref name="MultilingualRenderingType"/>
852
889
  </attribute>
853
890
  </optional>
891
+ <optional>
892
+ <attribute name="coverpage">
893
+ <data type="boolean"/>
894
+ </attribute>
895
+ </optional>
896
+ <optional>
897
+ <attribute name="notag">
898
+ <data type="boolean"/>
899
+ </attribute>
900
+ </optional>
854
901
  <oneOrMore>
855
902
  <choice>
856
903
  <ref name="paragraph"/>
@@ -1178,6 +1225,7 @@
1178
1225
  <ref name="concept"/>
1179
1226
  <ref name="add"/>
1180
1227
  <ref name="del"/>
1228
+ <ref name="span"/>
1181
1229
  </choice>
1182
1230
  </define>
1183
1231
  <define name="add">
@@ -1204,6 +1252,14 @@
1204
1252
  </choice>
1205
1253
  </element>
1206
1254
  </define>
1255
+ <define name="span">
1256
+ <element name="span">
1257
+ <attribute name="class"/>
1258
+ <oneOrMore>
1259
+ <ref name="TextElement"/>
1260
+ </oneOrMore>
1261
+ </element>
1262
+ </define>
1207
1263
  <define name="concept">
1208
1264
  <element name="concept">
1209
1265
  <optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.0.7".freeze
3
+ VERSION = "2.1.0".freeze
4
4
  end
5
5
  end
data/lib/metanorma-iso.rb CHANGED
@@ -7,6 +7,7 @@ require_relative "isodoc/iso/pdf_convert"
7
7
  require_relative "isodoc/iso/sts_convert"
8
8
  require_relative "isodoc/iso/isosts_convert"
9
9
  require_relative "isodoc/iso/presentation_xml_convert"
10
+ require_relative "html2doc/lists"
10
11
  require "asciidoctor/extensions"
11
12
 
12
13
  if defined? Metanorma
@@ -0,0 +1,4 @@
1
+ template:
2
+ # skip standardidentifier, it is inserted in front of formattedref within metanorma
3
+ standard: "<em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }}."
4
+ website: "{{ creatornames }} ({{ role }}) . <em><span_class='stddocTitle'>{{ title }}</span></em> [website]. {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{ place }}: {{ publisher }}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ standardidentifier | first }}. {{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
@@ -0,0 +1,13 @@
1
+ require "relaton-render"
2
+
3
+ module Relaton
4
+ module Render
5
+ module Iso
6
+ class General < ::Relaton::Render::IsoDoc::General
7
+ def config_loc
8
+ YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
31
31
 
32
- spec.add_dependency "metanorma-standoc", "~> 2.0.0"
32
+ spec.add_dependency "metanorma-standoc", "~> 2.1.0"
33
33
  spec.add_dependency "mnconvert", "~> 1.14"
34
34
  spec.add_dependency "ruby-jing"
35
35
  spec.add_dependency "tokenizer", "~> 0.3.0"
@@ -128,7 +128,7 @@ RSpec.describe IsoDoc do
128
128
  <annex id="annex1" displayorder="5">
129
129
  <title>
130
130
  <strong>Annex A</strong>
131
- <br/>(informative)</title>
131
+ <br/><span class="obligation">(informative)</span></title>
132
132
  <clause id="annex1a" inline-header="true">
133
133
  <title>A.1</title>
134
134
  <note id="AN">
@@ -252,21 +252,21 @@ RSpec.describe IsoDoc do
252
252
  <title>Foreword</title>
253
253
  <p id='A'>
254
254
  This is a preamble
255
- <xref target='C'>0.1</xref>
256
- <xref target='C1'>0.2</xref>
257
- <xref target='D'>Scope</xref>
255
+ <xref target='C'><span class='citesec'>0.1</span></xref>
256
+ <xref target='C1'><span class='citesec'>0.2</span></xref>
257
+ <xref target='D'><span class='citesec'>Scope</span></xref>
258
258
  <xref target='H'>[H]</xref>
259
259
  <xref target='I'>[I]</xref>
260
260
  <xref target='J'>[J]</xref>
261
261
  <xref target='K'>[K]</xref>
262
262
  <xref target='L'>[L]</xref>
263
- <xref target='M'>Clause 4</xref>
264
- <xref target='N'>Introduction</xref>
265
- <xref target='O'>Clause 4.2</xref>
266
- <xref target='P'>Annex A</xref>
267
- <xref target='Q'>A.1</xref>
268
- <xref target='Q1'>A.1.1</xref>
269
- <xref target='Q2'>Annex A, Appendix 1</xref>
263
+ <xref target='M'><span class='citesec'>Clause 4</span></xref>
264
+ <xref target='N'><span class='citesec'>Introduction</span></xref>
265
+ <xref target='O'><span class='citesec'>Clause 4.2</span></xref>
266
+ <xref target='P'><span class='citeapp'>Annex A</span></xref>
267
+ <xref target='Q'><span class='citeapp'>A.1</span></xref>
268
+ <xref target='Q1'><span class='citeapp'>A.1.1</span></xref>
269
+ <xref target='Q2'><span class='citeapp'>Annex A, Appendix 1</span></xref>
270
270
  <xref target='R'>[R]</xref>
271
271
  </p>
272
272
  </foreword>
@@ -297,7 +297,7 @@ RSpec.describe IsoDoc do
297
297
  <title>
298
298
  <strong>Annex A</strong>
299
299
  <br/>
300
- (normative)
300
+ <span class="obligation">(normative)</span>
301
301
  <br/>
302
302
  <br/>
303
303
  <strong>Annex</strong>
@@ -503,7 +503,7 @@ RSpec.describe IsoDoc do
503
503
  </clause>
504
504
  </sections>
505
505
  <annex id="P" inline-header="false" obligation="normative" displayorder="10">
506
- <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
506
+ <title><strong>Annex A</strong><br/><span class="obligation">(normative)</span><br/><br/><strong>Annex</strong></title>
507
507
  <clause id="Q" inline-header="false" obligation="normative">
508
508
  <title depth="2">A.1<tab/>Annex A.1</title>
509
509
  <clause id="Q1" inline-header="false" obligation="normative">
@@ -511,7 +511,8 @@ RSpec.describe IsoDoc do
511
511
  </clause>
512
512
  </clause>
513
513
  </annex>
514
- <annex id="P1" inline-header="false" obligation="normative" displayorder="11"><title><strong>Annex B</strong><br/>(normative)</title></annex>
514
+ <annex id="P1" inline-header="false" obligation="normative" displayorder="11">
515
+ <title><strong>Annex B</strong><br/><span class="obligation">(normative)</span></title></annex>
515
516
  <bibliography>
516
517
  <references id="R" normative="true" obligation="informative" displayorder="7">
517
518
  <title depth="1">Normative References</title>