metanorma-plugin-lutaml 0.7.94 → 0.7.95
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 047d924a81b12df0b93fbabd83cd66a0bdad887571c5c6570603a7c59e315248
|
|
4
|
+
data.tar.gz: 367d8e79547a181bec7c8f7bd1680b718f641656cedef81f636054dc370d5b21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cbfbc7dfd8f988284a67fa4a980fdf415d204c56366a60aa3b62c7275fe2d94fede5730729b6e776f54b30bffb6ca3c0eb0af9eee97daf01563a74a404301931
|
|
7
|
+
data.tar.gz: f3534dd05b844c6bd8442a73f2972e067ea784cb441f0d965751a25246e52bf604c72d0164a56efb6248d5b27020aa4bdeb4125a37de6ecded95f399f143500e
|
|
@@ -45,12 +45,15 @@ module Metanorma
|
|
|
45
45
|
# still surface loudly.
|
|
46
46
|
module ExpressRemarkFigures
|
|
47
47
|
# A bare relative image macro: `image::name.svg[]`. Absolute
|
|
48
|
-
# paths, URLs, data URIs
|
|
49
|
-
# an attribute list stay as written.
|
|
48
|
+
# paths, URLs, data URIs and liquid references stay as written.
|
|
50
49
|
# An optional attribute list is allowed: the WG12 remark figures
|
|
51
50
|
# carry captions (`image::images/x.svg[EXPRESS-G diagram]`), and
|
|
52
|
-
# the empty-list-only form skipped them silently (#371).
|
|
53
|
-
|
|
51
|
+
# the empty-list-only form skipped them silently (#371). The
|
|
52
|
+
# trailing-glued list-continuation form (`image::name.svg[]+`,
|
|
53
|
+
# iso-10303#862) matches too — its figure stages like any other
|
|
54
|
+
# and the line re-emits with the `+` on its own line, the form
|
|
55
|
+
# asciidoctor parses as an image block joining the next line.
|
|
56
|
+
IMAGE_MACRO_REGEXP = /\Aimage::([^:\s{}]+)\[[^\]]*\]\+?\s*\z/
|
|
54
57
|
|
|
55
58
|
# An imagesdir attribute entry; the bang form unsets. The LAST
|
|
56
59
|
# entry in the source is the one in force where the member
|
|
@@ -135,10 +138,27 @@ module Metanorma
|
|
|
135
138
|
# joined the way expressir's remark formatter joins them --
|
|
136
139
|
# while the model-level methods keep the source listing
|
|
137
140
|
# printing the macros as written.
|
|
141
|
+
#
|
|
142
|
+
# The continuation forms normalize here too (iso-10303#862):
|
|
143
|
+
# WG 12 remark sources glue the asciidoctor list-continuation
|
|
144
|
+
# onto the macro line (`image::x.gif[]+`, joining the following
|
|
145
|
+
# prose) and precede macros with a bare `+` (attaching the
|
|
146
|
+
# figure to the item). Both are valid constructs when they
|
|
147
|
+
# reach asciidoctor intact, but the glued form parses as
|
|
148
|
+
# paragraph text and the blank-line separation below cuts a
|
|
149
|
+
# directly-preceding `+` off its figure - the four
|
|
150
|
+
# kinematic_structure_schema figure constructs printed as
|
|
151
|
+
# literal macro text. The glued `+` moves to its own line
|
|
152
|
+
# (image block, then the continuation joining the next line),
|
|
153
|
+
# and a `+` kept directly before its figure stays attached.
|
|
138
154
|
def to_s
|
|
139
155
|
remarks.join("\n")
|
|
140
156
|
.gsub(/^[ \t]+(?=image::)/, "")
|
|
157
|
+
.gsub(/^image::([^:\s{}]+\[[^\]]*\])\+/) do
|
|
158
|
+
"#{Regexp.last_match(1)}\n+"
|
|
159
|
+
end
|
|
141
160
|
.gsub(/^(?!$)(image::)/) { "\n\n#{Regexp.last_match(1)}" }
|
|
161
|
+
.gsub(/\+\n\n+(?=image::)/, "+\n")
|
|
142
162
|
end
|
|
143
163
|
end
|
|
144
164
|
|
|
@@ -199,7 +219,20 @@ module Metanorma
|
|
|
199
219
|
return @errors[before..].join("\n")
|
|
200
220
|
end
|
|
201
221
|
|
|
202
|
-
|
|
222
|
+
emit_rewrite(line, match[1], final)
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# The rewritten line: a glued continuation re-emits with the
|
|
226
|
+
# `+` on its own line (the construct renders as an image
|
|
227
|
+
# joining the next line instead of literal paragraph text,
|
|
228
|
+
# #862); a line whose figure already stands staged keeps as
|
|
229
|
+
# written; anything else rewrites the target to the staged
|
|
230
|
+
# form.
|
|
231
|
+
def emit_rewrite(line, target, final)
|
|
232
|
+
return "#{line[/\Aimage::/]}#{final}[]\n+\n" if
|
|
233
|
+
line.match?(/\]\+\s*\z/)
|
|
234
|
+
|
|
235
|
+
return line if final == target
|
|
203
236
|
|
|
204
237
|
trailing = line.length - line.rstrip.length
|
|
205
238
|
suffix = trailing.positive? ? line[-trailing, trailing] : ""
|
|
@@ -38,8 +38,10 @@ Gem::Specification.new do |spec|
|
|
|
38
38
|
# >= 0.6.157: first release with the Qea::Rules layer and the shipped
|
|
39
39
|
# ea/qea/rules/generalization.rb (0.6.149-0.6.156 are broken for the
|
|
40
40
|
# diagram/Liquid-drops path — lutaml/ea#234, #246). Ea::Xmi.load/load_graph
|
|
41
|
-
# (lutaml/ea#86): the partial-load API this gem calls.
|
|
42
|
-
|
|
41
|
+
# (lutaml/ea#86): the partial-load API this gem calls. >= 0.6.167: the
|
|
42
|
+
# .qea klass-table routing resolves Ea::Qea::LazyDrops.parsed_graph
|
|
43
|
+
# (lutaml/ea#278; 0.6.166 lacks it).
|
|
44
|
+
spec.add_dependency "ea", "~> 0.6.167"
|
|
43
45
|
spec.add_dependency "expressir", "~> 2.5.0"
|
|
44
46
|
spec.add_dependency "isodoc", ">= 3.5.0"
|
|
45
47
|
spec.add_dependency "liquid", "~> 5"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-plugin-lutaml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.95
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -72,14 +72,14 @@ dependencies:
|
|
|
72
72
|
requirements:
|
|
73
73
|
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 0.6.
|
|
75
|
+
version: 0.6.167
|
|
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: 0.6.
|
|
82
|
+
version: 0.6.167
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: expressir
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|