metanorma 1.2.6pre → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/collection_fileprocess.rb +22 -0
- data/lib/metanorma/version.rb +1 -1
- data/metanorma.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4552898da027404dc0a7556a0c3b97d8c55c014c8ef397dff1d421f495a748d
|
4
|
+
data.tar.gz: a9a7f45f7e35f5a06bdc05c367a8ff3f25369251f5de1993fdbd166604a9349e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9be3cea69411bf8f1b48dde44a432353f9b93741ff13ce388312386817e6a8a90a2290dafa222013b7397838cd948b40228882e329bb2d89270924c1b0a08469
|
7
|
+
data.tar.gz: 1eff396a38c708948620c489664f8d9713ac0b76e7df72d1631e60e31f1bda0d2aea93ac7015a6a6f7863b9ed466eac731db6ec90fd42ca831d6ffead3f0ecfc
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "isodoc"
|
4
|
+
require "metanorma-utils"
|
4
5
|
|
5
6
|
module Metanorma
|
6
7
|
# XML collection renderer
|
@@ -131,12 +132,33 @@ module Metanorma
|
|
131
132
|
update_indirect_refs_to_docs(docxml, internal_refs)
|
132
133
|
add_document_suffix(identifier, docxml)
|
133
134
|
update_direct_refs_to_docs(docxml, identifier)
|
135
|
+
svgmap_resolve(datauri_encode(docxml))
|
134
136
|
docxml.xpath(ns("//references[not(./bibitem[not(@hidden) or @hidden = 'false'])]")).each do |f|
|
135
137
|
f["hidden"] = "true"
|
136
138
|
end
|
137
139
|
docxml.to_xml
|
138
140
|
end
|
139
141
|
|
142
|
+
def datauri_encode(docxml)
|
143
|
+
docxml.xpath(ns("//image")).each { |i| i["src"] = Metanorma::Utils::datauri(i["src"]) }
|
144
|
+
docxml
|
145
|
+
end
|
146
|
+
|
147
|
+
def svgmap_resolve(docxml)
|
148
|
+
isodoc = IsoDoc::Convert.new({})
|
149
|
+
docxml.xpath(ns("//svgmap//eref")).each do |e|
|
150
|
+
href = isodoc.eref_target(e)
|
151
|
+
next if href == "#" + e["bibitemid"]
|
152
|
+
if href.match(/^#/)
|
153
|
+
next unless docxml.at("//*[@id = '#{href.sub(/^#/, '')}']")
|
154
|
+
end
|
155
|
+
e["target"] = href.strip
|
156
|
+
e.name = "link"
|
157
|
+
e&.elements&.remove
|
158
|
+
end
|
159
|
+
Metanorma::Utils::svgmap_rewrite(docxml, "")
|
160
|
+
end
|
161
|
+
|
140
162
|
# repo(current-metanorma-collection/ISO 17301-1:2016)
|
141
163
|
# replaced by bibdata of "ISO 17301-1:2016" in situ as bibitem.
|
142
164
|
# Any erefs to that bibitem id are replaced with relative URL
|
data/lib/metanorma/version.rb
CHANGED
data/metanorma.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_runtime_dependency 'htmlentities'
|
28
28
|
spec.add_runtime_dependency 'nokogiri'
|
29
29
|
spec.add_runtime_dependency 'mn2pdf', "~> 1"
|
30
|
-
spec.add_runtime_dependency 'metanorma-utils', "~> 1"
|
30
|
+
spec.add_runtime_dependency 'metanorma-utils', "~> 1.0.3"
|
31
31
|
spec.add_runtime_dependency 'pry'
|
32
32
|
spec.add_runtime_dependency 'fontist', '~> 1.8'
|
33
33
|
|
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.2.
|
4
|
+
version: 1.2.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: 2021-
|
11
|
+
date: 2021-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.0.3
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.0.3
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -272,11 +272,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
272
272
|
version: 2.4.0
|
273
273
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
274
274
|
requirements:
|
275
|
-
- - "
|
275
|
+
- - ">="
|
276
276
|
- !ruby/object:Gem::Version
|
277
|
-
version:
|
277
|
+
version: '0'
|
278
278
|
requirements: []
|
279
|
-
rubygems_version: 3.
|
279
|
+
rubygems_version: 3.1.4
|
280
280
|
signing_key:
|
281
281
|
specification_version: 4
|
282
282
|
summary: Metanorma is the standard of standards; the metanorma gem allows you to create
|