metanorma-plugin-lutaml 0.2.4.pre.alpha.1 → 0.2.4.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d72d3bfa8e8dd1e0a8321f97d9f32b46652e7961036d623d293ed07a0a19c6b1
|
4
|
+
data.tar.gz: 18a4eec7fba09c7f1466ae46fdf33d07e70855a9f00b1e4490252c22a7529ed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5440d8e90b6184ab41d1969e6520d3745013aa987314b9f50a524066d810497f0be86481bdcd6195bfe2982e1c8de4562226f373746e18bbd4f173796d043f5d
|
7
|
+
data.tar.gz: ee100c14d0bf8a945732da8ed86f8816ca67ce02dbe7fea80f14a04ac74fcd4efda65cedff89e5262725f044b3a69de85461d6fb5c724392cf01642b6afdf317
|
@@ -45,7 +45,11 @@ module Metanorma
|
|
45
45
|
def prefix_relative_paths(line, path_prefix)
|
46
46
|
line.gsub(RELATIVE_PREFIX_MACRO_REGEXP) do |_match|
|
47
47
|
prefixed_path = File.join(path_prefix, $3.strip)
|
48
|
-
|
48
|
+
# When we are dealing with arelative path of a template: ../path/to/file we need to transform it into
|
49
|
+
# the absolute one because `image::` macro wont understand it other way
|
50
|
+
prefixed_path = File.absolute_path(prefixed_path) if prefixed_path.start_with?('../')
|
51
|
+
full_path = File.expand_path(prefixed_path)
|
52
|
+
"#{$1}#{$2}#{full_path}#{$4}"
|
49
53
|
end
|
50
54
|
end
|
51
55
|
|
@@ -76,19 +76,21 @@ module Metanorma
|
|
76
76
|
if express_indexes[path]
|
77
77
|
res.push(*express_indexes[path])
|
78
78
|
else
|
79
|
-
res.push(content_from_file(document, path)
|
79
|
+
res.push(content_from_file(document, path)
|
80
|
+
.to_liquid
|
81
|
+
.merge('relative_path_prefix' => Utils.relative_file_path(document, File.dirname(path))))
|
80
82
|
end
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
84
86
|
def parse_template(document, current_block, block_match, express_indexes)
|
85
87
|
options = parse_options(block_match[3])
|
86
|
-
.merge("relative_path_prefix" => File.dirname(block_match[1]))
|
87
88
|
contexts_items(block_match, document, express_indexes)
|
88
89
|
.map do |context_items|
|
89
90
|
parse_context_block(document: document,
|
90
91
|
context_lines: current_block,
|
91
|
-
context_items: decorate_context_items(context_items,
|
92
|
+
context_items: decorate_context_items(context_items,
|
93
|
+
options.merge('relative_path_prefix' => context_items['relative_path_prefix'])),
|
92
94
|
context_name: block_match[2].strip)
|
93
95
|
end.flatten
|
94
96
|
rescue StandardError => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-plugin-lutaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.4.pre.alpha.
|
4
|
+
version: 0.2.4.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|