metanorma-itu 1.0.18 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +0 -1
  3. data/.github/workflows/ubuntu.yml +10 -7
  4. data/.github/workflows/windows.yml +0 -1
  5. data/Rakefile +2 -0
  6. data/lib/asciidoctor/itu/cleanup.rb +128 -95
  7. data/lib/asciidoctor/itu/converter.rb +36 -61
  8. data/lib/asciidoctor/itu/isodoc.rng +12 -6
  9. data/lib/asciidoctor/itu/validate.rb +22 -11
  10. data/lib/isodoc/itu.rb +1 -0
  11. data/lib/isodoc/itu/base_convert.rb +32 -78
  12. data/lib/isodoc/itu/html/_coverpage.css +349 -0
  13. data/lib/isodoc/itu/html/_coverpage.scss +2 -0
  14. data/lib/isodoc/itu/html/htmlstyle.css +1159 -0
  15. data/lib/isodoc/itu/html/itu.css +1138 -0
  16. data/lib/isodoc/itu/html/itu.scss +0 -1
  17. data/lib/isodoc/itu/html/wordstyle.css +1808 -0
  18. data/lib/isodoc/itu/html/wordstyle.scss +0 -1
  19. data/lib/isodoc/itu/html_convert.rb +8 -4
  20. data/lib/isodoc/itu/i18n-en.yaml +25 -0
  21. data/lib/isodoc/itu/i18n.rb +14 -0
  22. data/lib/isodoc/itu/init.rb +29 -0
  23. data/lib/isodoc/itu/itu.recommendation-annex.xsl +1759 -1864
  24. data/lib/isodoc/itu/itu.recommendation.xsl +1759 -1864
  25. data/lib/isodoc/itu/itu.resolution.xsl +1759 -1864
  26. data/lib/isodoc/itu/metadata.rb +8 -5
  27. data/lib/isodoc/itu/pdf_convert.rb +0 -14
  28. data/lib/isodoc/itu/presentation_xml_convert.rb +55 -0
  29. data/lib/isodoc/itu/ref.rb +12 -14
  30. data/lib/isodoc/itu/terms.rb +10 -32
  31. data/lib/isodoc/itu/word_convert.rb +25 -14
  32. data/lib/isodoc/itu/xref.rb +73 -36
  33. data/lib/metanorma/itu/processor.rb +10 -8
  34. data/lib/metanorma/itu/version.rb +1 -1
  35. data/metanorma-itu.gemspec +3 -2
  36. metadata +31 -12
  37. data/lib/asciidoctor/itu/i18n-en.yaml +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f73d7454cb02fbc95efe4d8deb62e8f19f01eba49a9cd73403f3948f5eec053
4
- data.tar.gz: f87b4616dd0b0e48423efc44a5cc7115d1d4841f3aaf4ba1549f5dd0f02fe8fa
3
+ metadata.gz: c4a8298c94b775bf0894357ab7885d198d4aad3da9893b45f610ff27cde287bc
4
+ data.tar.gz: 10411a7522e3bf6a4b4a523125b037fc75470d2bfa7918215742c81cae2d6a6b
5
5
  SHA512:
6
- metadata.gz: 4483e1f5ba81d0677d38cb74c691104d4900653a896eda40d0d2abe5f60a2a14a764b02c1b3ebc31d0b1b43d2451f50e7df91d975b088cc435c9dac25835581f
7
- data.tar.gz: cc0a4617299d46730aeede48cf50fba13dc0b65a649879af55199ecf37b941419100692c964cfeab8e63ce78f4f4845a8b38ad6c450ecff28fab05a398358207
6
+ metadata.gz: 6c497e515e567f5b92710c254570562db5d9c99d5f1b7299e818f1d27d66e51dd676e9b37deb0cb82376db08a8a249dd711418addc17b5052d78c3bba69cd479
7
+ data.tar.gz: 0d691088240f6ff1fa63ecb92a8137e35d10d32d5e4d823695e3937c8caedc4e1837523ec4015de48088a439131391e69bddb4db18ffef7f0865765483f715bf
@@ -29,7 +29,6 @@ jobs:
29
29
  uses: actions/setup-ruby@v1
30
30
  with:
31
31
  ruby-version: ${{ matrix.ruby }}
32
- architecture: 'x64'
33
32
  - name: Update gems
34
33
  run: |
35
34
  sudo gem install bundler --force
@@ -31,7 +31,6 @@ jobs:
31
31
  uses: actions/setup-ruby@v1
32
32
  with:
33
33
  ruby-version: ${{ matrix.ruby }}
34
- architecture: 'x64'
35
34
  - name: Update gems
36
35
  run: |
37
36
  gem install bundler
@@ -39,15 +38,19 @@ jobs:
39
38
  - name: Run specs
40
39
  run: |
41
40
  bundle exec rake
42
- - name: Trigger dependent repositories
43
- if: github.ref == 'refs/heads/master' && matrix.ruby == '2.6'
41
+ - name: Trigger repositories
42
+ if: matrix.ruby == '2.6'
44
43
  env:
45
- GH_USERNAME: ${{ secrets.PAT_USERNAME }}
46
- GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
44
+ GH_USERNAME: metanorma-ci
45
+ GH_ACCESS_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
47
46
  run: |
48
47
  curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
49
48
  [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
50
- for repo in $DEPENDENT_REPOS
49
+ CLIENT_PAYLOAD=$(cat <<EOF
50
+ "{ "ref": "${GITHUB_REF}", "repo": "${GITHUB_REPOSITORY}" }"
51
+ EOF
52
+ )
53
+ for repo in $REPOS
51
54
  do
52
- sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
55
+ sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "$CLIENT_PAYLOAD"
53
56
  done
@@ -29,7 +29,6 @@ jobs:
29
29
  uses: actions/setup-ruby@v1
30
30
  with:
31
31
  ruby-version: ${{ matrix.ruby }}
32
- architecture: 'x64'
33
32
  - name: Update gems
34
33
  shell: pwsh
35
34
  run: |
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'isodoc/gem_tasks'
3
4
 
5
+ IsoDoc::GemTasks.install
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
8
  task :default => :spec
@@ -4,6 +4,7 @@ module Asciidoctor
4
4
  def sections_cleanup(x)
5
5
  super
6
6
  insert_missing_sections(x) unless @no_insert_missing_sections
7
+ insert_empty_clauses(x)
7
8
  end
8
9
 
9
10
  def table_cleanup(xmldoc)
@@ -22,15 +23,20 @@ module Asciidoctor
22
23
  insert_conventions(x)
23
24
  end
24
25
 
26
+ def add_id
27
+ %(id="_#{UUIDTools::UUID.random_create}")
28
+ end
29
+
25
30
  def insert_scope(x)
26
31
  x.at("./*/sections") or
27
32
  x.at("./*/preface | ./*/boilerplate | ./*/bibdata").next =
28
33
  "<sections><sentinel/></sections>"
29
34
  x.at("./*/sections/*") or x.at("./*/sections") << "<sentinel/>"
30
35
  ins = x.at("//sections").elements.first
31
- unless x.at("//sections/clause/title[text() = 'Scope']")
32
- ins.previous = "<clause><title>Scope</title><p>"\
33
- "#{@labels['clause_empty']}</p></clause>"
36
+ unless x.at("//sections/clause[@type = 'scope']")
37
+ ins.previous =
38
+ "<clause type='scope' #{add_id}><title>#{@i18n.scope}</title><p>"\
39
+ "#{@i18n.clause_empty}</p></clause>"
34
40
  end
35
41
  x&.at("//sentinel")&.remove
36
42
  end
@@ -41,19 +47,16 @@ module Asciidoctor
41
47
  "<bibliography><sentinel/></bibliography>"
42
48
  ins = x.at("//bibliography").elements.first
43
49
  unless x.at("//bibliography/references[@normative = 'true']")
44
- #ins.previous = "<references normative='true'><title>References</title><p>"\
45
- # "#{@labels['clause_empty']}</p></references>"
46
- ins.previous = "<references normative='true'><title>References</title>"\
47
- "</references>"
50
+ ins.previous = "<references #{add_id} normative='true'>"\
51
+ "<title>#{@i18n.normref}</title></references>"
48
52
  end
49
53
  x&.at("//sentinel")&.remove
50
54
  end
51
55
 
52
56
  def insert_terms(x)
53
- ins = x.at("//sections/clause/title[text() = 'Scope']/..")
57
+ ins = x.at("//sections/clause[@type = 'scope']")
54
58
  unless x.at("//sections//terms")
55
- ins.next = "<terms><title>Definitions</title><p>"\
56
- "#{@labels['clause_empty']}</p></terms>"
59
+ ins.next = "<terms #{add_id}><title>#{@i18n.termsdef}</title></terms>"
57
60
  end
58
61
  end
59
62
 
@@ -61,112 +64,142 @@ module Asciidoctor
61
64
  ins = x.at("//sections/terms") ||
62
65
  x.at("//sections/clause[descendant::terms]")
63
66
  unless x.at("//sections//definitions")
64
- ins.next = "<definitions><title>Abbreviations and acronyms</title><p>"\
65
- "#{@labels['clause_empty']}</p></definitions>"
67
+ ins.next = "<definitions #{add_id}>"\
68
+ "<title>#{@i18n.symbolsabbrev}</title></definitions>"
66
69
  end
67
70
  end
68
71
 
69
72
  def insert_conventions(x)
70
73
  ins = x.at("//sections//definitions") ||
71
74
  x.at("//sections/clause[descendant::definitions]")
72
- unless x.at("//sections/clause/title[text() = 'Conventions']")
73
- ins.next = "<clause id='_#{UUIDTools::UUID.random_create}'>"\
74
- "<title>Conventions</title><p>"\
75
- "#{@labels['clause_empty']}</p></clause>"
76
- end
77
- end
78
-
79
- def cleanup(xmldoc)
80
- symbols_cleanup(xmldoc)
81
- super
82
- obligations_cleanup(xmldoc)
83
- xmldoc
84
- end
85
-
86
- def smartquotes_cleanup(xmldoc)
87
- return super if @smartquotes
88
- xmldoc.traverse do |n|
75
+ unless x.at("//sections/clause[@type = 'conventions']")
76
+ ins.next = "<clause #{add_id} type='conventions'>"\
77
+ "<title>#{@i18n.conventions}</title><p>"\
78
+ "#{@i18n.clause_empty}</p></clause>"
79
+ end
80
+ end
81
+
82
+ def insert_empty_clauses(x)
83
+ x.xpath("//terms[not(./term)][not(.//terms)]").each do |c|
84
+ insert_empty_clauses1(c, @i18n.clause_empty)
85
+ end
86
+ x.xpath("//definitions[not(./dl)]").each do |c|
87
+ insert_empty_clauses1(c, @i18n.clause_empty)
88
+ end
89
+ end
90
+
91
+ def insert_empty_clauses1(c, text)
92
+ c.at("./p") and return
93
+ ins = c.at("./title") or return
94
+ ins.next = "<p>#{text}</p>"
95
+ end
96
+
97
+ def cleanup(xmldoc)
98
+ symbols_cleanup(xmldoc)
99
+ super
100
+ obligations_cleanup(xmldoc)
101
+ xmldoc
102
+ end
103
+
104
+ def smartquotes_cleanup(xmldoc)
105
+ return super if @smartquotes
106
+ xmldoc.traverse do |n|
89
107
  next unless n.text?
90
108
  n.replace(HTMLEntities.new.encode(
91
109
  n.text.gsub(/\u2019|\u2018|\u201a|\u201b/, "'").
92
110
  gsub(/\u201c|\u201d|\u201e|\u201f/, '"'), :basic))
93
- end
94
- xmldoc
95
- end
96
-
97
- def termdef_cleanup(xmldoc)
98
- xmldoc.xpath("//term/preferred").each do |p|
99
- if ["terms defined elsewhere",
100
- "terms defined in this recommendation"].include? p.text.downcase
101
- p.name = "title"
102
- p.parent.name = "terms"
103
- end
104
- end
105
- super
106
- end
107
-
108
- def termdef_boilerplate_cleanup(xmldoc)
109
- end
110
-
111
- def symbols_cleanup(xmldoc)
112
- sym = xmldoc.at("//definitions/title")
113
- sym and sym&.next_element&.name == "dl" and
114
- sym.next = "<p>#{@symbols_boilerplate}</p>"
111
+ end
112
+ xmldoc
113
+ end
114
+
115
+ def termdef_boilerplate_cleanup(xmldoc)
116
+ end
117
+
118
+ def terms_extract(div)
119
+ internal = div.at("./terms[@type = 'internal']/title")
120
+ external = div.at("./terms[@type = 'external']/title")
121
+ [internal, external]
122
+ end
123
+
124
+ def term_defs_boilerplate(div, source, term, preface, isodoc)
125
+ internal, external = terms_extract(div.parent)
126
+ internal&.next_element&.name == "term" and
127
+ internal.next = "<p>#{@i18n.internal_terms_boilerplate}</p>"
128
+ internal and internal&.next_element == nil and
129
+ internal.next = "<p>#{@i18n.no_terms_boilerplate}</p>"
130
+ external&.next_element&.name == "term" and
131
+ external.next = "<p>#{@i18n.external_terms_boilerplate}</p>"
132
+ external and external&.next_element == nil and
133
+ external.next = "<p>#{@i18n.no_terms_boilerplate}</p>"
134
+ !internal and !external and
135
+ %w(term terms).include? div&.next_element&.name and
136
+ div.next = "<p>#{@i18n.term_def_boilerplate}</p>"
137
+ end
138
+
139
+ def section_names_terms_cleanup(x)
140
+ super
141
+ replace_title(
142
+ x, "//terms[@type = 'internal'] | "\
143
+ "//clause[./terms[@type = 'internal']][not(./terms[@type = 'external'])]",
144
+ @i18n&.internal_termsdef)
145
+ replace_title(
146
+ x, "//terms[@type = 'external'] | "\
147
+ "//clause[./terms[@type = 'external']][not(./terms[@type = 'internal'])]",
148
+ @i18n&.external_termsdef)
149
+ end
150
+
151
+ def symbols_cleanup(xmldoc)
152
+ sym = xmldoc.at("//definitions/title")
153
+ sym and sym&.next_element&.name == "dl" and
154
+ sym.next = "<p>#{@i18n.symbols_boilerplate}</p>"
115
155
  end
116
156
 
117
157
  PUBLISHER = "./contributor[role/@type = 'publisher']/organization".freeze
118
158
 
119
159
  def pub_class(bib)
120
160
  return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ITU']")
121
- return 1 if bib.at("#{PUBLISHER}[name = 'International "\
122
- "Telecommunication Union']")
123
- return 2 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
124
- return 2 if bib.at("#{PUBLISHER}[name = 'International Organization "\
125
- "for Standardization']")
126
- return 3 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
127
- return 3 if bib.at("#{PUBLISHER}[name = 'International "\
128
- "Electrotechnical Commission']")
129
- return 4 if bib.at("./docidentifier[@type][not(@type = 'DOI' or "\
130
- "@type = 'metanorma' or @type = 'ISSN' or @type = "\
131
- "'ISBN')]")
132
- 5
133
- end
134
-
135
- def sort_biblio(bib)
136
- bib.sort do |a, b|
137
- sort_biblio_key(a) <=> sort_biblio_key(b)
138
- end
139
- end
161
+ return 1 if bib.at("#{PUBLISHER}[name = 'International "\
162
+ "Telecommunication Union']")
163
+ return 2 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
164
+ return 2 if bib.at("#{PUBLISHER}[name = 'International Organization "\
165
+ "for Standardization']")
166
+ return 3 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
167
+ return 3 if bib.at("#{PUBLISHER}[name = 'International "\
168
+ "Electrotechnical Commission']")
169
+ return 4 if bib.at("./docidentifier[@type][not(@type = 'DOI' or "\
170
+ "@type = 'metanorma' or @type = 'ISSN' or @type = "\
171
+ "'ISBN')]")
172
+ 5
173
+ end
140
174
 
141
- # sort by: doc class (ITU, ISO, IEC, other standard (not DOI &c), other
142
- # then standard class (docid class other than DOI &c)
143
- # then alphanumeric doc id (not DOI &c)
144
- # then title
145
- def sort_biblio_key(bib)
146
- pubclass = pub_class(bib)
147
- num = bib&.at("./docnumber")&.text
148
- id = bib&.at("./docidentifier[not(@type = 'DOI' or @type = "\
149
- "'metanorma' or @type = 'ISSN' or @type = 'ISBN')]")
150
- metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text
151
- abbrid = metaid unless /^\[\d+\]$/.match(metaid)
152
- type = id['type'] if id
153
- title = bib&.at("./title[@type = 'main']")&.text ||
154
- bib&.at("./title")&.text || bib&.at("./formattedref")&.text
155
- "#{pubclass} :: #{type} :: #{id&.text || metaid} :: #{title}"
175
+ def sort_biblio(bib)
176
+ bib.sort do |a, b|
177
+ sort_biblio_key(a) <=> sort_biblio_key(b)
156
178
  end
179
+ end
157
180
 
158
- def biblio_reorder(xmldoc)
159
- xmldoc.xpath("//references").each do |r|
160
- biblio_reorder1(r)
161
- end
162
- end
181
+ # sort by: doc class (ITU, ISO, IEC, other standard (not DOI &c), other
182
+ # then standard class (docid class other than DOI &c)
183
+ # then alphanumeric doc id (not DOI &c)
184
+ # then title
185
+ def sort_biblio_key(bib)
186
+ pubclass = pub_class(bib)
187
+ num = bib&.at("./docnumber")&.text
188
+ id = bib&.at("./docidentifier[not(@type = 'DOI' or @type = "\
189
+ "'metanorma' or @type = 'ISSN' or @type = 'ISBN')]")
190
+ metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text
191
+ abbrid = metaid unless /^\[\d+\]$/.match(metaid)
192
+ type = id['type'] if id
193
+ title = bib&.at("./title[@type = 'main']")&.text ||
194
+ bib&.at("./title")&.text || bib&.at("./formattedref")&.text
195
+ "#{pubclass} :: #{type} :: #{id&.text || metaid} :: #{title}"
196
+ end
163
197
 
164
- def normref_cleanup(xmldoc)
165
- super
166
- r = xmldoc.at(NORM_REF) || return
167
- title = r.at("./title") and
168
- title.content = "References"
198
+ def biblio_reorder(xmldoc)
199
+ xmldoc.xpath("//references").each do |r|
200
+ biblio_reorder1(r)
169
201
  end
170
202
  end
171
203
  end
172
204
  end
205
+ end
@@ -53,21 +53,15 @@ module Asciidoctor
53
53
  end.join("\n")
54
54
  end
55
55
 
56
- def document(node)
57
- init(node)
58
- ret1 = makexml(node)
59
- ret = ret1.to_xml(indent: 2)
60
- unless node.attr("nodoc") || !node.attr("docfile")
61
- filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
62
- gsub(%r{^.*/}, "")
63
- File.open(filename, "w") { |f| f.write(ret) }
64
- html_converter(node).convert filename unless node.attr("nodoc")
65
- word_converter(node).convert filename unless node.attr("nodoc")
66
- pdf_converter(node).convert filename unless node.attr("nodoc")
67
- end
68
- @log.write(@localdir + @filename + ".err") unless @novalid
69
- @files_to_delete.each { |f| FileUtils.rm f }
70
- ret
56
+ def outputs(node, ret)
57
+ File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
58
+ presentation_xml_converter(node).convert(@filename + ".xml")
59
+ html_converter(node).convert(@filename + ".presentation.xml",
60
+ nil, false, "#{@filename}.html")
61
+ doc_converter(node).convert(@filename + ".presentation.xml",
62
+ nil, false, "#{@filename}.doc")
63
+ pdf_converter(node)&.convert(@filename + ".presentation.xml",
64
+ nil, false, "#{@filename}.pdf")
71
65
  end
72
66
 
73
67
  def validate(doc)
@@ -85,65 +79,42 @@ module Asciidoctor
85
79
  when "definitions" then "terms and definitions"
86
80
  when "abbreviations and acronyms" then "symbols and abbreviated terms"
87
81
  when "references" then "normative references"
82
+ when "terms defined elsewhere" then "terms and definitions"
83
+ when "terms defined in this recommendation" then "terms and definitions"
88
84
  else
89
85
  super
90
86
  end
91
87
  end
92
88
 
93
- def term_def_title(toplevel, node)
94
- return node.title unless toplevel
95
- "Definitions"
96
- end
97
-
98
- def terms_extract(div)
99
- internal = nil
100
- external = nil
101
- div.parent.xpath("./terms/title").each do |t|
102
- case t&.text&.downcase
103
- when "terms defined elsewhere" then external = t
104
- when "terms defined in this recommendation" then internal = t
105
- end
89
+ def term_def_subclause_parse(attrs, xml, node)
90
+ case clausetype = sectiontype1(node)
91
+ when "terms defined in this recommendation"
92
+ term_def_parse(attrs.merge(type: "internal"), xml, node, false)
93
+ when "terms defined elsewhere"
94
+ term_def_parse(attrs.merge(type: "external"), xml, node, false)
95
+ else
96
+ super
106
97
  end
107
- [internal, external]
108
- end
109
-
110
- def term_defs_boilerplate(div, source, term, preface, isodoc)
111
- internal, external = terms_extract(div)
112
- internal&.next_element&.name == "term" and
113
- internal.next = "<p>#{@internal_terms_boilerplate}</p>"
114
- internal and internal&.next_element == nil and
115
- internal.next = "<p>#{@no_terms_boilerplate}</p>"
116
- external&.next_element&.name == "term" and
117
- external.next = "<p>#{@external_terms_boilerplate}</p>"
118
- external and external&.next_element == nil and
119
- external.next = "<p>#{@no_terms_boilerplate}</p>"
120
- !internal and !external and
121
- %w(term terms).include? div&.next_element&.name and
122
- div.next = "<p>#{@term_def_boilerplate}</p>"
123
- end
124
-
125
- def load_yaml(lang, script)
126
- y = if @i18nyaml then YAML.load_file(@i18nyaml)
127
- elsif lang == "en"
128
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
129
- else
130
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
131
- end
132
- @symbols_boilerplate = y["symbols_boilerplate"] || ""
133
- super.merge(y)
134
- end
135
-
136
- def i18n_init(lang, script)
137
- super
138
98
  end
139
99
 
140
- def metadata_keywords(node, xml)
100
+ def metadata_keywords(node, xml)
141
101
  return unless node.attr("keywords")
142
102
  node.attr("keywords").split(/,[ ]*/).sort.each_with_index do |kw, i|
143
103
  xml.keyword (i == 0 ? kw.capitalize : kw)
144
104
  end
145
105
  end
146
106
 
107
+ def clause_parse(attrs, xml, node)
108
+ case clausetype = sectiontype1(node)
109
+ when "conventions" then attrs = attrs.merge(type: "conventions")
110
+ when "history"
111
+ attrs[:preface] and attrs = attrs.merge(type: "history")
112
+ when "source"
113
+ attrs[:preface] and attrs = attrs.merge(type: "source")
114
+ end
115
+ super
116
+ end
117
+
147
118
  def html_extract_attributes(node)
148
119
  super.merge(hierarchical_assets: node.attr("hierarchical-object-numbering"))
149
120
  end
@@ -152,6 +123,10 @@ module Asciidoctor
152
123
  super.merge(hierarchical_assets: node.attr("hierarchical-object-numbering"))
153
124
  end
154
125
 
126
+ def presentation_xml_converter(node)
127
+ IsoDoc::ITU::PresentationXMLConvert.new(html_extract_attributes(node))
128
+ end
129
+
155
130
  def html_converter(node)
156
131
  IsoDoc::ITU::HtmlConvert.new(html_extract_attributes(node))
157
132
  end
@@ -160,7 +135,7 @@ module Asciidoctor
160
135
  IsoDoc::ITU::PdfConvert.new(html_extract_attributes(node))
161
136
  end
162
137
 
163
- def word_converter(node)
138
+ def doc_converter(node)
164
139
  IsoDoc::ITU::WordConvert.new(doc_extract_attributes(node))
165
140
  end
166
141
  end