metanorma-itu 1.3.11 → 1.4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/Rakefile +2 -2
  4. data/bin/rspec +1 -2
  5. data/lib/asciidoctor/itu/basicdoc.rng +21 -4
  6. data/lib/asciidoctor/itu/front.rb +5 -61
  7. data/lib/asciidoctor/itu/front_id.rb +67 -0
  8. data/lib/asciidoctor/itu/isodoc.rng +419 -77
  9. data/lib/asciidoctor/itu/itu.rng +3 -8
  10. data/lib/asciidoctor/itu/reqt.rng +23 -2
  11. data/lib/asciidoctor/itu/validate.rb +33 -31
  12. data/lib/asciidoctor/itu.rb +0 -1
  13. data/lib/isodoc/itu/base_convert.rb +5 -2
  14. data/lib/isodoc/itu/html/wordstyle.css +29 -8
  15. data/lib/isodoc/itu/html/wordstyle.scss +29 -8
  16. data/lib/isodoc/itu/i18n-ar.yaml +1 -0
  17. data/lib/isodoc/itu/i18n-de.yaml +1 -0
  18. data/lib/isodoc/itu/i18n-en.yaml +1 -0
  19. data/lib/isodoc/itu/i18n-es.yaml +1 -0
  20. data/lib/isodoc/itu/i18n-fr.yaml +1 -0
  21. data/lib/isodoc/itu/i18n-ru.yaml +1 -0
  22. data/lib/isodoc/itu/i18n-zh-Hans.yaml +1 -0
  23. data/lib/isodoc/itu/i18n.rb +1 -2
  24. data/lib/isodoc/itu/init.rb +1 -2
  25. data/lib/isodoc/itu/itu.implementers-guide.xsl +171 -11
  26. data/lib/isodoc/itu/itu.in-force.xsl +171 -11
  27. data/lib/isodoc/itu/itu.recommendation-annex.xsl +171 -11
  28. data/lib/isodoc/itu/itu.recommendation-supplement.xsl +171 -11
  29. data/lib/isodoc/itu/itu.recommendation.xsl +171 -11
  30. data/lib/isodoc/itu/itu.resolution.xsl +171 -11
  31. data/lib/isodoc/itu/itu.service-publication.xsl +171 -11
  32. data/lib/isodoc/itu/itu.technical-paper.xsl +171 -11
  33. data/lib/isodoc/itu/itu.technical-report.xsl +171 -11
  34. data/lib/isodoc/itu/metadata.rb +3 -2
  35. data/lib/isodoc/itu/pdf_convert.rb +5 -4
  36. data/lib/isodoc/itu/terms.rb +9 -6
  37. data/lib/isodoc/itu.rb +0 -1
  38. data/lib/metanorma/itu/version.rb +1 -1
  39. data/metanorma-itu.gemspec +1 -2
  40. metadata +6 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad435d6188b9f2e881c84f0d43a6c35fd2bb4d6c993d1d796b830f755a2d3e33
4
- data.tar.gz: 95409047e659d65a1c4b0102ebf910d69fe062ab4731511060625ed78ddb362c
3
+ metadata.gz: e486ed509e01e8839797855e65a6431033298b7e307253f64b600fbc195f4caa
4
+ data.tar.gz: cbb5b77f6e2d99ded15a6e50375689d9f57f700d3f4f00d320e2ce110713d535
5
5
  SHA512:
6
- metadata.gz: 8a3db12e7809503cd242cb1c1f3b6d1b1a579ebbed62fb7ba91c357bdc264b601aefa5e64dee6c0aa2d3cf0a2afd2a01c5e6f43c98343dbc5d0b742aa3472c96
7
- data.tar.gz: bd64d897084265a9be463d56dcf31dde685b7e36ab56f75016d89d2ad7dc486816e393557c8c84a013e4fd06567c4b8ce4ffcd695d15597ada66b12295f5c006
6
+ metadata.gz: 550210205331fb08d6e5f9da8614f8f0f9b9883e4b353d79698a8530e4f71dce36cfd5b36d75b0fcce073569cc1f1cf33a83b9baf348179ad3f547a3c9221da6
7
+ data.tar.gz: 3900db56104d0d73841f932220178e3ef1e64cb085d60bcbdff5259e36fbdbca539b3dfc26d71a25934f4622a48ba7afb93813ac1bee7d86d66456064fee9692
data/Gemfile CHANGED
@@ -6,6 +6,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
6
6
 
7
7
  gemspec
8
8
 
9
- if File.exist? 'Gemfile.devel'
10
- eval File.read('Gemfile.devel'), nil, 'Gemfile.devel' # rubocop:disable Security/Eval
9
+ if File.exist? "Gemfile.devel"
10
+ eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
11
11
  end
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
- require 'isodoc/gem_tasks'
3
+ require "isodoc/gem_tasks"
4
4
 
5
5
  IsoDoc::GemTasks.install
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task :default => :spec
8
+ task default: :spec
data/bin/rspec CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
-
2
+
3
3
  # This file was generated by Bundler.
4
4
  #
5
5
  # The application 'rspec' is installed as part of a gem, and
@@ -15,4 +15,3 @@ require "rubygems"
15
15
  require "bundler/setup"
16
16
 
17
17
  load Gem.bin_path("rspec-core", "rspec")
18
-
@@ -624,6 +624,9 @@
624
624
  <choice>
625
625
  <ref name="PureTextElement"/>
626
626
  <ref name="stem"/>
627
+ <ref name="eref"/>
628
+ <ref name="xref"/>
629
+ <ref name="hyperlink"/>
627
630
  </choice>
628
631
  </zeroOrMore>
629
632
  </element>
@@ -634,6 +637,9 @@
634
637
  <choice>
635
638
  <ref name="PureTextElement"/>
636
639
  <ref name="stem"/>
640
+ <ref name="eref"/>
641
+ <ref name="xref"/>
642
+ <ref name="hyperlink"/>
637
643
  </choice>
638
644
  </zeroOrMore>
639
645
  </element>
@@ -641,7 +647,12 @@
641
647
  <define name="tt">
642
648
  <element name="tt">
643
649
  <zeroOrMore>
644
- <ref name="PureTextElement"/>
650
+ <choice>
651
+ <ref name="PureTextElement"/>
652
+ <ref name="eref"/>
653
+ <ref name="xref"/>
654
+ <ref name="hyperlink"/>
655
+ </choice>
645
656
  </zeroOrMore>
646
657
  </element>
647
658
  </define>
@@ -822,7 +833,9 @@
822
833
  <attribute name="alt"/>
823
834
  </optional>
824
835
  <ref name="CitationType"/>
825
- <text/>
836
+ <oneOrMore>
837
+ <ref name="PureTextElement"/>
838
+ </oneOrMore>
826
839
  </define>
827
840
  <define name="hyperlink">
828
841
  <element name="link">
@@ -835,7 +848,9 @@
835
848
  <optional>
836
849
  <attribute name="alt"/>
837
850
  </optional>
838
- <text/>
851
+ <oneOrMore>
852
+ <ref name="PureTextElement"/>
853
+ </oneOrMore>
839
854
  </element>
840
855
  </define>
841
856
  <define name="xref">
@@ -849,7 +864,9 @@
849
864
  <optional>
850
865
  <attribute name="alt"/>
851
866
  </optional>
852
- <text/>
867
+ <oneOrMore>
868
+ <ref name="PureTextElement"/>
869
+ </oneOrMore>
853
870
  </element>
854
871
  </define>
855
872
  <define name="fn">
@@ -1,6 +1,7 @@
1
1
  require "asciidoctor"
2
2
  require "asciidoctor/standoc/converter"
3
3
  require "fileutils"
4
+ require_relative "./front_id"
4
5
 
5
6
  module Asciidoctor
6
7
  module ITU
@@ -13,6 +14,10 @@ module Asciidoctor
13
14
  end
14
15
  end
15
16
 
17
+ def relaton_relations
18
+ super + %w(complements)
19
+ end
20
+
16
21
  def title_attr(type, lang = "en")
17
22
  { language: lang, format: "text/plain", type: type }
18
23
  end
@@ -109,55 +114,6 @@ module Asciidoctor
109
114
  end
110
115
  end
111
116
 
112
- def metadata_id(node, xml)
113
- provisional_id(node, xml)
114
- itu_id(node, xml)
115
- recommendation_id(node, xml)
116
- end
117
-
118
- def provisional_id(node, xml)
119
- return unless node.attr("provisional-name")
120
-
121
- xml.docidentifier **{ type: "ITU-provisional" } do |i|
122
- i << node.attr("provisional-name")
123
- end
124
- end
125
-
126
- ITULANG = { "en" => "E", "fr" => "F", "ar" => "A", "es" => "S",
127
- "zh" => "C", "ru" => "R" }.freeze
128
-
129
- def itu_id1(node, lang)
130
- bureau = node.attr("bureau") || "T"
131
- id = if doctype(node) == "service-publication"
132
- @i18n.annex_to_itu_ob_abbrev.sub(/%/, node.attr("docnumber"))
133
- else
134
- "ITU-#{bureau} #{node.attr('docnumber')}"
135
- end
136
- id + (lang ? "-#{ITULANG[@lang]}" : "")
137
- end
138
-
139
- def itu_id(node, xml)
140
- return unless node.attr("docnumber")
141
-
142
- xml.docidentifier **{ type: "ITU" } do |i|
143
- i << itu_id1(node, false)
144
- end
145
- xml.docidentifier **{ type: "ITU-lang" } do |i|
146
- i << itu_id1(node, true)
147
- end
148
- xml.docnumber { |i| i << node.attr("docnumber") }
149
- end
150
-
151
- def recommendation_id(node, xml)
152
- return unless node.attr("recommendationnumber")
153
-
154
- node.attr("recommendationnumber").split("/").each do |s|
155
- xml.docidentifier **{ type: "ITU-Recommendation" } do |i|
156
- i << s
157
- end
158
- end
159
- end
160
-
161
117
  def metadata_series(node, xml)
162
118
  node.attr("series") and
163
119
  xml.series **{ type: "main" } do |s|
@@ -191,18 +147,6 @@ module Asciidoctor
191
147
  xml.ip_notice_received (node.attr("ip-notice-received") || "false")
192
148
  end
193
149
 
194
- def structured_id(node, xml)
195
- return unless node.attr("docnumber")
196
-
197
- xml.structuredidentifier do |i|
198
- i.bureau node.attr("bureau") || "T"
199
- i.docnumber node.attr("docnumber")
200
- a = node.attr("annexid") and i.annexid a
201
- a = node.attr("amendment-number") and i.amendment a
202
- a = node.attr("corrigendum-number") and i.corrigendum a
203
- end
204
- end
205
-
206
150
  def metadata_techreport(node, xml)
207
151
  a = node.attr("meeting") and
208
152
  metadata_meeting(a, node.attr("meeting-acronym"), xml)
@@ -0,0 +1,67 @@
1
+ module Asciidoctor
2
+ module ITU
3
+ class Converter < Standoc::Converter
4
+ def metadata_id(node, xml)
5
+ provisional_id(node, xml)
6
+ itu_id(node, xml)
7
+ recommendation_id(node, xml)
8
+ end
9
+
10
+ def provisional_id(node, xml)
11
+ return unless node.attr("provisional-name")
12
+
13
+ xml.docidentifier **{ type: "ITU-provisional" } do |i|
14
+ i << node.attr("provisional-name")
15
+ end
16
+ end
17
+
18
+ ITULANG = { "en" => "E", "fr" => "F", "ar" => "A", "es" => "S",
19
+ "zh" => "C", "ru" => "R" }.freeze
20
+
21
+ def itu_id1(node, lang)
22
+ bureau = node.attr("bureau") || "T"
23
+ id = if doctype(node) == "service-publication"
24
+ @i18n.annex_to_itu_ob_abbrev.sub(/%/,
25
+ node.attr("docnumber"))
26
+ else
27
+ "ITU-#{bureau} #{node.attr('docnumber')}"
28
+ end
29
+ id + (lang ? "-#{ITULANG[@lang]}" : "")
30
+ end
31
+
32
+ def itu_id(node, xml)
33
+ return unless node.attr("docnumber")
34
+
35
+ xml.docidentifier **{ type: "ITU" } do |i|
36
+ i << itu_id1(node, false)
37
+ end
38
+ xml.docidentifier **{ type: "ITU-lang" } do |i|
39
+ i << itu_id1(node, true)
40
+ end
41
+ xml.docnumber { |i| i << node.attr("docnumber") }
42
+ end
43
+
44
+ def recommendation_id(node, xml)
45
+ return unless node.attr("recommendationnumber")
46
+
47
+ node.attr("recommendationnumber").split("/").each do |s|
48
+ xml.docidentifier **{ type: "ITU-Recommendation" } do |i|
49
+ i << s
50
+ end
51
+ end
52
+ end
53
+
54
+ def structured_id(node, xml)
55
+ return unless node.attr("docnumber")
56
+
57
+ xml.structuredidentifier do |i|
58
+ i.bureau node.attr("bureau") || "T"
59
+ i.docnumber node.attr("docnumber")
60
+ a = node.attr("annexid") and i.annexid a
61
+ a = node.attr("amendment-number") and i.amendment a
62
+ a = node.attr("corrigendum-number") and i.corrigendum a
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end