isodoc 2.6.5 → 2.6.6

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: d1b8b00c0831edf5095dd6d4e24e93f9f6c5fb1fb5fa54d7b9ee67d6821f46d4
4
- data.tar.gz: 991204e016a3bc3817ecab867cbdfce29dfec3d9c58b46d84a08e1a557828f22
3
+ metadata.gz: 5facc53bb7c8a88619fbf516d9d4d749ee960311f32dcf9f536375ee0c25a806
4
+ data.tar.gz: a6fc8b7e15083a368e3527d4e745977de12fddf02d907163fcc142f41fa96fa2
5
5
  SHA512:
6
- metadata.gz: d2fe45089897f94107456c2b5035b30fb1b5b4ec30b102e7a057aadd4df3e46a00bef8b61bbbcd97265ee526bbd4ed758ead5c01c6d1086a6f22fa7f76558ed5
7
- data.tar.gz: 1b9bb6319fc0f65c4b613080cc05fe04da20cfec092b62976ea4664d58d3998eb3ad4c87ff6645d03a22f84b2dcc000e43de39d4351b55befac7b01471d6ddf7
6
+ metadata.gz: 55858670ba62d093769824d5888ba78d4af4170626c18e2f575e0fcfbaa6ea2e461b920664ad60911304329536846b89cd54d55688f43c9674938e426a366472
7
+ data.tar.gz: 0aded4a1dd614f01e6d5cff9ed4e8b6f7d4065694e156ec0023fdb7f9525243bd64bc9579a008587274c43f3d5a8af29aa88366cc366632e269434458734701a
@@ -50,6 +50,7 @@ module IsoDoc
50
50
  # sourcehighlighter: whether to apply sourcecode highlighting
51
51
  # semantic_xml_insert: whether to insert into presentation XML
52
52
  # a copy of semantic XML
53
+ # output_formats: hash of supported output formats and suffixes
53
54
  def initialize(options) # rubocop:disable Lint/MissingSuper
54
55
  @options = options_preprocess(options)
55
56
  init_stylesheets(@options)
@@ -97,7 +98,7 @@ module IsoDoc
97
98
  end
98
99
 
99
100
  def convert_init(file, input_filename, debug)
100
- docxml = Nokogiri::XML(file) { |config| config.huge }
101
+ docxml = Nokogiri::XML(file, &:huge)
101
102
  filename, dir = init_file(input_filename, debug)
102
103
  docxml.root.default_namespace = ""
103
104
  convert_i18n_init(docxml)
@@ -205,6 +205,8 @@ module IsoDoc
205
205
  end
206
206
  end
207
207
  end
208
+
209
+ def columnbreak_parse(node, out); end
208
210
  end
209
211
  end
210
212
  end
@@ -252,6 +252,7 @@ module IsoDoc
252
252
  when "variant-title" then variant_title(node, out)
253
253
  when "span" then span_parse(node, out)
254
254
  when "location" then location_parse(node, out)
255
+ when "columnbreak" then columnbreak_parse(node, out)
255
256
  else error_parse(node, out)
256
257
  end
257
258
  end
@@ -3,6 +3,9 @@ require "metanorma-utils"
3
3
  module IsoDoc
4
4
  module Function
5
5
  module Utils
6
+ Hash.include Metanorma::Utils::Hash
7
+ Array.include Metanorma::Utils::Array
8
+
6
9
  def to_xml(node)
7
10
  self.class.to_xml(node)
8
11
  end
@@ -166,8 +169,8 @@ module IsoDoc
166
169
  .merge(@labels ? { labels: @labels } : {})
167
170
  .merge(@meta.labels ? { labels: @meta.labels } : {})
168
171
  .merge(fonts_options || {})
169
- template = liquid(docxml)
170
- template.render(meta.map { |k, v| [k.to_s, empty2nil(v)] }.to_h)
172
+ liquid(docxml).render(meta.stringify_all_keys
173
+ .transform_values { |v| empty2nil(v) })
171
174
  .gsub("<", "<").gsub(">", ">").gsub("&", "&")
172
175
  end
173
176
 
data/lib/isodoc/init.rb CHANGED
@@ -48,6 +48,7 @@ module IsoDoc
48
48
  @aligncrosselements = options[:aligncrosselements]
49
49
  @modspecidentifierbase = options[:modspecidentifierbase]
50
50
  @sourcehighlighter = options[:sourcehighlighter]
51
+ @output_formats = options[:output_formats] || {}
51
52
  end
52
53
 
53
54
  def init_arrangement(options)
@@ -3,7 +3,7 @@ require_relative "metadata_contributor"
3
3
 
4
4
  module IsoDoc
5
5
  class Metadata
6
- attr_accessor :fonts_options
6
+ attr_accessor :fonts_options, :labels
7
7
 
8
8
  def ns(xpath)
9
9
  Common::ns(xpath)
@@ -109,6 +109,7 @@ module IsoDoc
109
109
  end
110
110
 
111
111
  def svg_to_emf(node)
112
+ @output_formats[:doc] or return
112
113
  uri = svg_to_emf_uri(node)
113
114
  svg_impose_height_attr(node)
114
115
  ret = imgfile_suffix(uri, "emf")
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "2.6.5".freeze
2
+ VERSION = "2.6.6".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.5
4
+ version: 2.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-09 00:00:00.000000000 Z
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html2doc