metanorma-plugin-lutaml 0.7.56 → 0.7.57
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: eb9c176145db89f41f691658a755ce2f94cd8a1f1f302dd328deb4ec0286c5b0
|
|
4
|
+
data.tar.gz: '0309da4d8a37de8b907e77b7ab46b27f7e6d67269a1dc9ce37fb2150b9f887d6'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4884c1d32422983d9c5ab5388c63c7a0937526a561a6b4ba5c1043f0250d389efeee2d475d750c3f1f90983caae66aa3b156beeb4551dc093ea1e63a44e95b4
|
|
7
|
+
data.tar.gz: cc10688b5530b8068fa25176e84dceb950e29a355781be749e9a6f6709b5331f64391466db046cd58013f30911ec0ac68d7cd25ee938a51e5e6c04d0b89c4ab1
|
|
@@ -17,6 +17,12 @@ module Metanorma
|
|
|
17
17
|
)
|
|
18
18
|
resolved = document.path_resolver
|
|
19
19
|
.system_path(file_path, docfile_directory)
|
|
20
|
+
# The decorator expands emitted paths against this base: relative
|
|
21
|
+
# prefixes alone get re-anchored by asciidoctor's imagesdir
|
|
22
|
+
# handling (images/../../schemas collapses a level), so the
|
|
23
|
+
# decoration must produce paths that resolve from the docfile.
|
|
24
|
+
options["relative_path_base"] =
|
|
25
|
+
File.expand_path(docfile_directory)
|
|
20
26
|
# The prefix lands inside emitted image macros, so it must not
|
|
21
27
|
# carry the absolute build path: two builds of the same tree in
|
|
22
28
|
# two directories produced different image/@src values
|
|
@@ -60,13 +60,26 @@ module Metanorma
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def prefix_relative_paths(line, path_prefix)
|
|
63
|
+
# Decorated remarks live on models shared across documents and
|
|
64
|
+
# preprocess passes: a second pass over an already-decorated line
|
|
65
|
+
# would stack the prefix again (paths like
|
|
66
|
+
# ../schemas/schemas/schemas/... rendered unusable). Idempotent:
|
|
67
|
+
# a line that carries this prefix is left alone.
|
|
68
|
+
return line if path_prefix && line.include?(path_prefix)
|
|
69
|
+
|
|
63
70
|
line.gsub(RELATIVE_PREFIX_MACRO_REGEXP) do |_match|
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
# paths under whatever directory the
|
|
67
|
-
# (e.g. <repo>/../../schemas/...)
|
|
68
|
-
#
|
|
69
|
-
|
|
71
|
+
# Expand against the docfile directory (passed by the adapter
|
|
72
|
+
# as relative_path_base), NOT the process CWD: a CWD expansion
|
|
73
|
+
# produced absolute image paths under whatever directory the
|
|
74
|
+
# build was launched from (e.g. <repo>/../../schemas/...).
|
|
75
|
+
# The absolute result is deliberate: relative targets are
|
|
76
|
+
# re-anchored by asciidoctor's imagesdir handling
|
|
77
|
+
# (images/../../schemas collapses a level), which made every
|
|
78
|
+
# decorated diagram unresolvable at render time.
|
|
79
|
+
full_path = File.expand_path(
|
|
80
|
+
File.join(path_prefix, $3.strip),
|
|
81
|
+
options["relative_path_base"] || Dir.pwd,
|
|
82
|
+
)
|
|
70
83
|
"#{$1}#{$2}#{full_path}#{$4}"
|
|
71
84
|
end
|
|
72
85
|
end
|