metanorma-itu 2.5.6 → 2.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/itu/base_convert.rb +12 -30
  3. data/lib/isodoc/itu/cleanup.rb +1 -1
  4. data/lib/isodoc/itu/i18n-ar.yaml +2 -2
  5. data/lib/isodoc/itu/i18n-de.yaml +2 -2
  6. data/lib/isodoc/itu/i18n-en.yaml +2 -2
  7. data/lib/isodoc/itu/i18n-es.yaml +2 -2
  8. data/lib/isodoc/itu/i18n-fr.yaml +2 -2
  9. data/lib/isodoc/itu/i18n-ru.yaml +2 -2
  10. data/lib/isodoc/itu/i18n-zh-Hans.yaml +2 -2
  11. data/lib/isodoc/itu/init.rb +2 -2
  12. data/lib/isodoc/itu/itu.implementers-guide.xsl +727 -196
  13. data/lib/isodoc/itu/itu.in-force.xsl +727 -196
  14. data/lib/isodoc/itu/itu.recommendation-annex.xsl +727 -196
  15. data/lib/isodoc/itu/itu.recommendation-supplement.xsl +727 -196
  16. data/lib/isodoc/itu/itu.recommendation.xsl +727 -196
  17. data/lib/isodoc/itu/itu.resolution.xsl +727 -196
  18. data/lib/isodoc/itu/itu.service-publication.xsl +727 -196
  19. data/lib/isodoc/itu/itu.technical-paper.xsl +727 -196
  20. data/lib/isodoc/itu/itu.technical-report.xsl +727 -196
  21. data/lib/isodoc/itu/presentation_contribution.rb +1 -0
  22. data/lib/isodoc/itu/presentation_preface.rb +2 -1
  23. data/lib/isodoc/itu/presentation_ref.rb +29 -2
  24. data/lib/isodoc/itu/presentation_xml_convert.rb +85 -25
  25. data/lib/isodoc/itu/ref.rb +5 -33
  26. data/lib/isodoc/itu/terms.rb +4 -17
  27. data/lib/isodoc/itu/word_cleanup.rb +2 -2
  28. data/lib/isodoc/itu/word_convert.rb +5 -5
  29. data/lib/isodoc/itu/xref.rb +47 -17
  30. data/lib/isodoc/itu/xref_section.rb +42 -20
  31. data/lib/metanorma/itu/biblio.rng +13 -1
  32. data/lib/metanorma/itu/isodoc.rng +6 -6
  33. data/lib/metanorma/itu/version.rb +1 -1
  34. data/lib/nokogiri/xml.rb +10 -0
  35. data/metanorma-itu.gemspec +1 -1
  36. metadata +5 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bcca39daa471be9099854e87a81ecce4c146a479cb380becb63719869d43bc8
4
- data.tar.gz: 612f4eb3446450c32b54ea1393446183dfacf5fdb9313ca39742e89bbb729840
3
+ metadata.gz: 07febc1da79ed58da9a7ec29a626c5612d5a54da9e77003b7adf70531f9738ca
4
+ data.tar.gz: 760aa9b1e6bbf86f9ec4f127519ba5d9a6493020ef5ee281c8010a5d57607136
5
5
  SHA512:
6
- metadata.gz: 841a1368e8ca1a9a71b3cb8c6993491251896581b8e11282d0456b9a433153a4467030d4bcb9ea3f370c04ea41967949897bb554c9e2203f5a587b13446951b8
7
- data.tar.gz: d451dd6a95d4e53f862f9005ee61c05280e4b9f433809beedfb9091cd0ca9291bda146187d33e33c84fdae1d43eb6c201d60117392a88a6df59fd7de135e95a6
6
+ metadata.gz: 0d3e2e0eef213be48fb71f1bb4f0582b4cabcc95a770ef2fd7cdf4d5f8f7b5fb1e3155acea1d2c256b5ecc500919fd4927bf5c1b3829cb340ea6972a964f31b0
7
+ data.tar.gz: fd6cc9a7c452b97962bd84797e3394c3211c27d49cc5220e755bda5ebf2fc229e1c25b9a497fbdc86fb1a356a6cd3d5ff2349df968075df94889f27f06938aa5
@@ -12,10 +12,10 @@ module IsoDoc
12
12
  "[not(local-name() = 'abstract')]".freeze
13
13
 
14
14
  def introduction(clause, out)
15
- title = clause.at(ns("./title"))
15
+ title = clause.at(ns("./fmt-title"))
16
16
  out.div **attr_code(clause_attrs(clause)) do |s|
17
17
  clause_name(clause, title, s, class: "IntroTitle")
18
- clause.elements.reject { |c1| c1.name == "title" }.each do |c1|
18
+ clause.elements.reject { |c1| c1.name == "fmt-title" }.each do |c1|
19
19
  parse(c1, s)
20
20
  end
21
21
  end
@@ -37,13 +37,8 @@ module IsoDoc
37
37
  ""
38
38
  end
39
39
 
40
- def note_delim
41
- " – "
42
- end
43
-
44
40
  def para_class(node)
45
- return "supertitle" if node["class"] == "supertitle"
46
-
41
+ node["class"] == "supertitle" and return "supertitle"
47
42
  super
48
43
  end
49
44
 
@@ -59,30 +54,20 @@ module IsoDoc
59
54
  ol_style(type)
60
55
  end
61
56
 
62
- def annex_name(annex, name, div)
57
+ def annex_name(_annex, name, div)
63
58
  r_a = @meta.get[:doctype_original] == "recommendation-annex"
64
59
  div.h1 class: r_a ? "RecommendationAnnex" : "Annex" do |t|
65
60
  name&.children&.each { |c2| parse(c2, t) }
66
61
  end
67
- @meta.get[:doctype_original] == "resolution" or
68
- annex_obligation_subtitle(annex, div)
69
- end
70
-
71
- def annex_obligation_subtitle(annex, div)
72
- info = annex["obligation"] == "informative"
73
- div.p class: "annex_obligation" do |p|
74
- p << (info ? @i18n.inform_annex : @i18n.norm_annex)
75
- .sub("%", @meta.get[:doctype] || "")
76
- end
77
62
  end
78
63
 
79
64
  def annex(node, out)
80
65
  @meta.get[:doctype_original] == "recommendation-annex" or
81
66
  page_break(out)
82
67
  out.div **attr_code(id: node["id"], class: "Section3") do |s|
83
- annex_name(node, nil, s) unless node.at(ns("./title"))
68
+ annex_name(node, nil, s) unless node.at(ns("./fmt-title"))
84
69
  node.elements.each do |c1|
85
- if c1.name == "title" then annex_name(node, c1, s)
70
+ if c1.name == "fmt-title" then annex_name(node, c1, s)
86
71
  else
87
72
  parse(c1, s)
88
73
  end
@@ -97,19 +82,20 @@ module IsoDoc
97
82
  super
98
83
  end
99
84
 
100
- def note_p_parse(node, div)
85
+ # TODO kill
86
+ def note_p_parsex(node, div)
101
87
  name = node.at(ns("./name"))&.remove
102
88
  div.p do |p|
103
89
  name and p.span class: "note_label" do |s|
104
90
  name.children.each { |n| parse(n, s) }
105
- s << note_delim
106
91
  end
107
92
  node.first_element_child.children.each { |n| parse(n, p) }
108
93
  end
109
94
  node.element_children[1..-1].each { |n| parse(n, div) }
110
95
  end
111
96
 
112
- def note_parse1(node, div)
97
+ # TODO kill
98
+ def note_parse1x(node, div)
113
99
  name = node.at(ns("./name"))&.remove
114
100
  div.p do |p|
115
101
  name and p.span class: "note_label" do |s|
@@ -119,10 +105,6 @@ module IsoDoc
119
105
  node.children.each { |n| parse(n, div) }
120
106
  end
121
107
 
122
- def table_footnote_reference_format(node)
123
- node.content += ")"
124
- end
125
-
126
108
  def note_parse(node, out)
127
109
  node["type"] == "title-footnote" and return
128
110
  super
@@ -139,7 +121,7 @@ module IsoDoc
139
121
  def clause(clause, out)
140
122
  out.div **attr_code(clause_attrs(clause)) do |s|
141
123
  clause.elements.each do |c1|
142
- if c1.name == "title" then clause_name(clause, c1, s, nil)
124
+ if c1.name == "fmt-title" then clause_name(clause, c1, s, nil)
143
125
  else
144
126
  parse(c1, s)
145
127
  end
@@ -156,7 +138,7 @@ module IsoDoc
156
138
  def dl1(dlist)
157
139
  ret = dl2tbody(dlist)
158
140
  n = dlist.at(ns("./colgroup")) and ret = "#{n.remove.to_xml}#{ret}"
159
- n = dlist.at(ns("./name")) and ret = "#{n.remove.to_xml}#{ret}"
141
+ n = dlist.at(ns("./fmt-name")) and ret = "#{n.remove.to_xml}#{ret}"
160
142
  dlist.name = "table"
161
143
  dlist["class"] = "dl"
162
144
  dlist.children.first.previous = ret
@@ -25,7 +25,7 @@ module IsoDoc
25
25
  def term_cleanup1(docxml)
26
26
  docxml.xpath("//p[@class = 'Terms']").each do |d|
27
27
  h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
28
- d.children.first.previous = "<b>#{h2.children.to_xml}</b>&#xa0;"
28
+ d.add_first_child "<b>#{h2.children.to_xml}</b>&#xa0;"
29
29
  d["id"] = h2["id"]
30
30
  h2.remove
31
31
  end
@@ -10,7 +10,7 @@ termsdef: مصطلحات معرفة
10
10
  termsdefsymbolsabbrev: تعريف
11
11
  termsdefsymbols: تعريف
12
12
  termsdefabbrev: تعريف
13
- termnote: ملاحظة
13
+ termnote: <span class='fmt-element-name'>ﻡﻼﺤﻇﺓ</span> ؜%؜
14
14
  normref: المراجع المعيارية
15
15
  symbolsabbrev: اختصار
16
16
  abbrev: اختصار
@@ -31,7 +31,7 @@ annex_subclause: فقرة
31
31
  keywords: الكلمات الدالة
32
32
  in: في
33
33
  to: إلى
34
- nested_xref: "%2 في %1"
34
+ nested_xref: "%2 <conn>ﻒﻳ</conn> %1"
35
35
  where: ":حيث,"
36
36
  where_one: "حيث,"
37
37
  blankclause: تم ترك هذا الشرط فارغًا عمدًا
@@ -10,7 +10,7 @@ termsdef: Definitionen
10
10
  termsdefsymbolsabbrev: Definitionen
11
11
  termsdefsymbols: Definitionen
12
12
  termsdefabbrev: Definitionen
13
- termnote: HINWEIS %
13
+ termnote: <span class='fmt-element-name'>HINWEIS</span> %
14
14
  normref: Referenzen
15
15
  symbolsabbrev: Abkürzungen und Akronyme
16
16
  abbrev: Abkürzungen und Akronyme
@@ -30,7 +30,7 @@ annex_subclause: Klausel
30
30
  keywords: Schlüsselwörter
31
31
  in: in
32
32
  to: bis
33
- nested_xref: "%2 in %1"
33
+ nested_xref: "%2 <conn>in</conn> %1"
34
34
  where: "wobei:"
35
35
  where_one: "wobei"
36
36
  blankclause: Diese Klausel ist absichtlich leer gelassen
@@ -10,7 +10,7 @@ termsdef: Definitions
10
10
  termsdefsymbolsabbrev: Definitions
11
11
  termsdefsymbols: Definitions
12
12
  termsdefabbrev: Definitions
13
- termnote: NOTE %
13
+ termnote: <span class='fmt-element-name'>NOTE</span> %
14
14
  normref: References
15
15
  symbolsabbrev: Abbreviations and acronyms
16
16
  abbrev: Abbreviations and acronyms
@@ -33,7 +33,7 @@ in: in
33
33
  to: to
34
34
  where: "where:"
35
35
  where_one: "where"
36
- nested_xref: "%2 in %1"
36
+ nested_xref: "%2 <conn>in</conn> %1"
37
37
  blankclause: This clause is intentionally left blank.
38
38
  norm_with_refs_pref:
39
39
  The following ITU-T Recommendations and other references contain provisions which, through reference in this text, constitute provisions of this Recommendation. At the time of publication, the editions indicated were valid. All Recommendations and other references are subject to revision; users of this Recommendation are therefore encouraged to investigate the possibility of applying the most recent edition of the Recommendations and other references listed below. A list of the currently valid ITU-T Recommendations is regularly published. The reference to a document within this Recommendation does not give it, as a stand-alone document, the status of a Recommendation.
@@ -10,7 +10,7 @@ termsdef: Definiciones
10
10
  termsdefsymbolsabbrev: Definiciones
11
11
  termsdefsymbols: Definiciones
12
12
  termsdefabbrev: Definiciones
13
- termnote: NOTA %
13
+ termnote: <span class='fmt-element-name'>NOTA</span> %
14
14
  normref: Referencias
15
15
  symbolsabbrev: Abreviaciones y acrónimos
16
16
  abbrev: Abreviaciones y acrónimos
@@ -31,7 +31,7 @@ annex_subclause: cláusula
31
31
  keywords: Palabras clave
32
32
  in: en
33
33
  to: a
34
- nested_xref: "%2 en %1"
34
+ nested_xref: "%2 <conn>en</conn> %1"
35
35
  where: "donde:"
36
36
  where_one: "donde"
37
37
  blankclause: Esta cláusula se deja en blanco intencionalmente.
@@ -10,7 +10,7 @@ termsdef: Définitions
10
10
  termsdefsymbolsabbrev: Définitions
11
11
  termsdefsymbols: Définitions
12
12
  termsdefabbrev: Définitions
13
- termnote: NOTE %
13
+ termnote: <span class='fmt-element-name'>NOTE</span> %
14
14
  normref: Références
15
15
  symbolsabbrev: Abréviations et acronymes
16
16
  abbrev: Abréviations et acronymes
@@ -31,7 +31,7 @@ annex_subclause: article
31
31
  keywords: Mots clés
32
32
  in: dans
33
33
  to: à
34
- nested_xref: "%2 dans %1"
34
+ nested_xref: "%2 <conn>dans</conn> %1"
35
35
  where: "où:"
36
36
  where_one: "où"
37
37
  blankclause: Cette clause est laissée en blanc intentionnellement.
@@ -10,7 +10,7 @@ termsdef: Определения
10
10
  termsdefsymbolsabbrev: Определения
11
11
  termsdefsymbols: Определения
12
12
  termsdefabbrev: Определения
13
- termnote: ПРИМЕЧАНИЕ %
13
+ termnote: <span class='fmt-element-name'>ПРИМЕЧАНИЕ</span> %
14
14
  normref: Ссылки
15
15
  symbolsabbrev: Сокращения и акронимы
16
16
  abbrev: Сокращения и акронимы
@@ -31,7 +31,7 @@ annex_subclause: пункт
31
31
  keywords: Ключевые слова
32
32
  in: в
33
33
  to: до
34
- nested_xref: "%2 в %1"
34
+ nested_xref: "%2 <conn>в</conn> %1"
35
35
  where: "где:"
36
36
  where_one: "где"
37
37
  blankclause: Этот пункт намеренно оставлен пустым.
@@ -10,7 +10,7 @@ termsdef: 定义
10
10
  termsdefsymbolsabbrev: 定义
11
11
  termsdefsymbols: 定义
12
12
  termsdefabbrev: 定义
13
- termnote: %
13
+ termnote: <span class='fmt-element-name'>注</span>%
14
14
  normref: 规范性参考文献
15
15
  symbolsabbrev: 缩略语与缩写
16
16
  abbrev: 缩略语与缩写
@@ -31,7 +31,7 @@ annex_subclause: 条款
31
31
  keywords: 关键词
32
32
  in: 中的
33
33
  to: 至
34
- nested_xref: "%1中的%2"
34
+ nested_xref: "%1<conn>中的</conn>%2"
35
35
  where: 式中:
36
36
  where_one: 式中
37
37
  blankclause: This clause is intentionally left blank.
@@ -22,8 +22,8 @@ module IsoDoc
22
22
  end
23
23
 
24
24
  def bibrenderer(options = {})
25
- ::Relaton::Render::Itu::General.new(options.merge(language: @lang,
26
- i18nhash: @i18n.get))
25
+ ::Relaton::Render::Itu::General.new(options
26
+ .merge(language: @lang, i18nhash: @i18n.get))
27
27
  end
28
28
 
29
29
  def fileloc(loc)