metanorma 1.3.8 → 1.3.9

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: d8b82f79d4ce3a18564bd84c137faeca4daf763e2284464f390476fb881a0996
4
- data.tar.gz: f6a33995af907243fd0ae9ebff3676467455f21cd502089da6599783b4ba4e86
3
+ metadata.gz: 46ea9a7ce8316d94001c40043488f3472bcf639264e446bfb5bfaad88b6bed70
4
+ data.tar.gz: 7e4bfc4c4346c518d845052fd2dbb0b1f51f63e2951a317c18d938f9663cdea3
5
5
  SHA512:
6
- metadata.gz: 484b71a094f6e23f5e512ffcbc8eac5bed0cd6d5b3fc6e952a28ce05e0e9eef3b64bff995692fd43f36b0c7888814b20318559aeeb0d9dee7900baf0847d95b8
7
- data.tar.gz: 508757811e5a63b30b91d4353fdc2a983bfe269da85f39b9be50d0c6a904113965ae53c40052cd43fb38ee740c350b9922d114bfd21833383a525782d278f95c
6
+ metadata.gz: fdb777c1e35bbeeac65f3e5b0654ead9633a196340017da8cd4bd84342a9500a891a14ac19d83cc0cda0e5301728afdddf367fa3871eece62b389d93d0144238
7
+ data.tar.gz: c264222db4c7e2cbd7342aac8da9c5480a1d48f277ce2c5ef23000443d618379abb0769d111a8846733d60a53364706a65edd1a14de7ada03b94d16182c479bb
@@ -52,7 +52,7 @@ module Metanorma
52
52
  def options_extract(filename, options)
53
53
  content = read_file(filename)
54
54
  o = Metanorma::Input::Asciidoc.new.extract_metanorma_options(content)
55
- o = o.merge(xml_options_extract(content))
55
+ .merge(xml_options_extract(content))
56
56
  options[:type] ||= o[:type]&.to_sym
57
57
  t = @registry.alias(options[:type]) and options[:type] = t
58
58
  dir = filename.sub(%r(/[^/]+$), "/")
@@ -130,9 +130,7 @@ module Metanorma
130
130
 
131
131
  def clean_sourcecode(xml)
132
132
  xml.xpath(".//callout | .//annotation | .//xmlns:callout | "\
133
- ".//xmlns:annotation").each do |x|
134
- x.remove
135
- end
133
+ ".//xmlns:annotation").each(&:remove)
136
134
  xml.xpath(".//br | .//xmlns:br").each { |x| x.replace("\n") }
137
135
  HTMLEntities.new.decode(xml.children.to_xml)
138
136
  end
@@ -177,8 +175,8 @@ module Metanorma
177
175
  end
178
176
 
179
177
  REQUIREMENT_XPATH = "//requirement | //xmlns:requirement | "\
180
- "//recommendation | //xmlns:recommendation | //permission | "\
181
- "//xmlns:permission".freeze
178
+ "//recommendation | //xmlns:recommendation | //permission | "\
179
+ "//xmlns:permission".freeze
182
180
 
183
181
  def requirement_export(xml, dirname)
184
182
  xml.at(REQUIREMENT_XPATH) or return
@@ -218,9 +216,11 @@ module Metanorma
218
216
  else
219
217
  begin
220
218
  if @processor.use_presentation_xml(ext)
221
- @processor.output(nil, presentationxml_name, outfilename, ext, isodoc_options)
219
+ @processor.output(nil, presentationxml_name, outfilename, ext,
220
+ isodoc_options)
222
221
  else
223
- @processor.output(isodoc, xml_name, outfilename, ext, isodoc_options)
222
+ @processor.output(isodoc, xml_name, outfilename, ext,
223
+ isodoc_options)
224
224
  end
225
225
  rescue StandardError => e
226
226
  isodoc_error_process(e)
@@ -46,8 +46,7 @@ module Metanorma
46
46
 
47
47
  def coll_cover
48
48
  <<~COVER
49
- <html>
50
- <head/>
49
+ <html><head/>
51
50
  <body>
52
51
  <h1>{{ doctitle }}</h1>
53
52
  <h2>{{ docnumber }}</h2>
@@ -102,17 +101,6 @@ module Metanorma
102
101
  outname
103
102
  end
104
103
 
105
- # def xref_preprocess(xml)
106
- # svg_preprocess(xml)
107
- # key = (0...8).map { rand(65..90).chr }.join # random string
108
- # xml.root["type"] = key # to force recognition of internal refs
109
- # refs = eref_to_internal_eref(xml, key)
110
- # refs += xref_to_internal_eref(xml, key)
111
- # ins = new_hidden_ref(xml)
112
- # copy_repo_items_biblio(ins, xml)
113
- # insert_indirect_biblio(ins, refs, key)
114
- # end
115
-
116
104
  def xref_preprocess(xml)
117
105
  svg_preprocess(xml)
118
106
  key = (0...8).map { rand(65..90).chr }.join # random string
@@ -136,7 +124,7 @@ module Metanorma
136
124
 
137
125
  a["href"] = a["href"].sub(/^#/, "")
138
126
  m << "<target href='#{a['href']}'>"\
139
- "<xref target='#{a['href']}'/></target>"
127
+ "<xref target='#{a['href']}'/></target>"
140
128
  end
141
129
  end
142
130
  end
@@ -224,9 +212,7 @@ module Metanorma
224
212
 
225
213
  def recursive_string_keys(hash)
226
214
  case hash
227
- when Hash then Hash[
228
- hash.map { |k, v| [k.to_s, recursive_string_keys(v)] }
229
- ]
215
+ when Hash then hash.map { |k, v| [k.to_s, recursive_string_keys(v)] }.to_h
230
216
  when Enumerable then hash.map { |v| recursive_string_keys(v) }
231
217
  else
232
218
  hash
@@ -246,9 +232,8 @@ module Metanorma
246
232
  directives: ["presentation-xml", "bare-after-first"],
247
233
  bibdata: {
248
234
  title: {
249
- type: "title-main",
250
- language: @lang,
251
- content: xml.at(ns("//bibdata/title")).text,
235
+ type: "title-main", language: @lang,
236
+ content: xml.at(ns("//bibdata/title")).text
252
237
  },
253
238
  type: "collection",
254
239
  docid: {
@@ -257,11 +242,10 @@ module Metanorma
257
242
  },
258
243
  },
259
244
  manifest: {
260
- level: "collection",
261
- title: "Collection",
245
+ level: "collection", title: "Collection",
262
246
  docref: files.sort_by { |f| f[:order] }.each.map do |f|
263
247
  { fileref: f[:url], identifier: f[:title] }
264
- end,
248
+ end
265
249
  },
266
250
  }
267
251
  recursive_string_keys(ret).to_yaml
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "1.3.8".freeze
2
+ VERSION = "1.3.9".freeze
3
3
  end
data/metanorma.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.required_ruby_version = ">= 2.5.0"
24
24
 
25
25
  spec.add_runtime_dependency "asciidoctor"
26
- spec.add_runtime_dependency "fontist", "~> 1.9.0"
26
+ spec.add_runtime_dependency "fontist", "~> 1.11"
27
27
  spec.add_runtime_dependency "htmlentities"
28
28
  spec.add_runtime_dependency "metanorma-utils", "~> 1.2.0"
29
29
  spec.add_runtime_dependency "mn2pdf", "~> 1"
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: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-03 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.9.0
33
+ version: '1.11'
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: 1.9.0
40
+ version: '1.11'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: htmlentities
43
43
  requirement: !ruby/object:Gem::Requirement