suma 0.5.28 → 0.5.30

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: 0bb8744184776002c6d02458beb0f97029bc00a8b2435e687391898433e3b48b
4
- data.tar.gz: a3db39f829a59d6d40c77515fd45d1ca00cf2029aa857e57595ba556a145a8a5
3
+ metadata.gz: 6c4133e715420dbc264798602c9bb0dbebf8a537f5b2f8bdaccb84258fcc37d7
4
+ data.tar.gz: e994b0e3f502603fcd1b7f7eb45a93cf724bb1b844dce598775e0e6f7fc200b2
5
5
  SHA512:
6
- metadata.gz: 55be8bebac14f2c3e70c6e80371aae3219ebb853aba0eaf8a6f9a3c4887eb5f7c8bee4a879c7641699a17f6817260241ab7de757b8aaf6d2ef96844034e39964
7
- data.tar.gz: 2b0a3ca43fcc0b609653ffe3b4d3b0754a83502dd591bf2dc3f19a5ddc850e454be488333583c467d5571293d931659cc5a8033425a0bf5d1e216c0515ff8fff
6
+ metadata.gz: 6316644ee7b6ed8d3bd6cf3b5520a132ee81f457b7ad797a50a4fdecb0a44570e1e28835c542e2a11ab582303da3e7670b955e372ffcc98e3a7f9c5178b77a61
7
+ data.tar.gz: ab7268c9cb367028d620cca8de69719f3e44e606f8ee60d7925d45b57d836b86b1b3562d4cb186d9688b30a30b7d7c9a394bb7cdb75b0dee080e013b12033658
@@ -10,6 +10,9 @@ module Suma
10
10
  "Build collection specified in site manifest (`metanorma*.yml`)"
11
11
  option :compile, type: :boolean, default: true,
12
12
  desc: "Compile or skip compile of collection"
13
+ option :ext, type: :string, aliases: "-x",
14
+ desc: "Comma-separated schema-doc output formats " \
15
+ "(e.g. html) - overrides the template defaults"
13
16
  option :schemas_all_path, type: :string, aliases: "-s",
14
17
  desc: "Generate file that contains all schemas in the collection."
15
18
  option :staged, type: :boolean, default: false,
@@ -85,13 +88,20 @@ module Suma
85
88
  private
86
89
 
87
90
  def run(manifest, options)
88
- schemas_all_path = options[:schemas_all_path] ||
89
- manifest.gsub("metanorma", "schemas")
90
-
91
91
  Processor.new(
92
92
  metanorma_yaml_path: manifest,
93
- schemas_all_path: schemas_all_path,
94
- compile: options[:compile],
93
+ schemas_all_path: schemas_all_path(manifest, options),
94
+ **processor_options(options),
95
+ **staged_options(options),
96
+ ).run
97
+ end
98
+
99
+ def schemas_all_path(manifest, options)
100
+ options[:schemas_all_path] || manifest.gsub("metanorma", "schemas")
101
+ end
102
+
103
+ def processor_options(options)
104
+ { compile: options[:compile],
95
105
  output_directory: "_site",
96
106
  incremental: options[:incremental],
97
107
  state_file: options[:state_file],
@@ -100,9 +110,8 @@ module Suma
100
110
  sign_method: options[:sign],
101
111
  sign_key: options[:sign_key],
102
112
  no_valid: options[:no_valid],
103
- unresolved_eref_markers: options[:unresolved_eref_markers],
104
- **staged_options(options),
105
- ).run
113
+ ext: options[:ext],
114
+ unresolved_eref_markers: options[:unresolved_eref_markers] }
106
115
  end
107
116
 
108
117
  def staged_options(options)
data/lib/suma/cli/core.rb CHANGED
@@ -23,6 +23,9 @@ module Suma
23
23
  "Build collection specified in site manifest (`metanorma*.yml`)"
24
24
  # Mirrors so Core accepts the switches Cli::Build reparses; the inner
25
25
  # class owns their declarations.
26
+ option :ext, type: :string, aliases: "-x",
27
+ desc: "Comma-separated schema-doc output formats " \
28
+ "(e.g. html) - overrides the template defaults"
26
29
  option :compile, type: :boolean, default: true,
27
30
  desc: "Compile or skip compile of collection"
28
31
  option :schemas_all_path, type: :string, aliases: "-s",
@@ -78,12 +78,21 @@ module Suma
78
78
  private
79
79
 
80
80
  def build_initial_notes
81
- trimmed = trim_definition(remarks)
81
+ trimmed = trim_definition(remarks_without_figure_blocks)
82
82
  return [] unless trimmed && !trimmed.empty?
83
83
 
84
84
  [Glossarist::V3::DetailedDefinition.new(content: trimmed)]
85
85
  end
86
86
 
87
+ # Expressg figure blocks are figure metadata, not note prose: their
88
+ # `.svgmap` hotspot lists render through the schema document itself,
89
+ # and treating them as notes leaks `<<express:...>>` hotspot targets
90
+ # into concept notes as mis-namespaced citations that fold corrupt
91
+ # at rest (iso-10303 part-2: 2 corrupted mentions).
92
+ def remarks_without_figure_blocks
93
+ Array(remarks).reject { |remark| remark.to_s.include?("[.svgmap]") }
94
+ end
95
+
87
96
  def trim_definition(definition)
88
97
  return nil if definition.nil? || definition.empty?
89
98
 
@@ -18,7 +18,8 @@ module Suma
18
18
  staged_reinflate_shard: nil,
19
19
  incremental: false, state_file: nil, jobs: 1,
20
20
  provenance_file: nil, sign_method: nil, sign_key: nil,
21
- no_valid: false, unresolved_eref_markers: false)
21
+ no_valid: false, unresolved_eref_markers: false,
22
+ ext: nil)
22
23
  @metanorma_yaml_path = metanorma_yaml_path
23
24
  @schemas_all_path = schemas_all_path
24
25
  @compile_flag = compile
@@ -40,6 +41,7 @@ module Suma
40
41
  # Skip Metanorma document validation (metanorma `--no-valid`). Opt-in:
41
42
  # for collections whose flavor's validators are still in flight.
42
43
  @no_valid = no_valid
44
+ @ext = ext
43
45
  @unresolved_eref_markers = unresolved_eref_markers
44
46
  end
45
47
 
@@ -147,6 +149,7 @@ module Suma
147
149
  state_file: @state_file,
148
150
  jobs: @jobs,
149
151
  no_valid: @no_valid,
152
+ ext: @ext,
150
153
  },
151
154
  )
152
155
 
@@ -126,6 +126,7 @@ module Suma
126
126
  output_path: @output_path_docs.join(express.id),
127
127
  template: template_class.new(express.id),
128
128
  no_valid: @options[:no_valid],
129
+ extensions: @options[:ext],
129
130
  )
130
131
 
131
132
  @docs[express.id] = compiler
@@ -23,12 +23,14 @@ module Suma
23
23
 
24
24
  attr_reader :schema, :id, :output_path, :template
25
25
 
26
- def initialize(schema:, output_path:, template:, no_valid: false)
26
+ def initialize(schema:, output_path:, template:, no_valid: false,
27
+ extensions: nil)
27
28
  @schema = schema
28
29
  @id = schema.id
29
30
  @output_path = output_path
30
31
  @template = template
31
32
  @no_valid = no_valid
33
+ @extensions_override = extensions
32
34
  end
33
35
 
34
36
  def compile
@@ -48,13 +50,17 @@ module Suma
48
50
  end
49
51
 
50
52
  def extensions
51
- template.extensions
53
+ @extensions_override || template.extensions
52
54
  end
53
55
 
54
56
  # Options handed to Metanorma::Compile. Exposed for specs.
55
57
  def compile_options
56
58
  { agree_to_terms: true, install_fonts: false }.tap do |options|
57
59
  options[:novalid] = true if @no_valid
60
+ if @extensions_override
61
+ options[:extension_keys] =
62
+ @extensions_override.split(",").map { |x| x.strip.to_sym }
63
+ end
58
64
  end
59
65
  end
60
66
 
data/lib/suma/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Suma
4
- VERSION = "0.5.28"
4
+ VERSION = "0.5.30"
5
5
  end
data/suma.gemspec CHANGED
@@ -33,6 +33,8 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
33
33
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ["lib"]
35
35
 
36
+ # Bundled gem required directly by lib code: base64 in jsdai/figure_image.rb (metanorma/metanorma#669)
37
+ spec.add_dependency "base64"
36
38
  spec.add_dependency "expressir"
37
39
  spec.add_dependency "glossarist", "~> 2.8", ">= 2.8.7"
38
40
  spec.add_dependency "leptris"
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.28
4
+ version: 0.5.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-07 00:00:00.000000000 Z
11
+ date: 2026-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: expressir
15
29
  requirement: !ruby/object:Gem::Requirement