metanorma-iso 1.4.3.pre.alpha → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ubuntu.yml +1 -1
  3. data/lib/asciidoctor/iso/base.rb +8 -19
  4. data/lib/asciidoctor/iso/cleanup.rb +2 -3
  5. data/lib/asciidoctor/iso/front.rb +4 -5
  6. data/lib/asciidoctor/iso/front_id.rb +1 -1
  7. data/lib/asciidoctor/iso/isodoc.rng +12 -6
  8. data/lib/asciidoctor/iso/section.rb +5 -11
  9. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +0 -1
  10. data/lib/asciidoctor/iso/validate_section.rb +40 -44
  11. data/lib/isodoc/iso/base_convert.rb +3 -64
  12. data/lib/isodoc/iso/html_convert.rb +2 -1
  13. data/lib/{asciidoctor → isodoc}/iso/i18n-en.yaml +0 -1
  14. data/lib/{asciidoctor → isodoc}/iso/i18n-fr.yaml +0 -0
  15. data/lib/{asciidoctor → isodoc}/iso/i18n-zh-Hans.yaml +0 -0
  16. data/lib/isodoc/iso/i18n.rb +19 -0
  17. data/lib/isodoc/iso/init.rb +33 -0
  18. data/lib/isodoc/iso/iso.amendment.xsl +1403 -1719
  19. data/lib/isodoc/iso/iso.international-standard.xsl +1403 -1719
  20. data/lib/isodoc/iso/metadata.rb +1 -1
  21. data/lib/isodoc/iso/presentation_xml_convert.rb +99 -1
  22. data/lib/isodoc/iso/sections.rb +3 -8
  23. data/lib/isodoc/iso/word_convert.rb +2 -1
  24. data/lib/isodoc/iso/xref.rb +2 -0
  25. data/lib/metanorma/iso/version.rb +1 -1
  26. data/metanorma-iso.gemspec +2 -2
  27. data/spec/asciidoctor-iso/base_spec.rb +3 -11
  28. data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
  29. data/spec/asciidoctor-iso/inline_spec.rb +1 -1
  30. data/spec/asciidoctor-iso/refs_spec.rb +3 -3
  31. data/spec/asciidoctor-iso/section_spec.rb +9 -6
  32. data/spec/asciidoctor-iso/validate_spec.rb +100 -21
  33. data/spec/isodoc/amd_spec.rb +309 -153
  34. data/spec/isodoc/blocks_spec.rb +362 -28
  35. data/spec/isodoc/i18n_spec.rb +468 -108
  36. data/spec/isodoc/inline_spec.rb +99 -31
  37. data/spec/isodoc/iso_spec.rb +95 -29
  38. data/spec/isodoc/postproc_spec.rb +114 -149
  39. data/spec/isodoc/ref_spec.rb +175 -3
  40. data/spec/isodoc/section_spec.rb +148 -82
  41. data/spec/isodoc/table_spec.rb +142 -5
  42. data/spec/isodoc/terms_spec.rb +78 -53
  43. data/spec/isodoc/xref_spec.rb +831 -658
  44. data/spec/metanorma/processor_spec.rb +2 -1
  45. metadata +13 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e979c731980a2161f9b8ca6c4801380d5bd8d08eaee315945dc1db5a9658d281
4
- data.tar.gz: d72d7e8443662287da6742ee75120eeaf284d228556a3c9780cf4176ba1b6d02
3
+ metadata.gz: dd5b7686b3881431ec7fa1458bc81a17c0a27adbbc501544ebe072e8a972a71f
4
+ data.tar.gz: 203a1122661385da06e1cc8601783054b332a7e4d6beff447adcc74952d68a1e
5
5
  SHA512:
6
- metadata.gz: 9e1096a7c22c0a8169344106ce70e12986c13e086a048b33c564a093f1bf20ad9a12f16db1980c70e2e1e8813d65d884b19b08eb1fdda7779c1a9524450aaba2
7
- data.tar.gz: bc2774707bad1a2712804f4f13629d5dbc74f05e778c5be971c0698073048d8c7a405e851cf549feaf52fee866797c15cef8f34c47ea1cbf32a724d202fb8dfb
6
+ metadata.gz: 7a3c94618bea757cc7f27bafd5c097e03d7a47f88e6f760665cdc9b7001c17edfa204d617a500898d246f59faecb07c54d20d316a18c4ae05309ea6901235499
7
+ data.tar.gz: 5dcb09685e984c9b82e80030bafbb6109b8ac7c6f8c355801a9634eb853db977acf0095ed09ea72f7d59d6e36c308f9c8b2996383bf079ac7ab11d0c93267129
@@ -39,7 +39,7 @@ jobs:
39
39
  polling_interval_seconds: 5
40
40
  timeout_minutes: 5
41
41
  max_attempts: 3
42
- command: sudo bash -c "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
42
+ command: sudo apt-get update -y && sudo bash -c "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
43
43
  - name: Run specs
44
44
  run: |
45
45
  bundle exec rake
@@ -3,7 +3,6 @@ require "nokogiri"
3
3
  require "json"
4
4
  require "pathname"
5
5
  require "open-uri"
6
- require "pp"
7
6
  require "isodoc"
8
7
  require "fileutils"
9
8
  require 'asciidoctor/iso/macros'
@@ -53,26 +52,16 @@ module Asciidoctor
53
52
  def outputs(node, ret)
54
53
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
55
54
  presentation_xml_converter(node).convert(@filename + ".xml")
56
- html_converter_alt(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}_alt.html")
57
- html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
58
- doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
59
- pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
55
+ html_converter_alt(node).convert(@filename + ".presentation.xml",
56
+ nil, false, "#{@filename}_alt.html")
57
+ html_converter(node).convert(@filename + ".presentation.xml",
58
+ nil, false, "#{@filename}.html")
59
+ doc_converter(node).convert(@filename + ".presentation.xml",
60
+ nil, false, "#{@filename}.doc")
61
+ pdf_converter(node)&.convert(@filename + ".presentation.xml",
62
+ nil, false, "#{@filename}.pdf")
60
63
  #sts_converter(node)&.convert(@filename + ".xml")
61
64
  end
62
-
63
- def load_yaml(lang, script)
64
- y = if @i18nyaml then YAML.load_file(@i18nyaml)
65
- elsif lang == "en"
66
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
67
- elsif lang == "fr"
68
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
69
- elsif lang == "zh" && script == "Hans"
70
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
71
- else
72
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
73
- end
74
- super.merge(y)
75
- end
76
65
  end
77
66
  end
78
67
  end
@@ -4,20 +4,19 @@ require "htmlentities"
4
4
  require "json"
5
5
  require "pathname"
6
6
  require "open-uri"
7
- require "pp"
8
7
  require "asciidoctor/iso/term_lookup_cleanup"
9
8
 
10
9
  module Asciidoctor
11
10
  module ISO
12
11
  class Converter < Standoc::Converter
13
12
  PRE_NORMREF_FOOTNOTES = "//preface//fn | "\
14
- "//clause[title = 'Scope']//fn".freeze
13
+ "//clause[@type = 'scope']//fn".freeze
15
14
 
16
15
  NORMREF_FOOTNOTES =
17
16
  "//references[@normative = 'true']//fn".freeze
18
17
 
19
18
  POST_NORMREF_FOOTNOTES =
20
- "//sections//clause[not(title = 'Scope')]//fn | "\
19
+ "//sections//clause[not(@type = 'scope')]//fn | "\
21
20
  "//annex//fn | "\
22
21
  "//references[@normative = 'false']//fn".freeze
23
22
 
@@ -4,7 +4,6 @@ require "htmlentities"
4
4
  require "json"
5
5
  require "pathname"
6
6
  require "open-uri"
7
- require "pp"
8
7
  require_relative "front_id"
9
8
 
10
9
  module Asciidoctor
@@ -35,7 +34,7 @@ module Asciidoctor
35
34
 
36
35
  def metadata_author(node, xml)
37
36
  publishers = node.attr("publisher") || "ISO"
38
- publishers.split(/,[ ]?/).each do |p|
37
+ csv_split(publishers).each do |p|
39
38
  xml.contributor do |c|
40
39
  c.role **{ type: "author" }
41
40
  c.organization { |a| organization(a, p) }
@@ -45,7 +44,7 @@ module Asciidoctor
45
44
 
46
45
  def metadata_publisher(node, xml)
47
46
  publishers = node.attr("publisher") || "ISO"
48
- publishers.split(/,[ ]?/).each do |p|
47
+ csv_split(publishers).each do |p|
49
48
  xml.contributor do |c|
50
49
  c.role **{ type: "publisher" }
51
50
  c.organization { |a| organization(a, p) }
@@ -54,8 +53,8 @@ module Asciidoctor
54
53
  end
55
54
 
56
55
  def metadata_copyright(node, xml)
57
- publishers = node.attr("publisher") || "ISO"
58
- publishers.split(/,[ ]?/).each do |p|
56
+ publishers = node.attr("copyright-holder") || node.attr("publisher") || "ISO"
57
+ csv_split(publishers).each do |p|
59
58
  xml.copyright do |c|
60
59
  c.from (node.attr("copyright-year") || Date.today.year)
61
60
  c.owner do |owner|
@@ -133,7 +133,7 @@ module Asciidoctor
133
133
  end
134
134
 
135
135
  def id_stage_abbr(stage, substage, node)
136
- ret = IsoDoc::Iso::Metadata.new("en", "Latn", {}).
136
+ ret = IsoDoc::Iso::Metadata.new("en", "Latn", @i18n).
137
137
  status_abbrev(stage_abbr(stage, substage, node.attr("doctype")),
138
138
  substage, node.attr("iteration"),
139
139
  node.attr("draft"), node.attr("doctype"))
@@ -922,6 +922,9 @@
922
922
  <optional>
923
923
  <attribute name="script"/>
924
924
  </optional>
925
+ <optional>
926
+ <attribute name="type"/>
927
+ </optional>
925
928
  <optional>
926
929
  <attribute name="obligation">
927
930
  <choice>
@@ -961,9 +964,6 @@
961
964
  </define>
962
965
  <define name="content-subsection">
963
966
  <element name="clause">
964
- <optional>
965
- <attribute name="type"/>
966
- </optional>
967
967
  <ref name="Content-Section"/>
968
968
  </element>
969
969
  </define>
@@ -992,6 +992,9 @@
992
992
  </choice>
993
993
  </attribute>
994
994
  </optional>
995
+ <optional>
996
+ <attribute name="type"/>
997
+ </optional>
995
998
  <optional>
996
999
  <ref name="section-title"/>
997
1000
  </optional>
@@ -1011,9 +1014,6 @@
1011
1014
  </define>
1012
1015
  <define name="clause">
1013
1016
  <element name="clause">
1014
- <optional>
1015
- <attribute name="type"/>
1016
- </optional>
1017
1017
  <ref name="Clause-Section"/>
1018
1018
  </element>
1019
1019
  </define>
@@ -1042,6 +1042,9 @@
1042
1042
  </choice>
1043
1043
  </attribute>
1044
1044
  </optional>
1045
+ <optional>
1046
+ <attribute name="type"/>
1047
+ </optional>
1045
1048
  <optional>
1046
1049
  <ref name="section-title"/>
1047
1050
  </optional>
@@ -1180,6 +1183,9 @@
1180
1183
  <optional>
1181
1184
  <attribute name="script"/>
1182
1185
  </optional>
1186
+ <optional>
1187
+ <attribute name="type"/>
1188
+ </optional>
1183
1189
  <optional>
1184
1190
  <attribute name="obligation">
1185
1191
  <choice>
@@ -5,13 +5,15 @@ module Asciidoctor
5
5
  module ISO
6
6
  class Converter < Standoc::Converter
7
7
  def clause_parse(attrs, xml, node)
8
- title = node&.attr("heading")&.downcase ||
9
- node.title.gsub(/<[^>]+>/, "").downcase
10
- title == "scope" and return scope_parse(attrs, xml, node)
11
8
  node.option? "appendix" and return appendix_parse(attrs, xml, node)
12
9
  super
13
10
  end
14
11
 
12
+ def scope_parse(attrs, xml, node)
13
+ attrs = attrs.merge(type: "scope") unless @amd
14
+ clause_parse(attrs, xml, node)
15
+ end
16
+
15
17
  def appendix_parse(attrs, xml, node)
16
18
  attrs["inline-header".to_sym] = node.option? "inline-header"
17
19
  set_obligation(attrs, node)
@@ -28,14 +30,6 @@ module Asciidoctor
28
30
  xml << node.content
29
31
  end
30
32
 
31
- def scope_parse(attrs, xml, node)
32
- xml.clause **attr_code(attrs) do |xml_section|
33
- xml_section.title { |t| t << "Scope" }
34
- content = node.content
35
- xml_section << content
36
- end
37
- end
38
-
39
33
  def section_attributes(node)
40
34
  super.merge(
41
35
  change: @amd ? node.attr("change") : nil,
@@ -75,7 +75,6 @@ module Asciidoctor
75
75
 
76
76
  def unique_text_id(text)
77
77
  return "term-#{text}" if xmldoc.at("//*[@id = 'term-#{text}']").nil?
78
-
79
78
  (1..Float::INFINITY).lazy.each do |index|
80
79
  if xmldoc.at("//*[@id = 'term-#{text}-#{index}']").nil?
81
80
  break("term-#{text}-#{index}")
@@ -7,6 +7,7 @@ module Asciidoctor
7
7
  foreword_validate(doc.root)
8
8
  normref_validate(doc.root)
9
9
  symbols_validate(doc.root)
10
+ sections_presence_validate(doc.root)
10
11
  sections_sequence_validate(doc.root)
11
12
  section_style(doc.root)
12
13
  subclause_validate(doc.root)
@@ -46,46 +47,44 @@ module Asciidoctor
46
47
  end
47
48
 
48
49
  def seqcheck(names, msg, accepted)
49
- n = names.shift
50
- unless accepted.include? n
50
+ n = names.shift
51
+ return [] if n.nil?
52
+ test = accepted.map { |a| n.at(a) }
53
+ if test.all? { |a| a.nil? }
51
54
  @log.add("Style", nil, msg)
52
- names = []
53
55
  end
54
56
  names
55
57
  end
56
58
 
59
+ def sections_presence_validate(root)
60
+ root.at("//sections/clause[@type = 'scope']") or
61
+ @log.add("Style", nil, "Scope clause missing")
62
+ root.at("//references[@normative = 'true']") or
63
+ @log.add("Style", nil, "Normative references missing")
64
+ root.at("//terms") or
65
+ @log.add("Style", nil, "Terms & definitions missing")
66
+ end
67
+
57
68
  # spec of permissible section sequence
58
69
  # we skip normative references, it goes to end of list
59
70
  SEQ =
60
71
  [
61
72
  {
62
73
  msg: "Initial section must be (content) Foreword",
63
- val: [{ tag: "foreword", title: "Foreword" }],
74
+ val: ["./self::foreword"]
64
75
  },
65
76
  {
66
77
  msg: "Prefatory material must be followed by (clause) Scope",
67
- val: [{ tag: "introduction", title: "Introduction" },
68
- { tag: "clause", title: "Scope" }],
78
+ val: ["./self::introduction", "./self::clause[@type = 'scope']" ]
69
79
  },
70
80
  {
71
81
  msg: "Prefatory material must be followed by (clause) Scope",
72
- val: [{ tag: "clause", title: "Scope" }],
82
+ val: ["./self::clause[@type = 'scope']" ]
73
83
  },
74
84
  {
75
85
  msg: "Normative References must be followed by "\
76
86
  "Terms and Definitions",
77
- val: [
78
- { tag: "terms", title: "Terms and definitions" },
79
- { tag: "clause", title: "Terms and definitions" },
80
- {
81
- tag: "terms",
82
- title: "Terms, definitions, symbols and abbreviated terms",
83
- },
84
- {
85
- tag: "clause",
86
- title: "Terms, definitions, symbols and abbreviated terms",
87
- },
88
- ],
87
+ val: ["./self::terms | .//terms"]
89
88
  },
90
89
  ].freeze
91
90
 
@@ -95,50 +94,47 @@ module Asciidoctor
95
94
  "//clause[descendant::references][not(parent::clause)]".freeze
96
95
 
97
96
  def sections_sequence_validate(root)
98
- f = root.xpath(SECTIONS_XPATH)
99
- names = f.map { |s| { tag: s.name, title: s&.at("./title")&.text } }
100
- names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val]) || return
97
+ names = root.xpath(SECTIONS_XPATH)
98
+ names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val])
101
99
  n = names[0]
102
- names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val]) || return
103
- if n == { tag: "introduction", title: "Introduction" }
104
- names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val]) || return
100
+ names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val])
101
+ if n&.at("./self::introduction")
102
+ names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val])
105
103
  end
106
- names = seqcheck(names, SEQ[3][:msg], SEQ[3][:val]) || return
104
+ names = seqcheck(names, SEQ[3][:msg], SEQ[3][:val])
107
105
  n = names.shift
108
- if n == { tag: "definitions", title: nil }
109
- n = names.shift || return
106
+ if n&.at("./self::definitions")
107
+ n = names.shift
110
108
  end
111
- unless n
109
+ if n.nil? || n.name != "clause"
112
110
  @log.add("Style", nil, "Document must contain at least one clause")
113
- return
114
111
  end
115
- n[:tag] == "clause" ||
112
+ n&.at("./self::clause") ||
116
113
  @log.add("Style", nil, "Document must contain clause after "\
117
114
  "Terms and Definitions")
118
- n == { tag: "clause", title: "Scope" } &&
115
+ n&.at("./self::clause[@type = 'scope']") &&
119
116
  @log.add("Style", nil, "Scope must occur before Terms and Definitions")
120
- n = names.shift || return
121
- while n[:tag] == "clause"
122
- n[:title] == "Scope" &&
117
+ n = names.shift
118
+ while n&.name == "clause"
119
+ n&.at("./self::clause[@type = 'scope']")
123
120
  @log.add("Style", nil, "Scope must occur before Terms and Definitions")
124
- n = names.shift || return
121
+ n = names.shift
125
122
  end
126
- unless n[:tag] == "annex" || n[:tag] == "references"
123
+ unless %w(annex references).include? n&.name
127
124
  @log.add("Style", nil, "Only annexes and references can follow clauses")
128
125
  end
129
- while n[:tag] == "annex"
126
+ while n&.name == "annex"
130
127
  n = names.shift
131
128
  if n.nil?
132
129
  @log.add("Style", nil, "Document must include (references) "\
133
130
  "Normative References")
134
- return
135
131
  end
136
132
  end
137
- n == { tag: "references", title: "Normative References" } ||
133
+ n&.at("./self::references[@normative = 'true']") ||
138
134
  @log.add("Style", nil, "Document must include (references) "\
139
135
  "Normative References")
140
- n = names.shift
141
- n == { tag: "references", title: "Bibliography" } ||
136
+ n = names&.shift
137
+ n&.at("./self::references[@normative = 'false']") ||
142
138
  @log.add("Style", nil, "Final section must be (references) Bibliography")
143
139
  names.empty? ||
144
140
  @log.add("Style", nil, "There are sections after the final Bibliography")
@@ -157,8 +153,8 @@ module Asciidoctor
157
153
  def section_style(root)
158
154
  foreword_style(root.at("//foreword"))
159
155
  introduction_style(root.at("//introduction"))
160
- scope_style(root.at("//clause[title = 'Scope']"))
161
- scope = root.at("//clause[title = 'Scope']/clause")
156
+ scope_style(root.at("//clause[@type = 'scope']"))
157
+ scope = root.at("//clause[@type = 'scope']/clause")
162
158
  # ISO/IEC DIR 2, 14.4
163
159
  scope.nil? || style_warning(scope, SCOPE_WARN, nil)
164
160
  end
@@ -1,25 +1,10 @@
1
1
  require "isodoc"
2
- require_relative "metadata"
3
2
  require_relative "sections"
4
- require_relative "xref"
5
3
  require "fileutils"
6
4
 
7
5
  module IsoDoc
8
6
  module Iso
9
7
  module BaseConvert
10
- def metadata_init(lang, script, labels)
11
- @meta = Metadata.new(lang, script, labels)
12
- end
13
-
14
- def xref_init(lang, script, klass, labels, options)
15
- @xrefs = Xref.new(lang, script, klass, labels, options)
16
- end
17
-
18
- def amd(docxml)
19
- doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
20
- %w(amendment technical-corrigendum).include? doctype
21
- end
22
-
23
8
  def convert1(docxml, filename, dir)
24
9
  if amd(docxml)
25
10
  @oldsuppressheadingnumbers = @suppressheadingnumbers
@@ -41,46 +26,10 @@ module IsoDoc
41
26
  end
42
27
  end
43
28
 
44
- def eref_localities1_zh(target, type, from, to, delim)
45
- subsection = from&.text&.match(/\./)
46
- ret = (delim == ";") ? ";" : (type == "list") ? "" : delim
47
- ret += " 第#{from.text}" if from
48
- ret += "&ndash;#{to}" if to
49
- loc = (@locality[type] || type.sub(/^locality:/, "").capitalize )
50
- ret += " #{loc}" unless subsection && type == "clause" ||
51
- type == "list" || target.match(/^IEV$|^IEC 60050-/)
52
- ret += ")" if type == "list"
53
- ret
54
- end
55
-
56
- def eref_localities1(target, type, from, to, delim, lang = "en")
57
- return "" if type == "anchor"
58
- subsection = from&.text&.match(/\./)
59
- type = type.downcase
60
- return l10n(eref_localities1_zh(target, type, from, to, delim)) if lang == "zh"
61
- ret = (delim == ";") ? ";" : (type == "list") ? "" : delim
62
- loc = @locality[type] || type.sub(/^locality:/, "").capitalize
63
- ret += " #{loc}" unless subsection && type == "clause" ||
64
- type == "list" || target.match(/^IEV$|^IEC 60050-/)
65
- ret += " #{from.text}" if from
66
- ret += "&ndash;#{to.text}" if to
67
- ret += ")" if type == "list"
68
- l10n(ret)
69
- end
70
-
71
- def prefix_container(container, linkend, target)
72
- delim = @xrefs.anchor(target, :type) == "listitem" ? " " : ", "
73
- l10n(@xrefs.anchor(container, :xref) + delim + linkend)
74
- end
75
-
76
29
  def example_span_label(node, div, name)
77
- n = @xrefs.get[node["id"]]
30
+ return if name.nil?
78
31
  div.span **{ class: "example_label" } do |p|
79
- lbl = (n.nil? || n[:label].nil? || n[:label].empty?) ? @example_lbl :
80
- l10n("#{@example_lbl} #{n[:label]}")
81
- p << lbl
82
- name and !lbl.nil? and p << "&nbsp;&mdash; "
83
- name and name.children.each { |n| parse(n, div) }
32
+ name.children.each { |n| parse(n, div) }
84
33
  end
85
34
  end
86
35
 
@@ -142,10 +91,6 @@ module IsoDoc
142
91
  super
143
92
  end
144
93
 
145
- def clausedelim
146
- ""
147
- end
148
-
149
94
  def cleanup(docxml)
150
95
  super
151
96
  table_th_center(docxml)
@@ -165,7 +110,7 @@ module IsoDoc
165
110
  dl&.at(ns("./dd"))&.elements&.size == 1 &&
166
111
  dl&.at(ns("./dd/p")))
167
112
  out.span **{ class: "zzMoveToFollowing" } do |s|
168
- s << "#{@where_lbl} "
113
+ s << "#{@i18n.where} "
169
114
  dl.at(ns("./dt")).children.each { |n| parse(n, s) }
170
115
  s << " "
171
116
  end
@@ -202,13 +147,7 @@ module IsoDoc
202
147
  end
203
148
 
204
149
  def figure_name_parse(node, div, name)
205
- lbl = @xrefs.anchor(node['id'], :label, false)
206
- lbl = nil if labelled_ancestor(node) && node.ancestors("figure").empty?
207
- return if lbl.nil? && name.nil?
208
150
  div.p **{ class: "FigureTitle", style: "text-align:center;" } do |p|
209
- figname = node.parent.name == "figure" ? "" : "#{@figure_lbl} "
210
- lbl.nil? or p << l10n("#{figname}#{lbl}")
211
- name and !lbl.nil? and p << "&nbsp;&mdash; "
212
151
  name and name.children.each { |n| parse(n, div) }
213
152
  end
214
153
  end