metanorma 2.2.2 → 2.2.3

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: 6c21a32c429827b3a3f308801ec2e8617f2e30f2baf8c8e5e6c80f2c105b0ce2
4
- data.tar.gz: b59f55514b1413623471c7c408a7688a87513f03aca899afeb433372577f37e1
3
+ metadata.gz: ab41d7fdd92143add890202f0e64c0c88216c7936e603a0efd7a41df02b833c3
4
+ data.tar.gz: '09fc660fdf0eddeb88ee0094560113a2d05504767c0b6c220a63be6be7e80eea'
5
5
  SHA512:
6
- metadata.gz: 06e63a51abf0ff822b2f6bed6cf51a1c0a55f08375aff1aec64d41016fd5c3f4d61ed21661911dee7bb9c4477a406b1a5bd125f95c2d00a9096415249cba24c5
7
- data.tar.gz: 78352215966b37d04fbb5cb0203bd65d725b63eade9652ecf2142ef4d9b594fe69229232de6e5796c44c782cef3763af4e5d31c2eee2a0f67e8ab3c66bc470da
6
+ metadata.gz: 82c0f8b50777b5cf34262690a6e860d189c5eecf4b5365375ef24872e847d8c04d4624731155407d89b86d3d6839ce0295b3c3c44d76a350139555ff3c8d47fa
7
+ data.tar.gz: a7f8736e34eb0bc5ab76092ab9eeaae682f1058d52f634bc8d06f45cfa26982ef97813584430af5eb262317b6fdde7baf065c2c077645727f4a32dd569974479
data/README.adoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma.svg["Gem Version", link="https://rubygems.org/gems/metanorma"]
4
4
  image:https://github.com/metanorma/metanorma/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma/actions?workflow=rake"]
5
- image:https://codeclimate.com/github/metanorma/metanorma/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma"]
5
+ // image:https://codeclimate.com/github/metanorma/metanorma/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma"]
6
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma.svg["Pull Requests", link="https://github.com/metanorma/metanorma/pulls"]
7
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma/releases"]
8
8
 
@@ -26,7 +26,6 @@ module Metanorma
26
26
  @disambig = Util::DisambigFiles.new
27
27
  @manifest = parent.manifest
28
28
  read_files(@manifest.entry, parent.manifest)
29
- #warn pp @files
30
29
  end
31
30
 
32
31
  def read_files(entries, parent)
@@ -11,7 +11,6 @@ module Metanorma
11
11
  # warn "metanorma compile -x html #{f.path}"
12
12
  def file_compile(file, filename, identifier)
13
13
  @files.get(identifier, :sectionsplit) and return
14
- #require "debug"; binding.b
15
14
  opts = {
16
15
  format: :asciidoc,
17
16
  extension_keys: @files.get(identifier, :format),
@@ -181,9 +181,12 @@ module Metanorma
181
181
  # collection manifest
182
182
  def coverpage
183
183
  @coverpage or return
184
+
185
+ @coverpage_path = Util::rel_path_resolve(@dirname, @coverpage)
184
186
  warn "\n\n\n\n\nCoverpage: #{DateTime.now.strftime('%H:%M:%S')}"
187
+
185
188
  File.open(File.join(@outdir, "index.html"), "w:UTF-8") do |f|
186
- f.write @isodoc.populate_template(File.read(@coverpage))
189
+ f.write @isodoc.populate_template(File.read(@coverpage_path))
187
190
  end
188
191
  end
189
192
  end
@@ -11,21 +11,31 @@ module Metanorma
11
11
  end
12
12
 
13
13
  def svgmap_resolve(docxml, docid, presxml)
14
+ ids, docxml, isodoc, tag = svgmap_resolve_prep(docxml, docid, presxml)
15
+ docxml.xpath(ns("//svgmap//#{tag}")).each do |e|
16
+ svgmap_resolve_eref(e, isodoc, docxml, ids, presxml)
17
+ end
18
+ svgmap_fmt_prefix_remove(docxml)
19
+ Vectory::SvgMapping.new(docxml, "").call
20
+ docxml.xpath(ns("//svgmap")).each { |s| isodoc.svgmap_extract(s) }
21
+ end
22
+
23
+ def svgmap_resolve_prep(docxml, docid, presxml)
14
24
  ids = @files.get(docid, :ids)
15
25
  docxml = svg_unnest(svg_datauri(docxml, docid))
16
26
  isodoc = IsoDoc::PresentationXMLConvert.new({})
17
27
  isodoc.bibitem_lookup(docxml)
18
28
  tag = presxml ? "fmt-eref" : "eref"
19
- docxml.xpath(ns("//svgmap//#{tag}")).each do |e|
20
- svgmap_resolve_eref(e, isodoc, docxml, ids, presxml)
21
- end
22
- docxml.xpath(ns("//svgmap/target")).each do |t| # undo Presentation XML: Vectory takes eref not fmt-eref
29
+ [ids, docxml, isodoc, tag]
30
+ end
31
+
32
+ # undo Presentation XML update: Vectory takes eref not fmt-eref
33
+ def svgmap_fmt_prefix_remove(docxml)
34
+ docxml.xpath(ns("//svgmap/target")).each do |t|
23
35
  n = t.at(ns(".//fmt-link | .//fmt-xref | .//fmt-eref")) or next
24
36
  n.name = n.name.sub(/^fmt-/, "")
25
37
  t.children = n
26
38
  end
27
- Vectory::SvgMapping.new(docxml, "").call
28
- docxml.xpath(ns("//svgmap")).each { |s| isodoc.svgmap_extract(s) }
29
39
  end
30
40
 
31
41
  def svg_unnest(docxml)
@@ -72,7 +72,7 @@ module Metanorma
72
72
  def block?(node)
73
73
  %w(p table formula admonition ol ul dl figure quote sourcecode example
74
74
  pre note pagebreak hr bookmark requirement recommendation permission
75
- svgmap inputform toc passthrough review imagemap).include?(node.name)
75
+ svgmap inputform toc passthrough annotation imagemap).include?(node.name)
76
76
  end
77
77
 
78
78
  def conflate_floatingtitles(nodes)
@@ -151,7 +151,7 @@ module Metanorma
151
151
  def create_sectionfile(xml, out, file, chunks, parentnode)
152
152
  ins = out.at(ns("//metanorma-extension")) || out.at(ns("//bibdata"))
153
153
  sectionfile_insert(ins, chunks, parentnode)
154
- sectionfile_fn_filter(sectionfile_review_filter(out))
154
+ sectionfile_fn_filter(sectionfile_annotation_filter(out))
155
155
  Metanorma::Collection::XrefProcess::xref_process(out, xml, @key,
156
156
  @ident, @isodoc, true)
157
157
  outname = "#{file}.xml"
@@ -211,34 +211,35 @@ module Metanorma
211
211
  fnlabel.children = @isodoc_presxml.fn_body_label(fnbody)
212
212
  end
213
213
 
214
- # map fmt-review-body/@id = fmt-review-{start/end}/@target
215
- # to fmt-review-{stary/end}
216
- def sectionfile_review_filter_prep(xml)
217
- xml.xpath(ns("//fmt-review-start | //fmt-review-end"))
214
+ # map fmt-annotation-body/@id = fmt-annotation-{start/end}/@target
215
+ # to fmt-annotation-{start/end}
216
+ def sectionfile_annotation_filter_prep(xml)
217
+ xml.xpath(ns("//fmt-annotation-start | //fmt-annotation-end"))
218
218
  .each_with_object({}) do |f, m|
219
219
  m[f["target"]] ||= []
220
220
  m[f["target"]] << f
221
221
  end
222
222
  end
223
223
 
224
- def sectionfile_review_filter(xml)
225
- ids = sectionfile_review_filter_prep(xml)
226
- xml.root.xpath(ns("./review-container/fmt-review-body")).each do |f|
224
+ def sectionfile_annotation_filter(xml)
225
+ ids = sectionfile_annotation_filter_prep(xml)
226
+ xml.root.xpath(ns("./annotation-container/fmt-annotation-body"))
227
+ .each do |f|
227
228
  ids.has_key?(f["id"]) or f.remove
228
229
  end
229
- xml.root.xpath(ns("./review-container/fmt-review-body"))
230
+ xml.root.xpath(ns("./annotation-container/fmt-annotation-body"))
230
231
  .each_with_index do |fnbody, i|
231
- sectionfile_review_filter_renumber(fnbody, i, ids)
232
+ sectionfile_annotation_filter_renumber(fnbody, i, ids)
232
233
  end
233
234
  xml
234
235
  end
235
236
 
236
- def sectionfile_review_filter_renumber(fnbody, _idx, ids)
237
+ def sectionfile_annotation_filter_renumber(fnbody, _idx, ids)
237
238
  ids[fnbody["id"]].each do |f|
238
239
  case f.name
239
- when "fmt-review-start"
240
+ when "fmt-annotation-start"
240
241
  f.children = @isodoc_presxml.comment_bookmark_start_label(f)
241
- when "fmt-review-end"
242
+ when "fmt-annotation-end"
242
243
  f.children = @isodoc_presxml.comment_bookmark_end_label(f)
243
244
  end
244
245
  end
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "2.2.2".freeze
2
+ VERSION = "2.2.3".freeze
3
3
  end
data/metanorma.gemspec CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  # spec.add_dependency "metanorma-standoc"
39
39
 
40
40
  spec.add_development_dependency "debug"
41
- spec.add_development_dependency "equivalent-xml", "~> 0.6"
41
+ spec.add_development_dependency "equivalent-xml"
42
42
  spec.add_development_dependency "metanorma-iso"
43
43
  spec.add_development_dependency "mnconvert"
44
44
  spec.add_development_dependency "pry"
@@ -49,5 +49,5 @@ Gem::Specification.new do |spec|
49
49
  spec.add_development_dependency "rubocop-performance"
50
50
  spec.add_development_dependency "sassc-embedded", "~> 1"
51
51
  spec.add_development_dependency "simplecov", "~> 0.15"
52
- spec.add_development_dependency "xml-c14n"
52
+ spec.add_development_dependency "canon"
53
53
  end
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.2.2
4
+ version: 2.2.3
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-07-05 00:00:00.000000000 Z
11
+ date: 2025-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: equivalent-xml
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '0.6'
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '0.6'
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: metanorma-iso
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -291,7 +291,7 @@ dependencies:
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0.15'
293
293
  - !ruby/object:Gem::Dependency
294
- name: xml-c14n
294
+ name: canon
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
297
  - - ">="