metanorma-itu 1.2.11 → 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -148,7 +148,7 @@ module IsoDoc
148
148
  t = f.at(ns("./title")) and t["depth"] = "1"
149
149
  lbl = @xrefs.anchor(f['id'], :label, false) or return
150
150
  f.elements.first.previous =
151
- "<p align='center' keep-with-next='true'>#{@i18n.get['section'].upcase} #{lbl}</p>"
151
+ "<p keep-with-next='true' class='supertitle'>#{@i18n.get['section'].upcase} #{lbl}</p>"
152
152
  end
153
153
 
154
154
  def annex1(f)
@@ -156,7 +156,7 @@ module IsoDoc
156
156
  lbl = @xrefs.anchor(f['id'], :label)
157
157
  subhead = (@i18n.l10n("(#{@i18n.get['to']} ") +
158
158
  f.at(ns("//bibdata/title[@type = 'resolution']")).children.to_xml + @i18n.l10n(")"))
159
- f.elements.first.previous = "<p align='center'>#{lbl}<br/>#{subhead}</p>"
159
+ f.elements.first.previous = "<p class='supertitle'>#{lbl}<br/>#{subhead}</p>"
160
160
  if t = f.at(ns("./title"))
161
161
  t.children = "<strong>#{t.children.to_xml}</strong>"
162
162
  end
@@ -74,9 +74,9 @@ module IsoDoc
74
74
  end
75
75
 
76
76
  def default_fonts(options)
77
- { bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
77
+ { bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' :
78
78
  '"Times New Roman",serif'),
79
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
79
+ headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' :
80
80
  '"Times New Roman",serif'),
81
81
  monospacefont: '"Courier New",monospace',
82
82
  normalfontsize: "12.0pt",
@@ -4,6 +4,10 @@ require "fileutils"
4
4
  module IsoDoc
5
5
  module ITU
6
6
  class Counter < IsoDoc::XrefGen::Counter
7
+ def print
8
+ super.sub(/([0-9])(bis|ter|quater|quinquies|sexies|septies|octies|nonies)$/,
9
+ "\\1<em>\\2</em>")
10
+ end
7
11
  end
8
12
 
9
13
  class Xref < IsoDoc::Xref
@@ -104,7 +108,7 @@ module IsoDoc
104
108
  end
105
109
 
106
110
  def sequential_figure_names(clause)
107
- c = IsoDoc::XrefGen::Counter.new
111
+ c = Counter.new
108
112
  j = 0
109
113
  clause.xpath(ns(".//figure | .//sourcecode[not(ancestor::example)]")).each do |t|
110
114
  if t.parent.name == "figure" then j += 1
@@ -119,7 +123,7 @@ module IsoDoc
119
123
  end
120
124
 
121
125
  def hierarchical_figure_names(clause, num)
122
- c = IsoDoc::XrefGen::Counter.new
126
+ c = Counter.new
123
127
  j = 0
124
128
  clause.xpath(ns(".//figure | .//sourcecode[not(ancestor::example)]")).each do |t|
125
129
  if t.parent.name == "figure" then j += 1
@@ -144,7 +148,7 @@ module IsoDoc
144
148
  end
145
149
 
146
150
  def hierarchical_formula_names(clause, num)
147
- c = IsoDoc::XrefGen::Counter.new
151
+ c = Counter.new
148
152
  clause.xpath(ns(".//formula")).each do |t|
149
153
  next if t["id"].nil? || t["id"].empty?
150
154
  @anchors[t["id"]] = anchor_struct(
@@ -160,7 +164,7 @@ module IsoDoc
160
164
 
161
165
  def termnote_anchor_names(docxml)
162
166
  docxml.xpath(ns("//term[descendant::termnote]")).each do |t|
163
- c = IsoDoc::XrefGen::Counter.new
167
+ c = Counter.new
164
168
  notes = t.xpath(ns(".//termnote"))
165
169
  notes.each do |n|
166
170
  return if n["id"].nil? || n["id"].empty?
@@ -173,7 +177,7 @@ module IsoDoc
173
177
  end
174
178
 
175
179
  def clause_names(docxml, sect_num)
176
- docxml.xpath(ns("//sections/clause[not(@unnumbered = 'true')][not(@type = 'scope')]")).
180
+ docxml.xpath(ns("//sections/clause[not(@unnumbered = 'true')][not(@type = 'scope')][not(descendant::terms)]")).
177
181
  each do |c|
178
182
  section_names(c, sect_num, 1)
179
183
  end
@@ -212,7 +216,7 @@ module IsoDoc
212
216
  lbl = clause&.at(ns("./title"))&.text || "[#{clause["id"]}]"
213
217
  @anchors[clause["id"]] =
214
218
  { label: lbl, xref: l10n(%{"#{lbl}"}), level: lvl, type: "clause" }
215
- clause.xpath(ns(SUBCLAUSES)).each_with_index do |c, i|
219
+ clause.xpath(ns(SUBCLAUSES)).each do |c|
216
220
  unnumbered_section_names1(c, lvl + 1)
217
221
  end
218
222
  end
@@ -24,6 +24,7 @@ module Metanorma
24
24
  "Courier" => nil,
25
25
  "Courier New" => nil,
26
26
  "Times New Roman" => nil,
27
+ "Source Han Sans" => nil,
27
28
  "STIX Two Math" => nil,
28
29
  }
29
30
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.2.11"
3
+ VERSION = "1.2.12"
4
4
  end
5
5
  end
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_dependency "htmlentities", "~> 4.3.4"
28
28
  spec.add_dependency "ruby-jing"
29
- spec.add_dependency "metanorma-standoc", "~> 1.7.0"
30
- spec.add_dependency "isodoc", "~> 1.4.2"
29
+ spec.add_dependency "metanorma-standoc", "~> 1.8.0"
30
+ spec.add_dependency "isodoc", "~> 1.5.0"
31
31
  spec.add_dependency "twitter_cldr"
32
32
  spec.add_dependency "tzinfo-data" # we need this for windows only
33
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.11
4
+ version: 1.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.7.0
47
+ version: 1.8.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.7.0
54
+ version: 1.8.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: isodoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.4.2
61
+ version: 1.5.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.4.2
68
+ version: 1.5.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: twitter_cldr
71
71
  requirement: !ruby/object:Gem::Requirement