metanorma 2.1.10 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8d17619f5a369f5df52db09ddae40490b5ceb22cd3932e22b8fa382d3bd078d
4
- data.tar.gz: b4ecb80e39e4d282b0d1a6ccb6523aeb519b2431211de5510f4fad81f09db04e
3
+ metadata.gz: af06733dd8691111633e6309c85ebfa069baa2edf16cbd7e8458a17ad34d4b2a
4
+ data.tar.gz: e924bb9b298cc37c2cebef6f8d9251ae3979e9cd9b537539057a5ade07e11c88
5
5
  SHA512:
6
- metadata.gz: 8b8fd5e20992cd0508fbcdb96ce7e4c0b2fca460a9ae1f8b7231ed2e43a4e15f3536fd30b7b717d1c3a00a8065e0064749eff22726c7100aae26301f606a7b69
7
- data.tar.gz: 476bd02101c3f23e99b6c414f839e442351adf137ddc2e922c6ae822ea95e7d6f5c66f98f062bfe51299d9ffb28a00f81dd8fefce5f42ac4ba94c39ac8755c32
6
+ metadata.gz: 29499feb91dd56f4fe6f281f885263c897fb555a9905ce3a32b56d175199b520e9066041ff96489d5221302c259a08bf0d3c07bde19a232b3893d79a0bde747b
7
+ data.tar.gz: 717f1409b88dfc565393c71cddb0fda604e062d38e80b45c470dc06957ac5e7cf2f5adfd7ef7083666aeb4f7f7b6356fcbc95014bb2e9091c9c927232d7c225f
@@ -6,6 +6,7 @@ require "htmlentities"
6
6
  require "yaml"
7
7
  require "fontist"
8
8
  require "fontist/manifest/install"
9
+ require "metanorma-taste"
9
10
  require_relative "writeable"
10
11
  require_relative "validator"
11
12
  require_relative "compile_options"
@@ -182,17 +183,11 @@ module Metanorma
182
183
  "#{attrs.join("\n")}\n\n#{rest}"
183
184
  end
184
185
 
185
- # TODO: to config
186
186
  def process_input_adoc_overrides(attrs, options)
187
- case options[:supplied_type]
188
- when :icc
189
- f = File.join(File.dirname(__FILE__), "assets", "icc-boilerplate.adoc")
190
- [":boilerplate-authority: #{f}",
191
- ":publisher: International Color Consortium",
192
- ":publisher_abbr: ICC"].each { |a| attrs << a }
193
- options[":boilerplate-authority:"] = f
194
- end
195
- attrs
187
+ @registry.tastes.available_tastes.include?(options[:supplied_type]) or
188
+ return
189
+ c = Metanorma::TasteRegister.get(options[:supplied_type])
190
+ c.process_input_adoc_overrides(attrs, options)
196
191
  end
197
192
 
198
193
  def process_input_adoc_includes(file, filename)
@@ -92,8 +92,7 @@ module Metanorma
92
92
 
93
93
  def get_isodoc_options(file, options, ext)
94
94
  ret = @processor.extract_options(file)
95
- dir = options[:filename].sub(%r(/[^/]+$), "/")
96
- ret[:i18nyaml] &&= File.join(dir, ret[:i18nyaml])
95
+ get_isodoc_i18nyaml(options, ret)
97
96
  copy_isodoc_options_attrs(options, ret)
98
97
  font_manifest_mn2pdf(options, ret, ext)
99
98
  ret[:output_formats]&.select! do |k, _|
@@ -103,6 +102,13 @@ module Metanorma
103
102
  ret
104
103
  end
105
104
 
105
+ def get_isodoc_i18nyaml(options, ret)
106
+ dir = File.dirname(options[:filename])
107
+ ret[:i18nyaml] or return
108
+ (Pathname.new ret[:i18nyaml]).absolute? or
109
+ ret[:i18nyaml] = File.join(dir, ret[:i18nyaml])
110
+ end
111
+
106
112
  def copy_isodoc_options_attrs(options, ret)
107
113
  ret[:datauriimage] = true if options[:datauriimage]
108
114
  ret[:sourcefilename] = options[:filename]
@@ -55,6 +55,7 @@ module Metanorma
55
55
  pdf-owner-password pdf-allow-copy-content pdf-allow-edit-content
56
56
  pdf-allow-assemble-document pdf-allow-edit-annotations
57
57
  pdf-allow-print pdf-allow-print-hq pdf-allow-fill-in-forms
58
+ pdf-stylesheet pdf-stylesheet-override
58
59
  fonts font-license-agreement pdf-allow-access-content
59
60
  pdf-encrypt-metadata iso-word-template document-scheme
60
61
  localize-number iso-word-bg-strip-color modspec-identifier-base)
@@ -1,6 +1,7 @@
1
1
  # Registry of all Metanorma types and entry points
2
2
 
3
3
  require "singleton"
4
+ require "metanorma-taste"
4
5
 
5
6
  class Error < StandardError
6
7
  end
@@ -9,13 +10,17 @@ module Metanorma
9
10
  class Registry
10
11
  include Singleton
11
12
 
12
- attr_reader :processors
13
+ attr_reader :processors, :tastes
13
14
 
14
15
  # TODO: make aliases configurable
15
16
  def initialize
16
17
  @processors = {}
17
- @aliases = { csd: :cc, m3d: :m3aawg, mpfd: :mpfa, csand: :csa,
18
- icc: :iso }
18
+ @tastes = Metanorma::TasteRegister.instance
19
+ tastealiases = @tastes.available_tastes.each_with_object({}) do |x, m|
20
+ m[x] = @tastes.taste_info(x)[:base_flavor]
21
+ end
22
+ @aliases = { csd: :cc, m3d: :m3aawg, mpfd: :mpfa, csand: :csa }
23
+ .merge tastealiases
19
24
  end
20
25
 
21
26
  def alias(flavour)
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "2.1.10".freeze
2
+ VERSION = "2.2.0".freeze
3
3
  end
data/metanorma.gemspec CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_runtime_dependency "fontist", ">= 1.14.3"
30
30
  spec.add_runtime_dependency "htmlentities"
31
31
  spec.add_runtime_dependency "isodoc", ">= 3.0.0"
32
+ spec.add_runtime_dependency "metanorma-taste"
32
33
  spec.add_runtime_dependency "mn2pdf", "~> 2"
33
34
  spec.add_runtime_dependency "nokogiri"
34
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.10
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-26 00:00:00.000000000 Z
11
+ date: 2025-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: metanorma-taste
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: mn2pdf
85
99
  requirement: !ruby/object:Gem::Requirement