metanorma-csd 1.0.14 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b883ec7d0c6e32c1c969d25ea2d87fb40d2d0a93975bdefc96cb544429b1da31
4
- data.tar.gz: 55a9eda449de34ad2d9c3d80da4bac8209aa1fc61bc68b1224bec9d084d0ba25
3
+ metadata.gz: dbbb463a01b6b5605c7a2c0212c89a9c9c6b33ec239fcad02663b1c2c81d8229
4
+ data.tar.gz: a52ef2d35a02d64ee85d1a1d9e86aa05190d957df1900f8b9dbdfdd665ea9bb3
5
5
  SHA512:
6
- metadata.gz: 645a63ce30ba0fc053b8588e2a9413bdcdaff8cf6b5d76b93830475040216dce13feceb70aca79b6b5255a67ac39de574b3cc9650aa7f379c02f7ec6986f9196
7
- data.tar.gz: 9abf53c1a1efdaa285a0ef8f2b01d32e96e0dd370ae826292b13f042c5b27b598abcce15874732a50baae03e62bf4ab87b9f2aaf085f2dc544f03a45ce01f253
6
+ metadata.gz: 0ca840d3b57ea14bab06a98dce7ab8e7beaa2530e023b5115336ffd4444564a2b643b065c26e2afcdb7c61dff6d5d43f7a622948652792a7ecfbbd62d26430b7
7
+ data.tar.gz: 58501c062ed63d65773bdc3bd76c0e9e3cfe6fef3357c6fc9f85ff49b75f64d61f1bb62ec9c38918264a52a2f110edb89719e3f4e5fd3f0661a36bbce090b107
data/README.adoc CHANGED
@@ -171,6 +171,7 @@ other committees are added as `_3`, `_4`...
171
171
  The attribute `:draft:`, if present, includes review notes in the XML output;
172
172
  these are otherwise suppressed.
173
173
 
174
+ ////
174
175
  === Attributs specific to CSD
175
176
 
176
177
  `:fullname{_i}:`:: The full name of a person who is a contributor to the document.
@@ -180,16 +181,16 @@ A second person is indicated by using a numeric suffix: `:fullname:`, `:fullname
180
181
  `:givenname{_i}:`:: The given name(s) of a person who is a contributor to the document.
181
182
  `:role{_i}:`:: The role of a a person who is a contributor to the document. By default,
182
183
  they are coded as an `editor`; they can also be represented as an `author`.
184
+ ////
183
185
 
184
-
185
- == Asciidoctor features specific to CSAND
186
+ ////
187
+ == Asciidoctor features specific to CSD
186
188
 
187
189
  The https://github.com/riboseinc/metanorma-standoc[metanorma-standoc]
188
190
  gem documents the customisations of Asciidoctor markup common to all metanorma gems.
189
191
  The following markup is specific to this gem:
190
192
 
191
- * `+[keyword]#...#+`: encodes keywords, such as "MUST", "MUST NOT". (Encoded as
192
- `<span class="keyword">...</span>`.
193
+ ////
193
194
 
194
195
  == Data Models
195
196
 
@@ -286,18 +286,23 @@
286
286
  </define>
287
287
  <define name="address">
288
288
  <element name="address">
289
- <oneOrMore>
289
+ <choice>
290
290
  <!-- iso191606 TODO -->
291
- <ref name="street"/>
292
- </oneOrMore>
293
- <ref name="city"/>
294
- <optional>
295
- <ref name="state"/>
296
- </optional>
297
- <ref name="country"/>
298
- <optional>
299
- <ref name="postcode"/>
300
- </optional>
291
+ <group>
292
+ <oneOrMore>
293
+ <ref name="street"/>
294
+ </oneOrMore>
295
+ <ref name="city"/>
296
+ <optional>
297
+ <ref name="state"/>
298
+ </optional>
299
+ <ref name="country"/>
300
+ <optional>
301
+ <ref name="postcode"/>
302
+ </optional>
303
+ </group>
304
+ <ref name="formattedAddress"/>
305
+ </choice>
301
306
  </element>
302
307
  </define>
303
308
  <define name="street">
@@ -325,6 +330,11 @@
325
330
  <text/>
326
331
  </element>
327
332
  </define>
333
+ <define name="formattedAddress">
334
+ <element name="formattedAddress">
335
+ <text/>
336
+ </element>
337
+ </define>
328
338
  <define name="person-identifier">
329
339
  <element name="identifier">
330
340
  <attribute name="type">
@@ -17,33 +17,6 @@ module Asciidoctor
17
17
  personal_author(node, xml)
18
18
  end
19
19
 
20
- def personal_author(node, xml)
21
- if node.attr("fullname") || node.attr("surname")
22
- personal_author1(node, xml, "")
23
- end
24
- i = 2
25
- while node.attr("fullname_#{i}") || node.attr("surname_#{i}")
26
- personal_author1(node, xml, "_#{i}")
27
- i += 1
28
- end
29
- end
30
-
31
- def personal_author1(node, xml, suffix)
32
- xml.contributor do |c|
33
- c.role **{ type: node.attr("role#{suffix}")&.downcase || "author" }
34
- c.person do |p|
35
- p.name do |n|
36
- if node.attr("fullname#{suffix}")
37
- n.completename node.attr("fullname#{suffix}")
38
- else
39
- n.forename node.attr("givenname#{suffix}")
40
- n.surname node.attr("surname#{suffix}")
41
- end
42
- end
43
- end
44
- end
45
- end
46
-
47
20
  def metadata_publisher(node, xml)
48
21
  xml.contributor do |c|
49
22
  c.role **{ type: "publisher" }
@@ -911,6 +911,9 @@
911
911
  </choice>
912
912
  </attribute>
913
913
  </optional>
914
+ <optional>
915
+ <attribute name="alt"/>
916
+ </optional>
914
917
  </element>
915
918
  </define>
916
919
  <define name="stem">
@@ -607,13 +607,17 @@ div.coverpage_warning
607
607
  aside {
608
608
  font-size:10.0pt;
609
609
  }
610
- div.example {
611
- margin-left:70.9pt;
612
- text-indent:-70.9pt;
610
+
611
+ .example-title {
612
+ font-weight: bold;
613
+ margin-left: -36.0pt;
613
614
  }
614
- p.example, li.example, div.example, td.example
615
- { margin:0in;
616
- margin-bottom:.0001pt;
615
+
616
+ p.example, li.example, div.example, td.example {
617
+ margin-top: 0cm;
618
+ margin-right: 36.0pt;
619
+ margin-bottom: 0cm;
620
+ margin-left: 36.0pt;
617
621
  mso-pagination:none;
618
622
  font-size:10.0pt;
619
623
  font-family:$bodyfont;}
@@ -622,6 +626,11 @@ td.example p.MsoListParagraph {
622
626
  font-size: 10.0pt;
623
627
  }
624
628
 
629
+
630
+ td.example p.MsoListParagraph {
631
+ font-size: 10.0pt;
632
+ }
633
+
625
634
  span.note_label, span.example_label, td.example_label, td.note_label
626
635
  {
627
636
  font-size: 10.0pt;
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
 
38
38
  {% capture tags %}
39
- {% for tag in contributors %}
39
+ {% for tag in roles_authors_affiliations %}
40
40
  {{ tag[0] }}
41
41
  {% endfor %}
42
42
  {% endcapture %}
@@ -46,10 +46,12 @@
46
46
  {% for tag in sortedtags %}
47
47
  <div class="coverpage-contributors">
48
48
  <div class="group {{ tag }}">
49
- {% for person in contributors[tag] %}
50
- <span class="person {{ tag }}">{{ person }}<span class="role">{{ tag | capitalize }}</span></span>
51
- {% endfor %}
52
- </div>
49
+ {% for affiliation in roles_authors_affiliations[tag] %}
50
+ {% for author in affiliation[1] %}
51
+ <span class="person {{ tag }}">{{ author }}<span class="role">{{ tag | capitalize }}</span></span>
52
+ {% endfor %}
53
+ <div class="affiliation">{{affiliation[0]}}</div>
54
+ {% endfor %}
53
55
  </div>
54
56
  {% endfor %}
55
57
 
@@ -620,11 +620,23 @@ td.example {
620
620
  margin: 2em 0 1em 0;
621
621
  }
622
622
 
623
+ .example {
624
+ background-color: #e1eef1;
625
+ padding: 0.5em;
626
+ margin: 2em 0 1em 0;
627
+ text-align: left;
628
+ padding-left: 2em;
629
+ }
630
+
631
+ .example p {
632
+ margin: 0;
633
+ }
634
+
623
635
  .example .example-title {
624
636
  font-weight: 700;
625
637
  text-transform: uppercase;
626
- text-align: center;
627
638
  margin-top:0;
639
+ margin-left:-1.5em;
628
640
  }
629
641
 
630
642
  /*
@@ -10,21 +10,19 @@ style='mso-no-proof:yes'>{{ tc | join: "/" }}</span></p>
10
10
  style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:24.0pt'>{{ doctitle }}</span>
11
11
  </b><br/><span lang="EN-GB" style='font-size:16.0pt'>{{ docsubtitle }}</span></p>
12
12
 
13
- {% capture tags %}
14
- {% for tag in contributors %}
15
- {{ tag[0] }}
16
- {% endfor %}
13
+ {% capture tags %}
14
+ {% for tag in roles_authors_affiliations %}
15
+ {{ tag[0] }}
16
+ {% endfor %}
17
17
  {% endcapture %}
18
+
18
19
  {% assign sortedtags = tags | split:' ' | sort %}
19
20
 
20
21
  {% for tag in sortedtags %}
21
22
  <p class="MsoNormal" align="center" style='text-align:center'>
22
- {% if contributors[tag].size > 1 %}
23
- {{ tag | capitalize }}s:
24
- {% else %}
25
- {{ tag | capitalize }}:
26
- {% endif %}
27
- {{ contributors[tag] | join: ", " }}
23
+ {% for affiliation in roles_authors_affiliations[tag] %}
24
+ <span class="person {{ tag }}">{{ affiliation[1] | join: "," }}{% if affiliation[0].size > 0 %}, {{affiliation[0]}}{% endif %}: <span class="role">{{ tag | capitalize }}</span></span>
25
+ {% endfor %}
28
26
  </p>
29
27
  {% endfor %}
30
28
 
@@ -25,7 +25,7 @@ module IsoDoc
25
25
  def author(isoxml, _out)
26
26
  tc = isoxml.at(ns("//bibdata/editorialgroup/technical-committee"))
27
27
  set(:tc, tc.text) if tc
28
- set(:contributors, personal_authors(isoxml))
28
+ personal_authors(isoxml)
29
29
  end
30
30
 
31
31
  def personal_authors(isoxml)
@@ -34,24 +34,11 @@ module IsoDoc
34
34
  inject([]) { |m, t| m << t.value }
35
35
  roles.uniq.sort.each do |r|
36
36
  names = isoxml.xpath(ns("//bibdata/contributor[role/@type = '#{r}']"\
37
- "/person/name"))
38
- persons[r] = extract_person_names(names) unless names.empty?
37
+ "/person"))
38
+ persons[r] = extract_person_names_affiliations(names) unless names.empty?
39
39
  end
40
- persons
41
- end
42
-
43
- def extract_person_names(authors)
44
- ret = []
45
- authors.each do |a|
46
- if a.at(ns("./completename"))
47
- ret << a.at(ns("./completename")).text
48
- else
49
- fn = a.xpath(ns("./forename")).inject([]) { |m, f| m << f.text }
50
- surname = a&.at(ns("./surname"))&.text
51
- ret << fn.join(" ") + " " + surname
52
- end
53
- end
54
- ret
40
+ set(:roles_authors_affiliations, persons)
41
+ super
55
42
  end
56
43
 
57
44
  def docid(isoxml, _out)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csd
3
- VERSION = "1.0.14"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency "metanorma-standoc", "~> 1.0.0"
30
+ spec.add_dependency "metanorma-standoc", "~> 1.1.0"
31
31
  spec.add_dependency "isodoc", "~> 0.9.6"
32
32
 
33
33
  spec.add_development_dependency "bundler", "~> 2.0.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-11 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 1.1.0
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: 1.0.0
26
+ version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: isodoc
29
29
  requirement: !ruby/object:Gem::Requirement