metanorma-plugin-datastruct 0.3.0 → 0.3.1
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/.github/workflows/release.yml +4 -3
- data/lib/metanorma/plugin/datastruct/base_structured_text_preprocessor.rb +9 -7
- data/lib/metanorma/plugin/datastruct/version.rb +1 -1
- data/lib/metanorma/plugin/datastruct/yaml2_text_preprocessor.rb +8 -1
- data/metanorma-plugin-datastruct.gemspec +1 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9afcd660bc9aa57c185e892b9654545e5665ca4fd1dfe6766936929e4103788f
|
4
|
+
data.tar.gz: 027c3feec5d5f497a814aa8a6326b15256055cc18c8e148bd823f9d7b5d8a2e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d96b5d3628b6995799de038d408df8c6ae26867fac238166f386c3de63ada247154275e7dd42122a2a8493ca5ef7479ec40581d4bc76aa91e9bcd8c8a7d6fc
|
7
|
+
data.tar.gz: d131b05dcb593a958d1de557a66ea960a6bf412fbe922ab7c19b054efa2fb5e453d162468d0d6cd41817d8f95099c7947e772189688709ea3889e795335db719
|
@@ -7,11 +7,12 @@ on:
|
|
7
7
|
inputs:
|
8
8
|
next_version:
|
9
9
|
description: |
|
10
|
-
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
|
11
|
+
Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
|
11
12
|
required: true
|
12
13
|
default: 'skip'
|
13
|
-
|
14
|
-
|
14
|
+
repository_dispatch:
|
15
|
+
types: [ do-release ]
|
15
16
|
|
16
17
|
jobs:
|
17
18
|
release:
|
@@ -10,14 +10,15 @@ require "liquid/custom_filters/values"
|
|
10
10
|
require "liquid/custom_filters/replace_regex"
|
11
11
|
require "metanorma/plugin/datastruct/source_extractor"
|
12
12
|
|
13
|
-
Liquid::
|
14
|
-
Liquid::
|
13
|
+
Liquid::Environment.default
|
14
|
+
.register_tag("keyiterator", Liquid::CustomBlocks::KeyIterator)
|
15
|
+
Liquid::Environment.default
|
15
16
|
.register_tag("with_yaml_nested_context",
|
16
17
|
Liquid::CustomBlocks::WithYamlNestedContext)
|
17
|
-
Liquid::
|
18
|
+
Liquid::Environment.default
|
18
19
|
.register_tag("with_json_nested_context",
|
19
20
|
Liquid::CustomBlocks::WithJsonNestedContext)
|
20
|
-
Liquid::
|
21
|
+
Liquid::Environment.default.register_filter(Liquid::CustomFilters)
|
21
22
|
|
22
23
|
module Asciidoctor
|
23
24
|
class PreprocessorNoIfdefsReader < PreprocessorReader
|
@@ -136,14 +137,15 @@ module Metanorma
|
|
136
137
|
content_from_file(document, block_match[1])
|
137
138
|
end
|
138
139
|
|
140
|
+
return if context_items.nil?
|
141
|
+
|
139
142
|
parse_context_block(document: document,
|
140
143
|
context_lines: transformed_liquid_lines,
|
141
144
|
context_items: context_items,
|
142
145
|
context_name: block_match[2].strip)
|
143
146
|
rescue StandardError => e
|
144
|
-
|
145
|
-
|
146
|
-
block: #{e.message}")
|
147
|
+
::Metanorma::Util.log("Failed to parse #{config[:block_name]} \
|
148
|
+
block: #{e.message}", :error)
|
147
149
|
[]
|
148
150
|
end
|
149
151
|
|
@@ -39,8 +39,15 @@ module Metanorma
|
|
39
39
|
|
40
40
|
# https://ruby-doc.org/stdlib-2.5.1/libdoc/psych/rdoc/Psych.html#method-c-safe_load
|
41
41
|
def content_from_file(document, file_path)
|
42
|
+
resolved_file_path = relative_file_path(document, file_path)
|
43
|
+
|
44
|
+
unless File.exist?(resolved_file_path)
|
45
|
+
::Metanorma::Util.log("YAML file referenced in [yaml2text] block not found: #{resolved_file_path}", :error)
|
46
|
+
return
|
47
|
+
end
|
48
|
+
|
42
49
|
YAML.safe_load(
|
43
|
-
File.read(
|
50
|
+
File.read(resolved_file_path, encoding: "UTF-8"),
|
44
51
|
permitted_classes: [Date, Time],
|
45
52
|
permitted_symbols: [],
|
46
53
|
aliases: true,
|
@@ -40,5 +40,6 @@ Gem::Specification.new do |spec|
|
|
40
40
|
spec.add_development_dependency "timecop", "~> 0.9"
|
41
41
|
spec.add_development_dependency "vcr", "~> 6.1.0"
|
42
42
|
spec.add_development_dependency "webmock"
|
43
|
+
spec.add_development_dependency "xml-c14n"
|
43
44
|
spec.metadata["rubygems_mfa_required"] = "false"
|
44
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-plugin-datastruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -206,6 +206,20 @@ dependencies:
|
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: xml-c14n
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
209
223
|
description: Metanorma plugin for yaml2text and json2text
|
210
224
|
email:
|
211
225
|
- open.source@ribose.com
|
@@ -243,7 +257,7 @@ licenses:
|
|
243
257
|
- BSD-2-Clause
|
244
258
|
metadata:
|
245
259
|
rubygems_mfa_required: 'false'
|
246
|
-
post_install_message:
|
260
|
+
post_install_message:
|
247
261
|
rdoc_options: []
|
248
262
|
require_paths:
|
249
263
|
- lib
|
@@ -258,8 +272,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
272
|
- !ruby/object:Gem::Version
|
259
273
|
version: '0'
|
260
274
|
requirements: []
|
261
|
-
rubygems_version: 3.
|
262
|
-
signing_key:
|
275
|
+
rubygems_version: 3.5.22
|
276
|
+
signing_key:
|
263
277
|
specification_version: 4
|
264
278
|
summary: Metanorma plugin for yaml2text and json2text
|
265
279
|
test_files: []
|