metanorma-generic 2.6.5 → 2.7.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: 362b19c7415032ba198d240f6c5a68be9b78940805adf49dc2a326c367ef5b85
4
- data.tar.gz: 75c6592984d97612670ea424b475497a5d0b63e13c05971944cf7cf476b9ba9d
3
+ metadata.gz: b3436616b2990529b36337c88267a1bb486c784760ee9e5dd44e8261d16d3a91
4
+ data.tar.gz: d203b11d9d077960844d90a4245c19fcfdd533c917bc6fbda7d2600fa3c0a8eb
5
5
  SHA512:
6
- metadata.gz: d700d636ee17e775efa41fe6b3ffca21c1ebee6cc3e05b88854836ae8ca3209ce5aef30cc0163091e0b34dc8bf7d41d7530b43f9df168369bc7fc9e4c0aac818
7
- data.tar.gz: 71b1247e84c43031bb4ff5dae8a9a44bb8b7d717b8a512f8e9b6f6541746f252b953876a3c4bbe4a1cf070405ac77e8e3340650015cccc4b5071b0d5b5880e7d
6
+ metadata.gz: 36d17d3720c65830aecaaec84e9cfda717044f1024112ed52cb2bea93ce65db0a31f3e55da1f7637bf2306b11bf0d69cc18b5e77818952aea9b6bdad1b1470e8
7
+ data.tar.gz: 561e57900505474883823a8a6c7d7fb41b5fa6c49ae04ec284ba14d35dad45f520fa36881cc30dce6bc1298293c85f3ec1f3b2a2c20b3dc659d66308e739598f
@@ -0,0 +1,21 @@
1
+ require_relative "base_convert"
2
+ require "metanorma-generic"
3
+ require "isodoc"
4
+
5
+ module IsoDoc
6
+ module Generic
7
+ class PdfConvert < IsoDoc::XslfoPdfConvert
8
+ def initialize(options)
9
+ @libdir = File.dirname(__FILE__)
10
+ super
11
+ end
12
+
13
+ def pdf_stylesheet(docxml)
14
+ configuration.pdf_stylesheet
15
+ end
16
+
17
+ include BaseConvert
18
+ include Init
19
+ end
20
+ end
21
+ end
@@ -1,6 +1,7 @@
1
1
  require "isodoc/generic/metadata"
2
2
  require "isodoc/generic/html_convert"
3
3
  require "isodoc/generic/word_convert"
4
+ require "isodoc/generic/pdf_convert"
4
5
  require "isodoc/generic/presentation_xml_convert"
5
6
 
6
7
  module IsoDoc
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.3.2 -->
20
+ <!-- VERSION v1.3.3 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -331,9 +331,9 @@
331
331
  <zeroOrMore>
332
332
  <ref name="table-note"/>
333
333
  </zeroOrMore>
334
- <optional>
334
+ <zeroOrMore>
335
335
  <ref name="source"/>
336
- </optional>
336
+ </zeroOrMore>
337
337
  </define>
338
338
  <define name="FigureAttr">
339
339
  <optional>
@@ -380,9 +380,9 @@
380
380
  <zeroOrMore>
381
381
  <ref name="note"/>
382
382
  </zeroOrMore>
383
- <optional>
383
+ <zeroOrMore>
384
384
  <ref name="source"/>
385
- </optional>
385
+ </zeroOrMore>
386
386
  </define>
387
387
  <define name="source">
388
388
  <element name="source">
@@ -21,6 +21,10 @@ module Metanorma
21
21
  )
22
22
  end
23
23
 
24
+ def fonts_manifest
25
+ configuration&.fonts_manifest
26
+ end
27
+
24
28
  def version
25
29
  "Metanorma::Generic #{Metanorma::Generic::VERSION}"
26
30
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "2.6.5".freeze
3
+ VERSION = "2.7.0".freeze
4
4
  end
5
5
  end
@@ -21,6 +21,7 @@ module Metanorma
21
21
  docid_template
22
22
  doctypes
23
23
  default_doctype
24
+ fonts_manifest
24
25
  i18nyaml
25
26
  logo_path
26
27
  logo_paths
@@ -60,13 +61,14 @@ module Metanorma
60
61
  word_smallerfontsize
61
62
  word_footnotefontsize
62
63
  xml_root_tag
64
+ pdf_stylesheet
63
65
  ].freeze
64
66
 
65
67
  def filepath_attrs
66
- %i[i18nyaml boilerplate logo_path logo_paths header
68
+ %i[i18nyaml boilerplate logo_path logo_paths header boilerplate
67
69
  htmlcoverpage htmlintropage htmlstylesheet scripts scripts_pdf
68
70
  standardstylesheet validate_rng_file wordcoverpage wordintropage
69
- wordstylesheet]
71
+ wordstylesheet pdf_stylesheet]
70
72
  end
71
73
 
72
74
  attr_accessor(*CONFIG_ATTRS)
@@ -116,7 +118,8 @@ module Metanorma
116
118
  end
117
119
 
118
120
  def set_default_values_from_yaml_file_prep(config_file)
119
- root_path = File.dirname(self.class::_file || __FILE__)
121
+ # root_path = File.dirname(self.class::_file || __FILE__)
122
+ root_path = File.dirname(config_file)
120
123
  default_config_options =
121
124
  YAML.safe_load(File.read(config_file, encoding: "UTF-8"))
122
125
  default_config_options["doctypes"].is_a? Array and
@@ -133,12 +136,10 @@ module Metanorma
133
136
 
134
137
  def absolute_path(value, root_path)
135
138
  if value.is_a? Hash then absolute_path1(value, root_path)
136
- elsif value.is_a? Array
137
- value.reject { |a| blank?(a) }.each_with_object([]) do |v1, g|
138
- g << absolute_path(v1, root_path)
139
- end
140
- elsif value.is_a?(String) && !value.empty?
141
- File.join(root_path, "..", "..", value)
139
+ elsif value.is_a? Array then absolute_path1_array(value, root_path)
140
+ elsif value.is_a?(String) && !value.empty? &&
141
+ !Pathname.new(value).absolute?
142
+ Pathname.new(File.join(root_path, value)).cleanpath.to_s
142
143
  else value
143
144
  end
144
145
  end
@@ -148,6 +149,12 @@ module Metanorma
148
149
  absolute_path(v, pref)
149
150
  end
150
151
  end
152
+
153
+ def absolute_path1_array(value, pref)
154
+ value.reject { |a| blank?(a) }.each_with_object([]) do |v1, g|
155
+ g << absolute_path(v1, pref)
156
+ end
157
+ end
151
158
  end
152
159
 
153
160
  class << self
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
29
29
 
30
- spec.add_dependency "metanorma-standoc", "~> 2.9.0"
30
+ spec.add_dependency "metanorma-standoc", "~> 2.9.3"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -39,4 +39,5 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "sassc", "2.4.0"
40
40
  spec.add_development_dependency "simplecov", "~> 0.15"
41
41
  spec.add_development_dependency "timecop", "~> 0.9"
42
+ spec.add_development_dependency "xml-c14n"
42
43
  end
@@ -25,6 +25,7 @@ header: /metanorma-mine/lib/isodoc/mine/html/header.html
25
25
  wordcoverpage: /metanorma-mine/lib/isodoc/mine/html/word_mine_titlepage.html
26
26
  wordintropage: /metanorma-mine/lib/isodoc/mine/html/word_mine_intro.html
27
27
  wordstylesheet: /metanorma-mine/lib/isodoc/mine/html/wordstyle.scss
28
+ pdf_stylesheet: /metanorma-mine/lib/isodoc/mine/html/mine.xsl
28
29
  word_bodyfont: '"Source Sans Pro","Arial",sans-serif'
29
30
  word_headerfont: '"Source Sans Pro","Arial",sans-serif'
30
31
  word_monospacefont: '"Source Code Pro",monospace'
@@ -72,3 +73,6 @@ normref_titles:
72
73
  - Normative references
73
74
  bibliography_titles:
74
75
  - Bibliography
76
+ fonts_manifest:
77
+ - Font1
78
+ - Font2
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.6.5
4
+ version: 2.7.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: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-08-19 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: 2.9.0
19
+ version: 2.9.3
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.9.0
26
+ version: 2.9.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0.9'
167
+ - !ruby/object:Gem::Dependency
168
+ name: xml-c14n
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  description: |
168
182
  Metanorma template gem for customisation. This gem is meant to be customised for any downstream use.
169
183
 
@@ -201,6 +215,7 @@ files:
201
215
  - lib/isodoc/generic/i18n.rb
202
216
  - lib/isodoc/generic/init.rb
203
217
  - lib/isodoc/generic/metadata.rb
218
+ - lib/isodoc/generic/pdf_convert.rb
204
219
  - lib/isodoc/generic/presentation_xml_convert.rb
205
220
  - lib/isodoc/generic/utils.rb
206
221
  - lib/isodoc/generic/word_convert.rb