metanorma-gb 1.0.6 → 1.0.7

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: 50f41f8857b91e9118b5222b8743350a9d24a47c17aabfc24698a2583bb8f2c4
4
- data.tar.gz: d83655fd972b34b5a332ef8431037b146b480518e7b00a34ff19f07490b7d136
3
+ metadata.gz: 031a1821b8f3b4510e1411068cbbe18ca5e1dc5d69d0072fc87e9dc009aeb796
4
+ data.tar.gz: 75aabd60d69f737c2ecdfdda8abb1e438d01adf55f259be346793932db80c419
5
5
  SHA512:
6
- metadata.gz: 5295ea4488d1b514794e600d6c68496bbfd560226b48e7c3ed8487fcc7890fece87e9fa9badd7da04cbd2da15d297fee98b9c6b3b25b7f025ba2ee1c3da0a292
7
- data.tar.gz: 6b70f19a03da1e39d0786313d68630278a1e5c41ecb35975e2069e583bbd9f167f53e66f5e1bd827b97659ffe9e22cb26ff9ec8f74e3e57aa7b51e64b9f4c97f
6
+ metadata.gz: a5e63ce13f2bf2e792336c7ccd16c595b831af86f0750f16d0fdf877ebc7e5889c708bfd22295b99f7b321c0933cf8a51ec67da5e62b3c8ca95c5d01142e81a3
7
+ data.tar.gz: f44544a34db3b2bc9709c6366e272c8cc0e3b888fe51f741a64f285ff24cd92fe40815ed2341fac5a9e0bcd330b4a641b7797228723fe44ce98fe9eee353a36e
@@ -414,6 +414,20 @@
414
414
  <ref name="BibliographicItem"/>
415
415
  </element>
416
416
  </define>
417
+ <define name="relaton_collection">
418
+ <element name="relaton-collection">
419
+ <optional>
420
+ <attribute name="type"/>
421
+ </optional>
422
+ <ref name="btitle"/>
423
+ <zeroOrMore>
424
+ <ref name="contributor"/>
425
+ </zeroOrMore>
426
+ <zeroOrMore>
427
+ <ref name="docrelation"/>
428
+ </zeroOrMore>
429
+ </element>
430
+ </define>
417
431
  <define name="BibItemType" combine="choice">
418
432
  <choice>
419
433
  <value>article</value>
@@ -531,7 +545,10 @@
531
545
  </define>
532
546
  <define name="fetched">
533
547
  <element name="fetched">
534
- <data type="dateTime"/>
548
+ <choice>
549
+ <data type="dateTime"/>
550
+ <data type="date"/>
551
+ </choice>
535
552
  </element>
536
553
  </define>
537
554
  <define name="validity">
@@ -549,17 +566,26 @@
549
566
  </define>
550
567
  <define name="validityBegins">
551
568
  <element name="validityBegins">
552
- <data type="dateTime"/>
569
+ <choice>
570
+ <data type="dateTime"/>
571
+ <data type="date"/>
572
+ </choice>
553
573
  </element>
554
574
  </define>
555
575
  <define name="validityEnds">
556
576
  <element name="validityEnds">
557
- <data type="dateTime"/>
577
+ <choice>
578
+ <data type="dateTime"/>
579
+ <data type="date"/>
580
+ </choice>
558
581
  </element>
559
582
  </define>
560
583
  <define name="validityRevision">
561
584
  <element name="revision">
562
- <data type="dateTime"/>
585
+ <choice>
586
+ <data type="dateTime"/>
587
+ <data type="date"/>
588
+ </choice>
563
589
  </element>
564
590
  </define>
565
591
  <define name="TypedTitleString">
@@ -744,6 +770,7 @@
744
770
  <element name="from">
745
771
  <choice>
746
772
  <data type="dateTime"/>
773
+ <data type="date"/>
747
774
  <data type="gYear"/>
748
775
  </choice>
749
776
  </element>
@@ -752,6 +779,7 @@
752
779
  <element name="to">
753
780
  <choice>
754
781
  <data type="dateTime"/>
782
+ <data type="date"/>
755
783
  <data type="gYear"/>
756
784
  </choice>
757
785
  </element>
@@ -181,7 +181,7 @@ module Asciidoctor
181
181
  code = "CN(#{code})" if !/^CN\(/.match(code) && /^#{GBCODE}[^A-Za-z]/.match(code)
182
182
  hit = @bibdb&.fetch(code, year, opts)
183
183
  return nil if hit.nil?
184
- xml.parent.add_child(hit.to_xml)
184
+ xml.parent.add_child(Asciidoctor::Standoc::Utils::smart_render_xml(hit))
185
185
  xml
186
186
  rescue Algolia::AlgoliaProtocolError
187
187
  nil # Render reference without an Internet connection.
@@ -191,6 +191,7 @@ module Asciidoctor
191
191
 
192
192
  def metadata(node, xml)
193
193
  title node, xml
194
+ metadata_source(node, xml)
194
195
  metadata_id(node, xml)
195
196
  metadata_date(node, xml)
196
197
  metadata_contributors(node, xml)
@@ -22,12 +22,12 @@ module IsoDoc
22
22
  end
23
23
 
24
24
  def format_agency(agency, format)
25
- return "<img src='#{@standardissuerimg}' alt='#{agency.join(",")}'></img>" if @standardissuerimg
25
+ return "<img class='logo' src='#{@standardissuerimg}' alt='#{agency.join(",")}'></img>" if @standardissuerimg
26
26
  return agency unless agency.is_a?(Array)
27
27
  if agency == ["中华人民共和国国家质量监督检验检疫总局", "中国国家标准化管理委员会"]
28
28
  logo = "gb-issuer-default.gif"
29
29
  FileUtils.cp fileloc(File.join('html/gb-logos', logo)), logo
30
- return "<img src='#{logo}' alt='#{agency.join(",")}'></img>"
30
+ return "<img class='logo' src='#{logo}' alt='#{agency.join(",")}'></img>"
31
31
  end
32
32
  format_agency1(agency, format)
33
33
  end
@@ -60,12 +60,12 @@ module IsoDoc
60
60
 
61
61
  def format_logo1(logo, prefix, scope)
62
62
  local = local_logo_suffix(scope)
63
- return "<img width='113' height='56' src='#{@standardlogoimg}' alt='#{prefix}'></img>"\
63
+ return "<img class='logo' width='113' height='56' src='#{@standardlogoimg}' alt='#{prefix}'></img>"\
64
64
  "#{local}" if @standardlogoimg
65
65
  logo += ".gif"
66
66
  FileUtils.cp fileloc(File.join('html/gb-logos', logo)), logo
67
67
  #@files_to_delete << logo
68
- "<img width='113' height='56' src='#{logo}' alt='#{prefix}'></img>"\
68
+ "<img class='logo' width='113' height='56' src='#{logo}' alt='#{prefix}'></img>"\
69
69
  "#{local}"
70
70
  end
71
71
  end
@@ -136,7 +136,6 @@ module IsoDoc
136
136
  meta = @meta.get.merge(@labels)
137
137
  logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format)
138
138
  logofile = @meta.standard_logo(meta[:gbprefix])
139
- @files_to_delete << logofile + ".gif" unless logofile.nil?
140
139
  docxml = termref_resolve(docxml)
141
140
  meta[:standard_agency_formatted] =
142
141
  @common.format_agency(meta[:standard_agency], format)
@@ -183,7 +182,9 @@ module IsoDoc
183
182
  def annex_name(annex, name, div)
184
183
  div.h1 **{ class: "Annex" } do |t|
185
184
  t << "#{get_anchors[annex['id']][:label]}<br/><br/>"
186
- t << name.text
185
+ t.b do |b|
186
+ name&.children&.each { |c2| parse(c2, b) }
187
+ end
187
188
  end
188
189
  end
189
190
 
@@ -183,7 +183,7 @@ module IsoDoc
183
183
  def annex_name(annex, name, div)
184
184
  div.h1 **{ class: "Annex" } do |t|
185
185
  t << "#{get_anchors[annex['id']][:label]}<br/><br/>"
186
- t << name.text
186
+ name&.children&.each { |c2| parse(c2, t) }
187
187
  end
188
188
  end
189
189
 
@@ -354,6 +354,8 @@ table.MsoISOTable
354
354
  mso-yfti-tbllook:480;
355
355
  mso-border-insideh:.75pt solid windowtext;
356
356
  mso-border-insidev:.75pt solid windowtext;
357
+ mso-table-anchor-vertical:paragraph;
358
+ mso-table-bspace:12.0pt;
357
359
  font-size:10.0pt;
358
360
  font-family:$bodyfont;
359
361
  mso-fareast-font-family:$bodyfont;}
@@ -381,6 +383,8 @@ table.MsoTableGrid
381
383
  mso-para-margin:0cm;
382
384
  mso-para-margin-bottom:.0001pt;
383
385
  mso-pagination:widow-orphan;
386
+ mso-table-anchor-vertical:paragraph;
387
+ mso-table-bspace:12.0pt;
384
388
  font-size:10.0pt;
385
389
  font-family:$bodyfont;
386
390
  mso-fareast-font-family:$bodyfont;}
@@ -445,6 +449,11 @@ div.example {
445
449
  table.example, table.Note {
446
450
  margin-left: 21.0pt;
447
451
  }
452
+
453
+ table.example {
454
+ margin-bottom:12pt;
455
+ }
456
+
448
457
  p.example, li.example, div.example, td.example
449
458
  {mso-style-name:示例; /* NAME: Example */
450
459
  mso-style-unhide:no;
@@ -461,6 +470,11 @@ p.example, li.example, div.example, td.example
461
470
  font-family:$bodyfont;
462
471
  mso-hansi-font-family:$bodyfont;
463
472
  mso-bidi-font-family:$bodyfont;}
473
+
474
+ td.example p.MsoListParagraph {
475
+ font-size: 9.0pt;
476
+ }
477
+
464
478
  p.leftpagenumber, li.leftpagenumber, div.leftpagenumber
465
479
  {mso-style-name:leftpagenumber;
466
480
  mso-style-priority:99;
@@ -726,6 +726,13 @@ p.DeprecatedTerms {
726
726
  }
727
727
  }
728
728
 
729
+ @media screen {
730
+ img:not(.logo) {
731
+ width: 100%;
732
+ height: auto;
733
+ }
734
+ }
735
+
729
736
 
730
737
  #toc ul {
731
738
  margin: 0;
@@ -564,6 +564,13 @@ p.DeprecatedTerms {
564
564
  }
565
565
  }
566
566
 
567
+ @media screen {
568
+ img:not(.logo) {
569
+ width: 100%;
570
+ height: auto;
571
+ }
572
+ }
573
+
567
574
 
568
575
 
569
576
  #toc ul {
@@ -149,9 +149,8 @@ p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
149
149
  mso-style-qformat:yes;
150
150
  margin-top:0cm;
151
151
  margin-right:0cm;
152
- margin-bottom:0cm;
152
+ margin-bottom:12.0pt;
153
153
  /* do not put in margin-left, it is specific to list level */
154
- margin-bottom:.0001pt;
155
154
  mso-add-space:auto;
156
155
  mso-pagination:widow-orphan;
157
156
  font-size:10.5pt;
@@ -165,9 +164,8 @@ p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphC
165
164
  mso-style-type:export-only;
166
165
  margin-top:0cm;
167
166
  margin-right:0cm;
168
- margin-bottom:0cm;
167
+ margin-bottom:12.0pt;
169
168
  /* do not put in margin-left, it is specific to list level */
170
- margin-bottom:.0001pt;
171
169
  mso-add-space:auto;
172
170
  mso-pagination:widow-orphan;
173
171
  font-size:10.5pt;
@@ -181,9 +179,8 @@ p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagrap
181
179
  mso-style-type:export-only;
182
180
  margin-top:0cm;
183
181
  margin-right:0cm;
184
- margin-bottom:0cm;
182
+ margin-bottom:12.0pt;
185
183
  /* do not put in margin-left, it is specific to list level */
186
- margin-bottom:.0001pt;
187
184
  mso-add-space:auto;
188
185
  mso-pagination:widow-orphan;
189
186
  font-size:10.5pt;
@@ -197,9 +194,8 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
197
194
  mso-style-type:export-only;
198
195
  margin-top:0cm;
199
196
  margin-right:0cm;
200
- margin-bottom:0cm;
201
- /* do not put in margin-left, it is specific to list level */
202
197
  margin-bottom:12.0pt;
198
+ /* do not put in margin-left, it is specific to list level */
203
199
  mso-add-space:auto;
204
200
  mso-pagination:widow-orphan;
205
201
  font-size:10.5pt;
@@ -2499,6 +2495,8 @@ table.MsoNormalTable
2499
2495
  mso-para-margin:0cm;
2500
2496
  mso-para-margin-bottom:.0001pt;
2501
2497
  mso-pagination:widow-orphan;
2498
+ mso-table-anchor-vertical:paragraph;
2499
+ mso-table-bspace:12.0pt;
2502
2500
  font-size:10.0pt;
2503
2501
  font-family:$bodyfont;
2504
2502
  mso-fareast-font-family:$bodyfont;}
@@ -162,7 +162,7 @@ module IsoDoc
162
162
  def standard_class(scope, prefix, mandate)
163
163
  standardclassimg = get[:standardclassimg]
164
164
  ret = @agencies.standard_class(scope, prefix, mandate)
165
- return "<img src='#{standardclassimg}' alt='#{ret}'></img>" if standardclassimg
165
+ return "<img class='logo' src='#{standardclassimg}' alt='#{ret}'></img>" if standardclassimg
166
166
  ret
167
167
  end
168
168
 
@@ -22,8 +22,8 @@ module Metanorma
22
22
  "Metanorma::Gb #{Metanorma::Gb::VERSION}"
23
23
  end
24
24
 
25
- def input_to_isodoc(file)
26
- Metanorma::Input::Asciidoc.new.process(file, @asciidoctor_backend)
25
+ def input_to_isodoc(file, filename)
26
+ Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
27
27
  end
28
28
 
29
29
  def extract_options(file)
@@ -33,10 +33,10 @@ module Metanorma
33
33
  /\n:standard-issuer-img: (?<standardissuerimg>[^\n]+)\n/ =~ head
34
34
  /\n:title-font: (?<titlefont>[^\n]+)\n/ =~ head
35
35
  new_options = {
36
- standardlogoimg: defined(standardlogoimg) ? standardlogoimg : nil,
37
- standardclassimg: defined(standardclassimg) ? standardclassimg : nil,
38
- standardissuerimg: defined(standardissuerimg) ? standardissuerimg : nil,
39
- titlefont: defined(titlefont) ? titlefont : nil,
36
+ standardlogoimg: defined?(standardlogoimg) ? standardlogoimg : nil,
37
+ standardclassimg: defined?(standardclassimg) ? standardclassimg : nil,
38
+ standardissuerimg: defined?(standardissuerimg) ? standardissuerimg : nil,
39
+ titlefont: defined?(titlefont) ? titlefont : nil,
40
40
  }.reject { |_, val| val.nil? }
41
41
  super.merge(new_options)
42
42
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Gb
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-gb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-08 00:00:00.000000000 Z
11
+ date: 2018-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso