isodoc 2.8.5 → 2.9.1
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 +1 -5
- data/lib/isodoc/version.rb +1 -1
- 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: '0149f799d8ea0aa613aa3544453d23ddd0a0451a2b3e3efa047772e16cf2db46'
|
4
|
+
data.tar.gz: 606b9ababc9d0ebb5b7c1b11d225a752440379ae093d09f208f45ec0f9d3f4b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aa94e7ae2178b5ae01b3f55a6f7209439fb6dc82b001531ccc799352e06d711fd63ee589a657e50022cde1b1b27ba8df857ef078ee2f187a41ad77f1abcca65
|
7
|
+
data.tar.gz: 2922340ef73f00c1b5d48e45fd28371da9e10dc55d4e4858ea67db1ed01189c6f4555386ed8e26e8f1951e41504d1ec3da39b9aee1b154b4f99df617185152ea
|
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)
|
@@ -37,7 +37,7 @@ module IsoDoc
|
|
37
37
|
prep_for_rendering(b)
|
38
38
|
m << to_xml(b)
|
39
39
|
end.join
|
40
|
-
bibrenderer.render_all("<references>#{refs}</references>",
|
40
|
+
@xrefs.klass.bibrenderer.render_all("<references>#{refs}</references>",
|
41
41
|
type: citestyle)
|
42
42
|
end
|
43
43
|
|
@@ -68,10 +68,6 @@ module IsoDoc
|
|
68
68
|
xml.children = "#{f}#{x.to_xml}"
|
69
69
|
end
|
70
70
|
|
71
|
-
def bibrenderer
|
72
|
-
::Relaton::Render::IsoDoc::General.new(language: @lang)
|
73
|
-
end
|
74
|
-
|
75
71
|
def citestyle
|
76
72
|
nil
|
77
73
|
end
|
data/lib/isodoc/version.rb
CHANGED
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.1
|
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
|