metanorma-plugin-lutaml 0.7.18 → 0.7.20
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: 8c70ed413914e29f4c181d02bfd50681434437361fe26f10dc1ca94f7e85058e
|
4
|
+
data.tar.gz: addb2f7403c0ffebe85e26cd918440e140d43349c57055be8366b4d35cf794a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5a5b0e871111297d907041d087a24acc58caf7f4c54db1f5213f6be08afdc5d26baceb50a34d9b0d806acd61d9316e72c0b051b7b5da5edfc0aad54ecc995f7
|
7
|
+
data.tar.gz: 61b0e6159c1444ea0faf3f3e693e3e2ef228aca57d2129a98450207dec0158e72459049462483a436ddc68e119624298c78d66ac161c2bc34a736b70ab765a96
|
data/README.adoc
CHANGED
@@ -145,11 +145,7 @@ And the `lutaml_express` block:
|
|
145
145
|
|
146
146
|
[source,adoc]
|
147
147
|
-----
|
148
|
-
<<<<<<< HEAD
|
149
|
-
[lutaml_express,example.exp,my_context]
|
150
|
-
=======
|
151
148
|
[lutaml_express_liquid,example.exp,my_context]
|
152
|
-
>>>>>>> accd8ee (Remove obsolete codes of macros "lutaml" and "lutaml_express")
|
153
149
|
----
|
154
150
|
{% for schema in my_context.schemas %}
|
155
151
|
== {{schema.id}}
|
@@ -102,13 +102,13 @@ module Metanorma
|
|
102
102
|
block
|
103
103
|
end
|
104
104
|
|
105
|
-
def gather_context_liquid_items(
|
106
|
-
|
105
|
+
def gather_context_liquid_items( # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/ParameterLists
|
106
|
+
index_names:, document:, indexes:, options: {}
|
107
|
+
)
|
107
108
|
index_names.map do |path|
|
108
109
|
if indexes[path]
|
109
110
|
indexes[path][:liquid_drop] ||=
|
110
111
|
indexes[path][:wrapper].original_document.to_liquid(
|
111
|
-
selected_schemas: selected_schemas,
|
112
112
|
options: options,
|
113
113
|
)
|
114
114
|
else
|
@@ -123,7 +123,6 @@ selected_schemas:, options:)
|
|
123
123
|
wrapper = load_lutaml_file(document, path)
|
124
124
|
indexes[path] = {
|
125
125
|
liquid_drop: wrapper.original_document.to_liquid(
|
126
|
-
selected_schemas: selected_schemas,
|
127
126
|
options: options,
|
128
127
|
),
|
129
128
|
}
|
@@ -167,21 +166,30 @@ selected_schemas:, options:)
|
|
167
166
|
index_names:, options:, indexes:)
|
168
167
|
config_yaml_path = options.delete("config_yaml")
|
169
168
|
config = read_config_yaml_file(document, config_yaml_path)
|
170
|
-
|
169
|
+
if config["selected_schemas"]
|
170
|
+
options["selected_schemas"] = config["selected_schemas"]
|
171
|
+
end
|
171
172
|
|
172
173
|
all_items = gather_context_liquid_items(
|
173
174
|
index_names: index_names,
|
174
175
|
document: document,
|
175
176
|
indexes: indexes,
|
176
|
-
selected_schemas: selected_schemas,
|
177
177
|
options: options.merge("document" => document),
|
178
178
|
)
|
179
179
|
|
180
|
+
# Allow includes for the template
|
181
|
+
include_paths = [
|
182
|
+
Utils.relative_file_path(document, ""),
|
183
|
+
options["include_path"],
|
184
|
+
].compact
|
185
|
+
|
180
186
|
all_items.map do |item|
|
181
187
|
repo_drop = item[:liquid_drop]
|
182
188
|
template = ::Liquid::Template.parse(lines.join("\n"))
|
189
|
+
template.registers[:file_system] =
|
190
|
+
::Metanorma::Plugin::Lutaml::Liquid::LocalFileSystem
|
191
|
+
.new(include_paths, ["%s.liquid", "_%s.liquid", "_%s.adoc"])
|
183
192
|
template.assigns[context_name] = repo_drop
|
184
|
-
template.assigns["selected_schemas"] = selected_schemas
|
185
193
|
template.render
|
186
194
|
end.flatten
|
187
195
|
rescue StandardError => e
|
@@ -41,7 +41,7 @@ module Metanorma
|
|
41
41
|
|
42
42
|
liquid_template.registers[:file_system] =
|
43
43
|
::Metanorma::Plugin::Lutaml::Liquid::LocalFileSystem
|
44
|
-
.new(include_paths, ["_%s.liquid", "_%s.adoc"])
|
44
|
+
.new(include_paths, ["%s.liquid", "_%s.liquid", "_%s.adoc"])
|
45
45
|
|
46
46
|
rendered_string = liquid_template
|
47
47
|
.render(context_name => context_items,
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_dependency "asciidoctor"
|
29
29
|
spec.add_dependency "coradoc", "~> 1.1.1"
|
30
|
-
spec.add_dependency "expressir", "~> 2.1.
|
30
|
+
spec.add_dependency "expressir", "~> 2.1.11"
|
31
31
|
spec.add_dependency "liquid"
|
32
32
|
spec.add_dependency "lutaml", "~> 0.9.25"
|
33
33
|
spec.add_dependency "ogc-gml", "1.0.0"
|
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.7.
|
4
|
+
version: 0.7.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.1.
|
47
|
+
version: 2.1.11
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.1.
|
54
|
+
version: 2.1.11
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: liquid
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|