metanorma-itu 1.3.6 → 1.3.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,109 @@
1
+ module IsoDoc
2
+ module ITU
3
+ class Xref < IsoDoc::Xref
4
+ def annextype(clause)
5
+ if clause["obligation"] == "informative" then @labels["appendix"]
6
+ else @labels["annex"]
7
+ end
8
+ end
9
+
10
+ def annex_name_lbl(clause, num)
11
+ lbl = annextype(clause)
12
+ if @doctype == "resolution"
13
+ l10n("#{lbl.upcase} #{num}")
14
+ else
15
+ l10n("<strong>#{lbl} #{num}</strong>")
16
+ end
17
+ end
18
+
19
+ def annex_names(clause, num)
20
+ lbl = annextype(clause)
21
+ @anchors[clause["id"]] =
22
+ { label: annex_name_lbl(clause, num), type: "clause",
23
+ xref: l10n("#{lbl} #{num}"), level: 1, value: num }
24
+ if a = single_annex_special_section(clause)
25
+ annex_names1(a, num.to_s, 1)
26
+ else
27
+ i = Counter.new
28
+ clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
29
+ .each do |c|
30
+ i.increment(c)
31
+ annex_names1(c, "#{num}.#{i.print}", 2)
32
+ end
33
+ end
34
+ hierarchical_asset_names(clause, num)
35
+ end
36
+
37
+ def annex_names1(clause, num, level)
38
+ @anchors[clause["id"]] =
39
+ { label: num,
40
+ xref: @doctype == "resolution" ? num : l10n("#{@labels['annex_subclause']} #{num}"),
41
+ level: level, type: "clause" }
42
+ i = Counter.new
43
+ clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
44
+ .each do |c|
45
+ i.increment(c)
46
+ annex_names1(c, "#{num}.#{i.print}", level + 1)
47
+ end
48
+ end
49
+
50
+ def clause_names(docxml, sect_num)
51
+ docxml.xpath(ns("//sections/clause[not(@unnumbered = 'true')]"\
52
+ "[not(@type = 'scope')][not(descendant::terms)]"))
53
+ .each do |c|
54
+ section_names(c, sect_num, 1)
55
+ end
56
+ docxml.xpath(ns("//sections/clause[@unnumbered = 'true']")).each do |c|
57
+ unnumbered_section_names(c, 1)
58
+ end
59
+ end
60
+
61
+ def section_names(clause, num, lvl)
62
+ return num if clause.nil?
63
+
64
+ num.increment(clause)
65
+ lbl = @doctype == "resolution" ? @labels["section"] : @labels["clause"]
66
+ @anchors[clause["id"]] =
67
+ { label: num.print, xref: l10n("#{lbl} #{num.print}"),
68
+ level: lvl, type: "clause" }
69
+ i = Counter.new
70
+ clause.xpath(ns(SUBCLAUSES)).each do |c|
71
+ i.increment(c)
72
+ section_names1(c, "#{num.print}.#{i.print}", lvl + 1)
73
+ end
74
+ num
75
+ end
76
+
77
+ def section_names1(clause, num, level)
78
+ @anchors[clause["id"]] =
79
+ { label: num, level: level,
80
+ xref: @doctype == "resolution" ? num : l10n("#{@labels['clause']} #{num}") }
81
+ i = Counter.new
82
+ clause.xpath(ns(SUBCLAUSES)).each do |c|
83
+ i.increment(c)
84
+ section_names1(c, "#{num}.#{i.print}", level + 1)
85
+ end
86
+ end
87
+
88
+ def unnumbered_section_names(clause, lvl)
89
+ return if clause.nil?
90
+
91
+ lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
92
+ @anchors[clause["id"]] =
93
+ { label: lbl, xref: l10n(%{"#{lbl}"}), level: lvl, type: "clause" }
94
+ clause.xpath(ns(SUBCLAUSES)).each do |c|
95
+ unnumbered_section_names1(c, lvl + 1)
96
+ end
97
+ end
98
+
99
+ def unnumbered_section_names1(clause, level)
100
+ lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
101
+ @anchors[clause["id"]] =
102
+ { label: lbl, xref: l10n(%{"#{lbl}"}), level: level, type: "clause" }
103
+ clause.xpath(ns(SUBCLAUSES)).each do |c|
104
+ unnumbered_section_names1(c, level + 1)
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
@@ -21,10 +21,10 @@ module Metanorma
21
21
  def fonts_manifest
22
22
  {
23
23
  "Arial" => nil,
24
- "Courier" => nil,
25
24
  "Courier New" => nil,
26
25
  "Times New Roman" => nil,
27
26
  "Source Han Sans" => nil,
27
+ "Source Han Sans Normal" => nil,
28
28
  "STIX Two Math" => nil,
29
29
  }
30
30
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.3.6".freeze
3
+ VERSION = "1.3.10".freeze
4
4
  end
5
5
  end
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.3.6
4
+ version: 1.3.10
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-07-05 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -333,6 +333,7 @@ files:
333
333
  - lib/isodoc/itu/itu.recommendation-supplement.xsl
334
334
  - lib/isodoc/itu/itu.recommendation.xsl
335
335
  - lib/isodoc/itu/itu.resolution.xsl
336
+ - lib/isodoc/itu/itu.service-publication.xsl
336
337
  - lib/isodoc/itu/itu.technical-paper.xsl
337
338
  - lib/isodoc/itu/itu.technical-report.xsl
338
339
  - lib/isodoc/itu/metadata.rb
@@ -343,6 +344,7 @@ files:
343
344
  - lib/isodoc/itu/word_cleanup.rb
344
345
  - lib/isodoc/itu/word_convert.rb
345
346
  - lib/isodoc/itu/xref.rb
347
+ - lib/isodoc/itu/xref_section.rb
346
348
  - lib/metanorma-itu.rb
347
349
  - lib/metanorma/itu.rb
348
350
  - lib/metanorma/itu/processor.rb