metanorma-generic 2.0.3 → 2.1.1

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: 63def4be8b40f7940f1359d56a759fd027b54c60c628c57a7bcd0d457517fd09
4
- data.tar.gz: e81ccf24f2a0be29e526248dce9c0101b2b33d51b2afa94c9d6abc9db9c5deda
3
+ metadata.gz: 05f89e4a6adb0222c1cc71f880010902337d92cde88328a4754a61c5f30eb7dc
4
+ data.tar.gz: f506457c7e94d17694fe9512b559aa82a1665952bfdd06ae1554fc9b5e2d3d11
5
5
  SHA512:
6
- metadata.gz: 28df8386ff89a224b0fe5b6a18bc7588fc97a88cd4ed2b93d6bee9b364d934a05cf1ee94c2209b4521ece0050919e949597e430abc9c8dc465311e7105a34e01
7
- data.tar.gz: 65c07f7b771ce4927f9afc590ab8ead89a8a4f316f341cee75770c3b31670023d5fd6f8e4801f85da01be9ef318be4abdd7cf46c27c5dac0ed5309f84992ca16
6
+ metadata.gz: 704cda28036803f93d1cb11790dfe605fcc2c2eb4ff1ba09007b4ce30bf84cd511e307640f7803c83a1447d5f9af650dc32b00a447b0a704ca73ac198ea68523
7
+ data.tar.gz: b70f01e52405512c56e8fd3ef3994a245972f92f49029b2700c54d16b3cf7179fed7fd706c7fe683da3aae9cd294db4cf1bd561333b2689315ec8e0a58ad30fe
@@ -14,7 +14,7 @@ module IsoDoc
14
14
  h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
15
15
  d["id"] = h2["id"]
16
16
  d.children.first.previous =
17
- "<strong>#{h2.remove.children.to_xml}</strong>&nbsp;"
17
+ "<strong>#{h2.remove.children.to_xml}</strong>&#xa0;"
18
18
  end
19
19
  docxml
20
20
  end
@@ -70,6 +70,8 @@
70
70
  </div>
71
71
  {% endif %}
72
72
 
73
+ <div class="coverpage-warning" id="coverpage-note-destination"/>
74
+
73
75
  <div class="info-section">
74
76
  <div class="copyright">
75
77
  <p class="year">
@@ -64,6 +64,10 @@ documentation.</span><span lang="EN-GB" style='font-size:10.0pt;mso-bidi-font-si
64
64
 
65
65
  {% endif %}
66
66
 
67
+ <div class="coverpage-warning" id="coverpage-note-destination" align="center" style='margin-bottom:6.0pt;text-align:center;
68
+ border:none;mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:
69
+ 1.0pt 4.0pt 1.0pt 4.0pt'/>
70
+
67
71
  </div>
68
72
 
69
73
  <p class="MsoNormal" align="center" style='text-align:center'><span lang="EN-GB"
@@ -4,7 +4,6 @@ require "isodoc"
4
4
 
5
5
  module IsoDoc
6
6
  module Generic
7
-
8
7
  # A {Converter} implementation that generates HTML output, and a document
9
8
  # schema encapsulation of the document for validation
10
9
  #
@@ -18,19 +17,25 @@ module IsoDoc
18
17
  attr_accessor :_file
19
18
  end
20
19
 
21
- def self.inherited( k )
22
- k._file = caller_locations.first.absolute_path
20
+ def self.inherited(k)
21
+ k._file = caller_locations(1..1).first.absolute_path
23
22
  end
24
23
 
25
24
  def default_fonts(options)
26
25
  {
27
26
  bodyfont: (
28
- options[:script] == "Hans" ? '"Source Han Sans",serif' :
29
- configuration.html_bodyfont || '"Overpass",sans-serif'
27
+ if options[:script] == "Hans"
28
+ '"Source Han Sans",serif'
29
+ else
30
+ configuration.html_bodyfont || '"Overpass",sans-serif'
31
+ end
30
32
  ),
31
33
  headerfont: (
32
- options[:script] == "Hans" ? '"Source Han Sans",sans-serif' :
33
- configuration.html_headerfont || '"Overpass",sans-serif'
34
+ if options[:script] == "Hans"
35
+ '"Source Han Sans",sans-serif'
36
+ else
37
+ configuration.html_headerfont || '"Overpass",sans-serif'
38
+ end
34
39
  ),
35
40
  monospacefont: configuration.html_monospacefont || '"Space Mono",monospace',
36
41
  normalfontsize: configuration.html_normalfontsize,
@@ -43,21 +48,23 @@ module IsoDoc
43
48
  def default_file_locations(_options)
44
49
  {
45
50
  htmlstylesheet: baselocation(configuration.htmlstylesheet) ||
46
- html_doc_path("htmlstyle.scss"),
51
+ html_doc_path("htmlstyle.scss"),
47
52
  htmlcoverpage: baselocation(configuration.htmlcoverpage) ||
48
- html_doc_path("html_generic_titlepage.html"),
53
+ html_doc_path("html_generic_titlepage.html"),
49
54
  htmlintropage: baselocation(configuration.htmlintropage) ||
50
- html_doc_path("html_generic_intro.html"),
55
+ html_doc_path("html_generic_intro.html"),
51
56
  scripts: baselocation(configuration.scripts),
52
- i18nyaml: (configuration.i18nyaml.is_a?(String) ?
53
- baselocation(configuration.i18nyaml) : nil)
57
+ i18nyaml: (if configuration.i18nyaml.is_a?(String)
58
+ baselocation(configuration.i18nyaml)
59
+ end),
54
60
  }.transform_values { |v| v&.empty? ? nil : v }
55
61
  end
56
62
 
57
63
  def googlefonts
58
64
  return unless configuration.webfont
65
+
59
66
  Array(configuration.webfont).map do |x|
60
- %{<link href="#{x.gsub(/\&amp;/, '&')}" rel="stylesheet">}
67
+ %{<link href="#{x}" rel="stylesheet"/>}
61
68
  end.join("\n")
62
69
  end
63
70
 
@@ -66,4 +73,3 @@ module IsoDoc
66
73
  end
67
74
  end
68
75
  end
69
-
@@ -11,7 +11,7 @@ module IsoDoc
11
11
  @meta = Metadata.new(lang, script, i18n)
12
12
  end
13
13
 
14
- def xref_init(lang, script, klass, i18n, options)
14
+ def xref_init(lang, script, _klass, i18n, options)
15
15
  html = HtmlConvert.new(language: lang, script: script)
16
16
  @xrefs = Xref.new(lang, script, html, i18n, options)
17
17
  end
@@ -20,7 +20,7 @@ module IsoDoc
20
20
  f = Metanorma::Generic.configuration.i18nyaml
21
21
  f = nil unless f.is_a? String
22
22
  @i18n = I18n.new(
23
- lang, script, i18nyaml || f || @i18nyaml)
23
+ lang, script, i18nyaml: i18nyaml || f || @i18nyaml)
24
24
  end
25
25
 
26
26
  include Utils
@@ -5,16 +5,15 @@ require "isodoc"
5
5
  module IsoDoc
6
6
  module Generic
7
7
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
8
- def annex1(f)
9
- lbl = @xrefs.anchor(f['id'], :label)
10
- if t = f.at(ns("./title"))
8
+ def annex1(elem)
9
+ lbl = @xrefs.anchor(elem["id"], :label)
10
+ if t = elem.at(ns("./title"))
11
11
  t.children = "<strong>#{t.children.to_xml}</strong>"
12
12
  end
13
- prefix_name(f, "<br/>", lbl, "title")
13
+ prefix_name(elem, "<br/>", lbl, "title")
14
14
  end
15
15
 
16
16
  include Init
17
17
  end
18
18
  end
19
19
  end
20
-
@@ -527,7 +527,7 @@
527
527
  </define>
528
528
  <define name="LocalityType">
529
529
  <data type="string">
530
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
530
+ <param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
531
531
  </data>
532
532
  </define>
533
533
  <define name="referenceFrom">
@@ -677,6 +677,9 @@
677
677
  <zeroOrMore>
678
678
  <ref name="extent"/>
679
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
680
683
  <zeroOrMore>
681
684
  <ref name="accesslocation"/>
682
685
  </zeroOrMore>
@@ -848,17 +851,46 @@
848
851
  </define>
849
852
  <define name="bplace">
850
853
  <element name="place">
851
- <optional>
852
- <attribute name="uri">
853
- <data type="anyURI"/>
854
- </attribute>
855
- </optional>
856
- <optional>
857
- <attribute name="region"/>
858
- </optional>
854
+ <choice>
855
+ <text/>
856
+ <group>
857
+ <ref name="bibliocity"/>
858
+ <zeroOrMore>
859
+ <ref name="biblioregion"/>
860
+ </zeroOrMore>
861
+ <zeroOrMore>
862
+ <ref name="bibliocountry"/>
863
+ </zeroOrMore>
864
+ </group>
865
+ </choice>
866
+ </element>
867
+ </define>
868
+ <define name="bibliocity">
869
+ <element name="city">
859
870
  <text/>
860
871
  </element>
861
872
  </define>
873
+ <define name="biblioregion">
874
+ <element name="region">
875
+ <ref name="RegionType"/>
876
+ </element>
877
+ </define>
878
+ <define name="bibliocountry">
879
+ <element name="country">
880
+ <ref name="RegionType"/>
881
+ </element>
882
+ </define>
883
+ <define name="RegionType">
884
+ <optional>
885
+ <attribute name="iso"/>
886
+ </optional>
887
+ <optional>
888
+ <attribute name="recommended">
889
+ <data type="boolean"/>
890
+ </attribute>
891
+ </optional>
892
+ <text/>
893
+ </define>
862
894
  <define name="bprice">
863
895
  <element name="price">
864
896
  <attribute name="currency"/>
@@ -922,9 +954,29 @@
922
954
  <text/>
923
955
  </element>
924
956
  </define>
957
+ <define name="sizevalue">
958
+ <element name="value">
959
+ <attribute name="type"/>
960
+ <text/>
961
+ </element>
962
+ </define>
963
+ <define name="bibliographic_size">
964
+ <element name="size">
965
+ <oneOrMore>
966
+ <ref name="sizevalue"/>
967
+ </oneOrMore>
968
+ </element>
969
+ </define>
925
970
  <define name="extent">
926
971
  <element name="extent">
927
- <ref name="BibItemLocality"/>
972
+ <choice>
973
+ <zeroOrMore>
974
+ <ref name="locality"/>
975
+ </zeroOrMore>
976
+ <zeroOrMore>
977
+ <ref name="localityStack"/>
978
+ </zeroOrMore>
979
+ </choice>
928
980
  </element>
929
981
  </define>
930
982
  <define name="series">
@@ -32,6 +32,43 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="admonition">
36
+ <element name="admonition">
37
+ <attribute name="type">
38
+ <ref name="AdmonitionType"/>
39
+ </attribute>
40
+ <optional>
41
+ <attribute name="class"/>
42
+ </optional>
43
+ <attribute name="id">
44
+ <data type="ID"/>
45
+ </attribute>
46
+ <optional>
47
+ <attribute name="uri">
48
+ <data type="anyURI"/>
49
+ </attribute>
50
+ </optional>
51
+ <optional>
52
+ <attribute name="coverpage">
53
+ <data type="boolean"/>
54
+ </attribute>
55
+ </optional>
56
+ <optional>
57
+ <attribute name="notag">
58
+ <data type="boolean"/>
59
+ </attribute>
60
+ </optional>
61
+ <optional>
62
+ <ref name="tname"/>
63
+ </optional>
64
+ <zeroOrMore>
65
+ <ref name="paragraph-with-footnote"/>
66
+ </zeroOrMore>
67
+ <zeroOrMore>
68
+ <ref name="note"/>
69
+ </zeroOrMore>
70
+ </element>
71
+ </define>
35
72
  <define name="index">
36
73
  <element name="index">
37
74
  <optional>
@@ -851,6 +888,16 @@
851
888
  <ref name="MultilingualRenderingType"/>
852
889
  </attribute>
853
890
  </optional>
891
+ <optional>
892
+ <attribute name="coverpage">
893
+ <data type="boolean"/>
894
+ </attribute>
895
+ </optional>
896
+ <optional>
897
+ <attribute name="notag">
898
+ <data type="boolean"/>
899
+ </attribute>
900
+ </optional>
854
901
  <oneOrMore>
855
902
  <choice>
856
903
  <ref name="paragraph"/>
@@ -1178,6 +1225,7 @@
1178
1225
  <ref name="concept"/>
1179
1226
  <ref name="add"/>
1180
1227
  <ref name="del"/>
1228
+ <ref name="span"/>
1181
1229
  </choice>
1182
1230
  </define>
1183
1231
  <define name="add">
@@ -1204,6 +1252,14 @@
1204
1252
  </choice>
1205
1253
  </element>
1206
1254
  </define>
1255
+ <define name="span">
1256
+ <element name="span">
1257
+ <attribute name="class"/>
1258
+ <oneOrMore>
1259
+ <ref name="TextElement"/>
1260
+ </oneOrMore>
1261
+ </element>
1262
+ </define>
1207
1263
  <define name="concept">
1208
1264
  <element name="concept">
1209
1265
  <optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "2.0.3".freeze
3
+ VERSION = "2.1.1".freeze
4
4
  end
5
5
  end
@@ -3,7 +3,6 @@ require "metanorma/generic/version"
3
3
  require "forwardable"
4
4
  require "yaml"
5
5
 
6
-
7
6
  module Metanorma
8
7
  module Generic # rubocop:disable Style/MutableConstant
9
8
  ORGANIZATION_NAME_SHORT = "Acme"
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
28
28
 
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
- spec.add_dependency "metanorma-standoc", "~> 2.0.0"
30
+ spec.add_dependency "metanorma-standoc", "~> 2.1.0"
31
31
  spec.add_dependency "ruby-jing"
32
32
 
33
33
  spec.add_development_dependency "debug"
@@ -70,5 +70,5 @@ symbols_titles:
70
70
  - Abbreviations
71
71
  normref_titles:
72
72
  - Normative references
73
- bibliography_titles
73
+ bibliography_titles:
74
74
  - Bibliography
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.1
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-03-07 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0
33
+ version: 2.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.0
40
+ version: 2.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-jing
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
270
  - !ruby/object:Gem::Version
271
271
  version: '0'
272
272
  requirements: []
273
- rubygems_version: 3.2.32
273
+ rubygems_version: 3.3.9
274
274
  signing_key:
275
275
  specification_version: 4
276
276
  summary: Metanorma template gem for customisation.