metanorma-cc 2.1.8 → 2.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,8 +6,8 @@ require_relative "i18n"
6
6
  module IsoDoc
7
7
  module CC
8
8
  module Init
9
- def metadata_init(lang, script, i18n)
10
- @meta = Metadata.new(lang, script, i18n)
9
+ def metadata_init(lang, script, locale, i18n)
10
+ @meta = Metadata.new(lang, script, locale, i18n)
11
11
  end
12
12
 
13
13
  def xref_init(lang, script, _klass, i18n, options)
@@ -15,10 +15,10 @@ module IsoDoc
15
15
  @xrefs = Xref.new(lang, script, html, i18n, options)
16
16
  end
17
17
 
18
- def i18n_init(lang, script, i18nyaml = nil)
19
- @i18n = I18n.new(lang, script, i18nyaml: i18nyaml || @i18nyaml)
18
+ def i18n_init(lang, script, locale, i18nyaml = nil)
19
+ @i18n = I18n.new(lang, script, locale: locale,
20
+ i18nyaml: i18nyaml || @i18nyaml)
20
21
  end
21
22
  end
22
23
  end
23
24
  end
24
-
@@ -8,7 +8,7 @@ module IsoDoc
8
8
  Metanorma::CC.configuration
9
9
  end
10
10
 
11
- def initialize(lang, script, labels)
11
+ def initialize(lang, script, locale, labels)
12
12
  super
13
13
  set(:tc, "XXXX")
14
14
  end
@@ -29,16 +29,18 @@ module IsoDoc
29
29
  end
30
30
 
31
31
  def personal_authors(isoxml)
32
- persons = {}
33
- roles = isoxml.xpath(ns("//bibdata/contributor/role/@type")).
34
- inject([]) { |m, t| m << t.value }
35
- roles.uniq.sort.each do |r|
32
+ set(:roles_authors_affiliations, roles_authors_affiliations(isoxml))
33
+ super
34
+ end
35
+
36
+ def roles_authors_affiliations(isoxml)
37
+ isoxml.xpath(ns("//bibdata/contributor/role/@type"))
38
+ .inject([]) { |m, t| m << t.value }
39
+ .uniq.sort.each_with_object({}) do |r, m|
36
40
  names = isoxml.xpath(ns("//bibdata/contributor[role/@type = '#{r}']"\
37
- "/person"))
38
- persons[r] = extract_person_names_affiliations(names) unless names.empty?
41
+ "/person"))
42
+ names.empty? or m[r] = extract_person_names_affiliations(names)
39
43
  end
40
- set(:roles_authors_affiliations, persons)
41
- super
42
44
  end
43
45
  end
44
46
  end
@@ -73,8 +73,14 @@
73
73
  <text/>
74
74
  </element>
75
75
  </define>
76
- <define name="script">
76
+ <define name="locale">
77
77
  <a:documentation>ISO-639</a:documentation>
78
+ <element name="locale">
79
+ <text/>
80
+ </element>
81
+ </define>
82
+ <define name="script">
83
+ <a:documentation>ISO-3166</a:documentation>
78
84
  <element name="script">
79
85
  <text/>
80
86
  </element>
@@ -93,6 +99,9 @@
93
99
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
100
  <attribute name="language"/>
95
101
  </optional>
102
+ <optional>
103
+ <attribute name="locale"/>
104
+ </optional>
96
105
  <optional>
97
106
  <attribute name="script"/>
98
107
  </optional>
@@ -136,6 +145,9 @@
136
145
  <!-- multiple languages and scripts possible: comma delimit them if so -->
137
146
  <attribute name="language"/>
138
147
  </optional>
148
+ <optional>
149
+ <attribute name="locale"/>
150
+ </optional>
139
151
  <optional>
140
152
  <attribute name="script"/>
141
153
  </optional>
@@ -650,6 +662,9 @@
650
662
  <zeroOrMore>
651
663
  <ref name="language"/>
652
664
  </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="locale"/>
667
+ </zeroOrMore>
653
668
  <zeroOrMore>
654
669
  <ref name="script"/>
655
670
  </zeroOrMore>
@@ -741,6 +756,9 @@
741
756
  <zeroOrMore>
742
757
  <ref name="language"/>
743
758
  </zeroOrMore>
759
+ <zeroOrMore>
760
+ <ref name="locale"/>
761
+ </zeroOrMore>
744
762
  <zeroOrMore>
745
763
  <ref name="script"/>
746
764
  </zeroOrMore>
@@ -854,6 +872,15 @@
854
872
  <optional>
855
873
  <attribute name="type"/>
856
874
  </optional>
875
+ <optional>
876
+ <attribute name="language"/>
877
+ </optional>
878
+ <optional>
879
+ <attribute name="locale"/>
880
+ </optional>
881
+ <optional>
882
+ <attribute name="script"/>
883
+ </optional>
857
884
  <data type="anyURI"/>
858
885
  </define>
859
886
  <define name="DateType">
@@ -882,6 +909,7 @@
882
909
  <value>vote-started</value>
883
910
  <value>vote-ended</value>
884
911
  <value>announced</value>
912
+ <value>stable-until</value>
885
913
  </choice>
886
914
  </define>
887
915
  <define name="bdate">
@@ -930,6 +958,9 @@
930
958
  <optional>
931
959
  <attribute name="language"/>
932
960
  </optional>
961
+ <optional>
962
+ <attribute name="locale"/>
963
+ </optional>
933
964
  <optional>
934
965
  <attribute name="script"/>
935
966
  </optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.1.8".freeze
3
+ VERSION = "2.1.9".freeze
4
4
  end
5
5
  end
data/metanorma-cc.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
30
30
 
31
- spec.add_dependency "metanorma-generic", "~> 2.2.0"
31
+ spec.add_dependency "metanorma-generic", "~> 2.2.2"
32
32
 
33
33
  spec.add_development_dependency "debug"
34
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.8
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-06 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.0
19
+ version: 2.2.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.0
26
+ version: 2.2.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -191,17 +191,21 @@ files:
191
191
  - bin/setup
192
192
  - lib/isodoc/cc/base_convert.rb
193
193
  - lib/isodoc/cc/cc.standard.xsl
194
+ - lib/isodoc/cc/html/_coverpage.css
194
195
  - lib/isodoc/cc/html/_coverpage.scss
196
+ - lib/isodoc/cc/html/cc.css
195
197
  - lib/isodoc/cc/html/cc.scss
196
198
  - lib/isodoc/cc/html/dots-w@2x.png
197
199
  - lib/isodoc/cc/html/dots@2x.png
198
200
  - lib/isodoc/cc/html/header.html
199
201
  - lib/isodoc/cc/html/html_cc_intro.html
200
202
  - lib/isodoc/cc/html/html_cc_titlepage.html
203
+ - lib/isodoc/cc/html/htmlstyle.css
201
204
  - lib/isodoc/cc/html/htmlstyle.scss
202
205
  - lib/isodoc/cc/html/scripts.html
203
206
  - lib/isodoc/cc/html/word_cc_intro.html
204
207
  - lib/isodoc/cc/html/word_cc_titlepage.html
208
+ - lib/isodoc/cc/html/wordstyle.css
205
209
  - lib/isodoc/cc/html/wordstyle.scss
206
210
  - lib/isodoc/cc/html_convert.rb
207
211
  - lib/isodoc/cc/i18n-en.yaml