isodoc 3.7.10 → 3.7.12
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 +4 -4
- data/isodoc.gemspec +2 -8
- data/lib/isodoc/css.rb +20 -0
- data/lib/isodoc/metadata_bibdata.rb +3 -1
- data/lib/isodoc/presentation_function/inline.rb +3 -0
- data/lib/isodoc/presentation_function/xrefs.rb +23 -7
- data/lib/isodoc/version.rb +1 -1
- data/lib/relaton/render-isodoc/styles/isodoc.yml +11 -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: 7ff06e0cc7960c3c125d068e085f3d56973a3591c530fdaa096f70d47a2e574d
|
|
4
|
+
data.tar.gz: e04d4ceda3b6f90fed711df3a4d9c1e47b033282f28e70b550fdecff79a97f66
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14dba4914e496487f29f48349e1086a96fc8a3e92c7a28f9d4e83e1f174761cc7dac42611d605eb1feac25b18ebde9d0e28996d5c4ec3fbadd21729cfebf9ba9
|
|
7
|
+
data.tar.gz: f9b1da627369b9febc2730287a5227cbdccc28fed3e7ed72d132986a743eb49700d853a038ded173ec5470b000e036e5ecb26a6dd41ae92bc1de864a83339709
|
data/isodoc.gemspec
CHANGED
|
@@ -31,20 +31,14 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
spec.add_dependency "base64", ">= 0.1.0"
|
|
32
32
|
spec.add_dependency "bigdecimal"
|
|
33
33
|
spec.add_dependency "html2doc", "~> 1.12"
|
|
34
|
-
# spec.add_dependency "isodoc-i18n", "~> 1.5" # already in
|
|
35
|
-
spec.add_dependency "relaton", "~> 3.
|
|
34
|
+
# spec.add_dependency "isodoc-i18n", "~> 1.5" # already in mn-requirements
|
|
35
|
+
spec.add_dependency "relaton", "~> 3.1.1"
|
|
36
36
|
# std_docid_semantic parses through the pubid monogem's flavor
|
|
37
37
|
# registry (Pubid.eager_load_flavors!) — 2.x API, no per-flavor gems
|
|
38
38
|
spec.add_dependency "pubid", "~> 2.0.3"
|
|
39
39
|
# spec.add_dependency "metanorma-utils", "~> 2.0" # already in isodoc-i18n
|
|
40
40
|
spec.add_dependency "mn2pdf", ">= 2.13"
|
|
41
41
|
spec.add_dependency "mn-requirements", "~> 0.5.0"
|
|
42
|
-
# Allowance for the relaton 3.0 family (mirrors the relaton-cli
|
|
43
|
-
# allowance in #824): relaton-render 3.0.0 joins the family's
|
|
44
|
-
# versioning and restores the 1.x leaves as deprecated shims, so
|
|
45
|
-
# flavor stacks boot against it.
|
|
46
|
-
# Released isodoc lines keep resolving relaton-render 1.3.0; only a
|
|
47
|
-
# stack on this floor co-resolves the relaton 3.0 line.
|
|
48
42
|
spec.add_dependency "roman-numerals"
|
|
49
43
|
spec.add_dependency "rouge", "~> 4.0"
|
|
50
44
|
# lib/isodoc/css.rb requires sassc-embedded (SassC::Engine) at
|
data/lib/isodoc/css.rb
CHANGED
|
@@ -100,10 +100,30 @@ module IsoDoc
|
|
|
100
100
|
File.dirname(filename)]
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
+
def sassc_available?
|
|
104
|
+
require "sassc-embedded"
|
|
105
|
+
true
|
|
106
|
+
rescue LoadError
|
|
107
|
+
false
|
|
108
|
+
end
|
|
109
|
+
|
|
103
110
|
# stripwordcss if HTML stylesheet, !stripwordcss if DOC stylesheet
|
|
104
111
|
def generate_css(filename, stripwordcss)
|
|
105
112
|
filename.nil? and return nil
|
|
106
113
|
filename = precompiled_style_or_original(filename)
|
|
114
|
+
# The release's precompiled .css twins bake in the DEFAULT font
|
|
115
|
+
# variables, so a flavor overriding default_fonts would be silently
|
|
116
|
+
# dropped when its stylesheet is consumed as precompiled
|
|
117
|
+
# (metanorma-un, metanorma-m3aawg font regressions). When the scss
|
|
118
|
+
# source is present and the consumer bundle carries the optional
|
|
119
|
+
# sassc-embedded toolchain, compile at runtime so the flavor's
|
|
120
|
+
# fonts template in; plain installs without the toolchain keep the
|
|
121
|
+
# precompiled fallback.
|
|
122
|
+
scss = filename.sub(/\.css\z/, ".scss")
|
|
123
|
+
if File.extname(filename) == ".css" && File.file?(scss) &&
|
|
124
|
+
sassc_available?
|
|
125
|
+
filename = scss
|
|
126
|
+
end
|
|
107
127
|
stylesheet = File.read(filename, encoding: "UTF-8")
|
|
108
128
|
stylesheet = preprocess_css(stylesheet, stripwordcss)
|
|
109
129
|
File.extname(filename) == ".scss" and
|
|
@@ -19,6 +19,9 @@ module IsoDoc
|
|
|
19
19
|
link, node)
|
|
20
20
|
non_locality_elems(node).each(&:remove)
|
|
21
21
|
node.add_child(cleanup_entities(link))
|
|
22
|
+
# citation capsules embed bibitem reference markup, links included;
|
|
23
|
+
# links inserted after fmt_ref ran need the fmt treatment explicitly
|
|
24
|
+
fmt_ref_links(node)
|
|
22
25
|
unnest_linkend(node)
|
|
23
26
|
end
|
|
24
27
|
# so not <origin bibitemid="ISO7301" citeas="ISO 7301">
|
|
@@ -3,13 +3,29 @@ module IsoDoc
|
|
|
3
3
|
def fmt_ref(docxml)
|
|
4
4
|
docxml.xpath(ns("//xref | //eref | //origin | //link")).each do |x|
|
|
5
5
|
sem_xml_descendant?(x) and next
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
fmt_ref_elem(x)
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def fmt_ref_elem(x)
|
|
11
|
+
tag = x.name
|
|
12
|
+
y = Nokogiri::XML::Node.new("fmt-#{tag}", x.document)
|
|
13
|
+
x.attributes.keys.reject { |a| a == "id" }.each { |a| y[a] = x[a] }
|
|
14
|
+
n = semx_fmt_dup(x) # semx/fmt-xref for ease of processing
|
|
15
|
+
n.children.each { |c| y << c }
|
|
16
|
+
n << y
|
|
17
|
+
x.next = n
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Links arriving in markup that is inserted after fmt_ref has run —
|
|
21
|
+
# the styled eref citation capsules, which embed the reference
|
|
22
|
+
# rendering of a bibitem (including its availability link) — get the
|
|
23
|
+
# same semx/fmt-link treatment as document links, or the HTML and DOC
|
|
24
|
+
# renderers drop them along with the source element
|
|
25
|
+
def fmt_ref_links(node)
|
|
26
|
+
node.xpath(ns(".//link")).each do |x|
|
|
27
|
+
sem_xml_descendant?(x) and next
|
|
28
|
+
fmt_ref_elem(x)
|
|
13
29
|
end
|
|
14
30
|
end
|
|
15
31
|
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -5,12 +5,22 @@
|
|
|
5
5
|
# (b) no authoritative identifier in the reference composition: the
|
|
6
6
|
# identifier renders as the biblio-tag ahead of the formattedref
|
|
7
7
|
# ("ISO 712, _Cereals_ ..."), never duplicated inside it. Patents
|
|
8
|
-
# keep theirs: the patent number is the citation itself.
|
|
8
|
+
# keep theirs: the patent number is the citation itself. And (c) the
|
|
9
|
+
# availability (location) slot renders as the unresolved entries do:
|
|
10
|
+
# "Available at: <link>...</link>" — the PresentationXML link is what
|
|
11
|
+
# the HTML and DOC renderers turn into the citation's anchor. Without
|
|
12
|
+
# the uri template the resolved bibitem's <uri> renders as bare text,
|
|
13
|
+
# and the reader loses the link exactly when the reference is
|
|
14
|
+
# authoritative enough to be machine-resolved (isodoc#882).
|
|
9
15
|
name: "IsoDoc (ISO 690, presentation markup)"
|
|
10
16
|
extends: author-date
|
|
17
|
+
scheme:
|
|
18
|
+
locale:
|
|
19
|
+
availableAt: "Available at:"
|
|
11
20
|
templates:
|
|
12
21
|
titleOpen: "<em>"
|
|
13
22
|
titleClose: "</em>"
|
|
23
|
+
uri: '<link target="{{uri}}">{{uri}}</link>'
|
|
14
24
|
reference: "{{creator}}. {{title}}. {{medium}}. {{edition}}. {{series}}. {{production}}, {{date}}. {{location}}."
|
|
15
25
|
perType:
|
|
16
26
|
- type: monograph
|
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: 3.7.
|
|
4
|
+
version: 3.7.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -58,14 +58,14 @@ dependencies:
|
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: 3.1.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:
|
|
68
|
+
version: 3.1.1
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: pubid
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|