metanorma-iso 2.0.8.1 → 2.1.0

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +37 -0
  3. data/lib/isodoc/iso/html/html_iso_titlepage.html +5 -0
  4. data/lib/isodoc/iso/html/isodoc-dis.css +196 -156
  5. data/lib/isodoc/iso/html/isodoc-dis.scss +193 -156
  6. data/lib/isodoc/iso/html/word_iso_intro-dis.html +7 -0
  7. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +2 -0
  8. data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -0
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +204 -34
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +198 -34
  11. data/lib/isodoc/iso/i18n-en.yaml +1 -0
  12. data/lib/isodoc/iso/i18n-fr.yaml +1 -0
  13. data/lib/isodoc/iso/i18n-ru.yaml +1 -0
  14. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  15. data/lib/isodoc/iso/init.rb +17 -1
  16. data/lib/isodoc/iso/iso.amendment.xsl +470 -201
  17. data/lib/isodoc/iso/iso.international-standard.xsl +470 -201
  18. data/lib/isodoc/iso/metadata.rb +5 -11
  19. data/lib/isodoc/iso/presentation_inline.rb +90 -0
  20. data/lib/isodoc/iso/presentation_xml_convert.rb +39 -98
  21. data/lib/isodoc/iso/presentation_xref.rb +126 -0
  22. data/lib/isodoc/iso/word_cleanup.rb +14 -0
  23. data/lib/isodoc/iso/word_convert.rb +27 -10
  24. data/lib/isodoc/iso/word_dis_convert.rb +174 -0
  25. data/lib/isodoc/iso/xref.rb +46 -25
  26. data/lib/metanorma/iso/biblio.rng +37 -8
  27. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  28. data/lib/metanorma/iso/boilerplate-ru.xml +1 -3
  29. data/lib/metanorma/iso/boilerplate.xml +1 -3
  30. data/lib/metanorma/iso/cleanup.rb +2 -1
  31. data/lib/metanorma/iso/isodoc.rng +56 -0
  32. data/lib/metanorma/iso/version.rb +1 -1
  33. data/lib/metanorma-iso.rb +1 -0
  34. data/lib/relaton/render/config.yml +4 -0
  35. data/lib/relaton/render/general.rb +13 -0
  36. data/metanorma-iso.gemspec +1 -1
  37. data/spec/isodoc/amd_spec.rb +15 -14
  38. data/spec/isodoc/blocks_spec.rb +286 -179
  39. data/spec/isodoc/i18n_spec.rb +187 -21
  40. data/spec/isodoc/inline_spec.rb +35 -42
  41. data/spec/isodoc/iso_spec.rb +1 -1
  42. data/spec/isodoc/postproc_spec.rb +25 -0
  43. data/spec/isodoc/ref_spec.rb +66 -69
  44. data/spec/isodoc/section_spec.rb +78 -76
  45. data/spec/isodoc/table_spec.rb +2 -2
  46. data/spec/isodoc/terms_spec.rb +2 -2
  47. data/spec/isodoc/word_dis_spec.rb +760 -0
  48. data/spec/isodoc/xref_spec.rb +51 -51
  49. data/spec/metanorma/base_spec.rb +10 -10
  50. data/spec/spec_helper.rb +4 -1
  51. data/spec/vcr_cassettes/withdrawn_iso.yml +26 -26
  52. metadata +11 -5
  53. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -0,0 +1,174 @@
1
+ module IsoDoc
2
+ module Iso
3
+ class WordDISConvert < WordConvert
4
+ def default_file_locations(_options)
5
+ {
6
+ wordstylesheet: html_doc_path("wordstyle-dis.scss"),
7
+ standardstylesheet: html_doc_path("isodoc-dis.scss"),
8
+ header: html_doc_path("header-dis.html"),
9
+ wordcoverpage: html_doc_path("word_iso_titlepage-dis.html"),
10
+ wordintropage: html_doc_path("word_iso_intro-dis.html"),
11
+ ulstyle: "l3",
12
+ olstyle: "l2",
13
+ }
14
+ end
15
+
16
+ def initialize(options)
17
+ @libdir ||= File.dirname(__FILE__) # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
18
+ options.merge!(default_file_locations(options))
19
+ super
20
+ end
21
+
22
+ def init_dis; end
23
+
24
+ def style_cleanup(docxml)
25
+ super
26
+ dis_styles(docxml)
27
+ end
28
+
29
+ STYLESMAP = {
30
+ AltTerms: "AdmittedTerm",
31
+ TableFootnote: "Tablefootnote",
32
+ formula: "Formula",
33
+ note: "Note",
34
+ NormRef: "RefNorm",
35
+ biblio: "BiblioEntry",
36
+ MsoNormal: "MsoBodyText",
37
+ FigureTitle: "Figuretitle",
38
+ }.freeze
39
+
40
+ def dis_styles(docxml)
41
+ STYLESMAP.each do |k, v|
42
+ docxml.xpath("//*[@class = '#{k}']").each { |s| s["class"] = v }
43
+ end
44
+ docxml.xpath("//h1[@class = 'ForewordTitle' or @class = 'IntroTitle']")
45
+ .each { |h| h.name = "p" }
46
+ dis_styles1(docxml)
47
+ docxml.xpath("//p[not(@class)]").each { |p| p["class"] = "MsoBodyText" }
48
+ end
49
+
50
+ def dis_styles1(docxml)
51
+ code_style(docxml)
52
+ figure_style(docxml)
53
+ example_style(docxml)
54
+ end
55
+
56
+ def example_style(docxml)
57
+ docxml.xpath("//div[@class = 'Example']").each do |d|
58
+ d.xpath("./p").each_with_index do |p, i|
59
+ next if p["class"] && p["class"] != "Example"
60
+
61
+ p["class"] = (i.zero? ? "Example" : "Examplecontinued")
62
+ end
63
+ end
64
+ end
65
+
66
+ def figure_name_attrs(_node)
67
+ { class: "FigureTitle", style: "text-align:center;" }
68
+ end
69
+
70
+ def table_title_attrs(_node)
71
+ { class: "Tabletitle", style: "text-align:center;" }
72
+ end
73
+
74
+ def word_annex_cleanup1(docxml, lvl)
75
+ docxml.xpath("//h#{lvl}[ancestor::*[@class = 'Section3']]").each do |h2|
76
+ h2.name = "p"
77
+ h2["class"] = "a#{lvl}"
78
+ end
79
+ end
80
+
81
+ def span_parse(node, out)
82
+ out.span **{ class: node["class"] } do |x|
83
+ node.children.each { |n| parse(n, x) }
84
+ end
85
+ end
86
+
87
+ def word_toc_preface(level)
88
+ <<~TOC.freeze
89
+ <span lang="EN-GB"><span
90
+ style='mso-element:field-begin'></span><span
91
+ style='mso-spacerun:yes'>&#xA0;</span>TOC \\o &quot;2-#{level}&quot; \\h \\z \\t
92
+ &quot;Heading 1;1;ANNEX;1;Biblio Title;1;Foreword Title;1;Intro Title;1;ANNEXN;1;ANNEXZ;1;na2;1;na3;1;na4;1;na5;1;na6;1;Title;1;Base_Heading;1;Box-title;1;Front Head;1;Index Head;1;AMEND Terms Heading;1;AMEND Heading 1 Unnumbered;1&quot;
93
+ <span style='mso-element:field-separator'></span></span>
94
+ TOC
95
+ end
96
+
97
+ def render_identifier(ident)
98
+ ret = super
99
+ ret[:sdo] = std_docid_semantic(ret[:sdo])
100
+ ret
101
+ end
102
+
103
+ FIGURE_NESTED_STYLES =
104
+ { Note: "Figurenote", example: "Figureexample" }.freeze
105
+
106
+ def figure_style(docxml)
107
+ docxml.xpath("//div[@class = 'figure']").each do |f|
108
+ FIGURE_NESTED_STYLES.each do |k, v|
109
+ f.xpath(".//*[@class = '#{k}']").each { |n| n["class"] = v }
110
+ end
111
+ f.xpath("./img").each do |i|
112
+ i.replace("<p class='FigureGraphic'>#{i.to_xml}</p>")
113
+ end
114
+ end
115
+ end
116
+
117
+ def code_style(doc)
118
+ span_style((doc.xpath("//tt//b") - doc.xpath("//tt//i//b")),
119
+ "ISOCodebold")
120
+ span_style((doc.xpath("//tt//i") - doc.xpath("//tt//b//i")),
121
+ "ISOCodeitalic")
122
+ span_style((doc.xpath("//b//tt") - doc.xpath("//b//i//tt")),
123
+ "ISOCodebold")
124
+ span_style((doc.xpath("//i//tt") - doc.xpath("//i//b//tt")),
125
+ "ISOCodeitalic")
126
+ span_style(doc.xpath("//tt"), "ISOCode")
127
+ end
128
+
129
+ def span_style(xpath, style)
130
+ xpath.each do |elem|
131
+ elem.name = "span"
132
+ elem["class"] = style
133
+ end
134
+ end
135
+
136
+ def make_tr_attr(cell, row, totalrows, header)
137
+ super.merge(header: header)
138
+ end
139
+
140
+ def word_cleanup(docxml)
141
+ word_table_cell_para(docxml)
142
+ super
143
+ end
144
+
145
+ def word_table_cell_para(docxml)
146
+ docxml.xpath("//td | //th").each do |t|
147
+ s = t["header"] == "true" ? "Tableheader" : "Tablebody"
148
+ t.delete("header")
149
+ if t.at("./p |./div")
150
+ t.xpath("./p | ./div").each { |p| p["class"] = s }
151
+ else
152
+ t.children = "<div class='#{s}'>#{t.children.to_xml}</div>"
153
+ end
154
+ end
155
+ end
156
+
157
+ def toWord(result, filename, dir, header)
158
+ result = from_xhtml(word_cleanup(to_xhtml(result)))
159
+ .gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
160
+ @wordstylesheet = wordstylesheet_update
161
+ ::Html2Doc::IsoDIS.new(
162
+ filename: filename,
163
+ imagedir: @localdir,
164
+ stylesheet: @wordstylesheet&.path,
165
+ header_file: header&.path, dir: dir,
166
+ asciimathdelims: [@openmathdelim, @closemathdelim],
167
+ liststyles: { ul: @ulstyle, ol: @olstyle }
168
+ ).process(result)
169
+ header&.unlink
170
+ @wordstylesheet.unlink if @wordstylesheet.is_a?(Tempfile)
171
+ end
172
+ end
173
+ end
174
+ end
@@ -10,36 +10,48 @@ module IsoDoc
10
10
  else
11
11
  initial_anchor_names1(doc)
12
12
  end
13
- introduction_names(doc.at(ns("//introduction")))
13
+ if @parse_settings.empty? || @parse_settings[:clauses]
14
+ introduction_names(doc.at(ns("//introduction")))
15
+ end
14
16
  end
15
17
 
16
18
  def initial_anchor_names_amd(doc)
17
- doc.xpath(ns("//preface/*")).each do |c|
18
- c.element? and preface_names(c)
19
+ if @parse_settings.empty? || @parse_settings[:clauses]
20
+ doc.xpath(ns("//preface/*")).each do |c|
21
+ c.element? and preface_names(c)
22
+ end
23
+ doc.xpath(ns("//sections/clause")).each do |c|
24
+ c.element? and preface_names(c)
25
+ end
19
26
  end
20
- sequential_asset_names(doc.xpath(ns("//preface/*")))
21
- doc.xpath(ns("//sections/clause")).each do |c|
22
- c.element? and preface_names(c)
27
+ if @parse_settings.empty?
28
+ sequential_asset_names(doc.xpath(ns("//preface/*")))
29
+ middle_section_asset_names(doc)
30
+ termnote_anchor_names(doc)
31
+ termexample_anchor_names(doc)
23
32
  end
24
- middle_section_asset_names(doc)
25
- termnote_anchor_names(doc)
26
- termexample_anchor_names(doc)
27
33
  end
28
34
 
29
35
  def initial_anchor_names1(doc)
30
- doc.xpath(ns("//preface/*")).each { |c| c.element? and preface_names(c) }
31
- # potentially overridden in middle_section_asset_names()
32
- sequential_asset_names(doc.xpath(ns("//preface/*")))
33
- n = Counter.new
34
- n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
35
- n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
36
- doc.xpath(ns("//sections/clause[not(@type = 'scope')] | "\
37
- "//sections/terms | //sections/definitions")).each do |c|
38
- n = section_names(c, n, 1)
36
+ if @parse_settings.empty? || @parse_settings[:clauses]
37
+ doc.xpath(ns("//preface/*")).each do |c|
38
+ c.element? and preface_names(c)
39
+ end
40
+ # potentially overridden in middle_section_asset_names()
41
+ sequential_asset_names(doc.xpath(ns("//preface/*")))
42
+ n = Counter.new
43
+ n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
44
+ n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
45
+ doc.xpath(ns("//sections/clause[not(@type = 'scope')] | "\
46
+ "//sections/terms | //sections/definitions")).each do |c|
47
+ n = section_names(c, n, 1)
48
+ end
49
+ end
50
+ if @parse_settings.empty?
51
+ middle_section_asset_names(doc)
52
+ termnote_anchor_names(doc)
53
+ termexample_anchor_names(doc)
39
54
  end
40
- middle_section_asset_names(doc)
41
- termnote_anchor_names(doc)
42
- termexample_anchor_names(doc)
43
55
  end
44
56
 
45
57
  # we can reference 0-number clauses in introduction
@@ -68,6 +80,7 @@ module IsoDoc
68
80
  @anchors[c["id"]] = anchor_struct(i.print, nil, @labels["appendix"],
69
81
  "clause")
70
82
  @anchors[c["id"]][:level] = 2
83
+ @anchors[c["id"]][:subtype] = "annex"
71
84
  @anchors[c["id"]][:container] = clause["id"]
72
85
  j = Counter.new
73
86
  c.xpath(ns("./clause | ./references")).each do |c1|
@@ -78,10 +91,11 @@ module IsoDoc
78
91
  end
79
92
  end
80
93
 
94
+ # subclauses are not prefixed with "Clause"
95
+ # retaining sybtupe for the semantics
81
96
  def section_names1(clause, num, level)
82
97
  @anchors[clause["id"]] =
83
- { label: num, level: level, xref: num }
84
- # subclauses are not prefixed with "Clause"
98
+ { label: num, level: level, xref: num, subtype: "clause" }
85
99
  i = Counter.new
86
100
  clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
87
101
  "./references"))
@@ -92,7 +106,8 @@ module IsoDoc
92
106
  end
93
107
 
94
108
  def annex_names1(clause, num, level)
95
- @anchors[clause["id"]] = { label: num, xref: num, level: level }
109
+ @anchors[clause["id"]] = { label: num, xref: num, level: level,
110
+ subtype: "annex" }
96
111
  i = Counter.new
97
112
  clause.xpath(ns("./clause | ./references")).each do |c|
98
113
  i.increment(c)
@@ -166,7 +181,13 @@ module IsoDoc
166
181
 
167
182
  def back_anchor_names(docxml)
168
183
  super
169
- docxml.xpath(ns("//indexsect")).each { |b| preface_names(b) }
184
+ if @parse_settings.empty? || @parse_settings[:clauses]
185
+ docxml.xpath(ns("//indexsect")).each { |b| preface_names(b) }
186
+ end
187
+ end
188
+
189
+ def annex_name_lbl(clause, num)
190
+ super.sub(%r{<br/>(.*)$}, "<br/><span class='obligation'>\\1</span>")
170
191
  end
171
192
  end
172
193
  end
@@ -851,17 +851,46 @@
851
851
  </define>
852
852
  <define name="bplace">
853
853
  <element name="place">
854
- <optional>
855
- <attribute name="uri">
856
- <data type="anyURI"/>
857
- </attribute>
858
- </optional>
859
- <optional>
860
- <attribute name="region"/>
861
- </optional>
854
+ <choice>
855
+ <text/>
856
+ <group>
857
+ <ref name="bibliocity"/>
858
+ <zeroOrMore>
859
+ <ref name="biblioregion"/>
860
+ </zeroOrMore>
861
+ <zeroOrMore>
862
+ <ref name="bibliocountry"/>
863
+ </zeroOrMore>
864
+ </group>
865
+ </choice>
866
+ </element>
867
+ </define>
868
+ <define name="bibliocity">
869
+ <element name="city">
862
870
  <text/>
863
871
  </element>
864
872
  </define>
873
+ <define name="biblioregion">
874
+ <element name="region">
875
+ <ref name="RegionType"/>
876
+ </element>
877
+ </define>
878
+ <define name="bibliocountry">
879
+ <element name="country">
880
+ <ref name="RegionType"/>
881
+ </element>
882
+ </define>
883
+ <define name="RegionType">
884
+ <optional>
885
+ <attribute name="iso"/>
886
+ </optional>
887
+ <optional>
888
+ <attribute name="recommended">
889
+ <data type="boolean"/>
890
+ </attribute>
891
+ </optional>
892
+ <text/>
893
+ </define>
865
894
  <define name="bprice">
866
895
  <element name="price">
867
896
  <attribute name="currency"/>
@@ -1,7 +1,7 @@
1
1
  <boilerplate>
2
2
  <copyright-statement>
3
3
  <clause>
4
- <p id="boilerplate-year">&#xa9; {{ agency }} {{ docyear }}</p>
4
+ <p id="boilerplate-year">&#xa9; <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
5
5
 
6
6
  <p id="boilerplate-message">
7
7
  Droits de reproduction réservés. Sauf indication contraire, ou requise dans le cadre de sa mise en œuvre,
@@ -1,9 +1,7 @@
1
1
  <boilerplate>
2
2
  <copyright-statement>
3
3
  <clause>
4
- <p id="boilerplate-year">
5
- &#xa9; {{ agency }} {{ docyear }}
6
- </p>
4
+ <p id="boilerplate-year">&#xa9; <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
7
5
 
8
6
  <p id="boilerplate-message">
9
7
  Все права защищены. Если иначе не определено или не требуется в контексте его реализации, никакая часть этой публикации не может быть воспроизведена или использована иначе в любой форме или каким-либо образом, электронным или механическим, включая фотокопирование, или публикацию в Интернете или интранете, без предварительного письменного разрешения. Разрешение может быть запрошено ISO по адресу, указанному ниже, или у органа — члена ISO страны запрашивающего.
@@ -1,9 +1,7 @@
1
1
  <boilerplate>
2
2
  <copyright-statement>
3
3
  <clause>
4
- <p id="boilerplate-year">
5
- &#xa9; {{ agency }} {{ docyear }}
6
- </p>
4
+ <p id="boilerplate-year">&#xa9; <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
7
5
 
8
6
  <p id="boilerplate-message">
9
7
  All rights
@@ -40,7 +40,8 @@ module Metanorma
40
40
  xmldoc.xpath("//bibdata/contributor[role/@type = 'publisher']"\
41
41
  "/organization").each_with_object([]) do |x, prefix|
42
42
  x1 = x.at("abbreviation")&.text || x.at("name")&.text
43
- (x1 == "ISO" and prefix.unshift("ISO")) or prefix << x1
43
+ #(x1 == "ISO" and prefix.unshift("ISO")) or prefix << x1
44
+ prefix << x1
44
45
  end
45
46
  end
46
47
 
@@ -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.8.1".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>