isodoc 2.8.4 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +1 -1
- data/lib/isodoc/convert.rb +5 -0
- data/lib/isodoc/function/references.rb +14 -4
- data/lib/isodoc/presentation_function/refs.rb +0 -4
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/postprocess.rb +1 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2ba62816edc84d73b7df065ac30ea42ac43a02bfa1bba0cc345f06f9c1044f2
|
4
|
+
data.tar.gz: 5bb7cb021f6619b23888d2b7c8bb7f9b6aae42c3469884b05059256876675d23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62a3f5375280faeabd71fc2abdc4f4335dd8f89ab7a5c7162a18ba6c19fb1d8d94136523032e6d04cf3abadb51c73bec23e2d93bb96461642834f989a8bfb285
|
7
|
+
data.tar.gz: 233e3f7252e9e3c4d946bfc3921b89a7d776786177cd37c823b8451c2cd3fd190893eb7da290bbc10fab8e4b9f84083530ab3a1c53c8bf3a518e14000bfc9f7a
|
data/isodoc.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "mn2pdf"
|
36
36
|
spec.add_dependency "mn-requirements", "~> 0.3.4"
|
37
37
|
|
38
|
-
spec.add_dependency "relaton-render", "~> 0.7.
|
38
|
+
spec.add_dependency "relaton-render", "~> 0.7.1"
|
39
39
|
spec.add_dependency "roman-numerals"
|
40
40
|
spec.add_dependency "rouge", "~> 4.0"
|
41
41
|
spec.add_dependency "thread_safe"
|
data/lib/isodoc/convert.rb
CHANGED
@@ -84,6 +84,11 @@ module IsoDoc
|
|
84
84
|
Metanorma::Requirements
|
85
85
|
end
|
86
86
|
|
87
|
+
def bibrenderer(options = {})
|
88
|
+
::Relaton::Render::IsoDoc::General.new(options.merge(language: @lang,
|
89
|
+
i18nhash: @i18n.get))
|
90
|
+
end
|
91
|
+
|
87
92
|
def convert1(docxml, filename, dir)
|
88
93
|
@xrefs.parse docxml
|
89
94
|
noko do |xml|
|
@@ -29,15 +29,23 @@ module IsoDoc
|
|
29
29
|
SKIP_DOCID = <<~XPATH.strip.freeze
|
30
30
|
@type = 'DOI' or @type = 'doi' or @type = 'ISSN' or @type = 'issn' or @type = 'ISBN' or @type = 'isbn' or starts-with(@type, 'ISSN.') or starts-with(@type, 'ISBN.') or starts-with(@type, 'issn.') or starts-with(@type, 'isbn.')
|
31
31
|
XPATH
|
32
|
-
|
32
|
+
=begin
|
33
33
|
SKIP_DOC1 = <<~XPATH.strip.freeze
|
34
34
|
#{SKIP_DOCID} or @type = 'metanorma-ordinal' or @type = 'metanorma'
|
35
35
|
XPATH
|
36
36
|
|
37
37
|
PRIMARY_ID = "docidentifier[@primary = 'true']".freeze
|
38
|
-
|
38
|
+
=end
|
39
39
|
def pref_ref_code(bib)
|
40
40
|
bib["suppress_identifier"] == "true" and return nil
|
41
|
+
@bibrenderer ||= bibrenderer
|
42
|
+
data, = @bibrenderer.parse(bib)
|
43
|
+
ret = data[:authoritative_identifier]
|
44
|
+
ret.empty? and return nil
|
45
|
+
ret
|
46
|
+
end
|
47
|
+
=begin
|
48
|
+
def pref_ref_code1(bib)
|
41
49
|
lang = "[@language = '#{@lang}']"
|
42
50
|
ret = bib.xpath(ns("./#{PRIMARY_ID}[not(#{SKIP_DOCID})]#{lang}"))
|
43
51
|
ret.empty? and
|
@@ -47,7 +55,7 @@ module IsoDoc
|
|
47
55
|
bib.at(ns("./docidentifier[not(#{SKIP_DOC1})]"))
|
48
56
|
ret
|
49
57
|
end
|
50
|
-
|
58
|
+
=end
|
51
59
|
# returns [metanorma, non-metanorma, DOI/ISSN/ISBN] identifiers
|
52
60
|
def bibitem_ref_code(bib)
|
53
61
|
id = bib.at(ns("./docidentifier[@type = 'metanorma']"))
|
@@ -72,7 +80,9 @@ module IsoDoc
|
|
72
80
|
end
|
73
81
|
|
74
82
|
def unbracket1(ident)
|
75
|
-
ident
|
83
|
+
ident.nil? and return nil
|
84
|
+
ident.is_a?(String) or ident = ident.text
|
85
|
+
ident.sub(/^\[/, "").sub(/\]$/, "")
|
76
86
|
end
|
77
87
|
|
78
88
|
def unbracket(ident)
|
data/lib/isodoc/version.rb
CHANGED
@@ -36,8 +36,7 @@ module IsoDoc
|
|
36
36
|
def word_admonition_images(docxml)
|
37
37
|
docxml.xpath("//div[@class = 'Admonition']//img").each do |i|
|
38
38
|
i["width"], i["height"] =
|
39
|
-
|
40
|
-
300)
|
39
|
+
Vectory.image_resize(i, image_localfile(i), @maxheight, 300)
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
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.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html2doc
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.7.
|
61
|
+
version: 0.7.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.7.
|
68
|
+
version: 0.7.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: roman-numerals
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|