metanorma-plugin-lutaml 0.6.6 → 0.7.0
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: 872f356949600a805424dca371f510e64df8495c469db35a8387e8fea93642a7
|
4
|
+
data.tar.gz: 66fb4cd019c50eea2bd0f26683d26c4310ec61a40335fc2fb3cdca2c1820cd9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86230814ec38bb9bb8474251ea517929707002a519df98f5458996bb85dbfa5d4eab18952b8ec67128a86a60ff2d21176e377509cc8c59443ffb189066bdd41
|
7
|
+
data.tar.gz: b0ccabcd347141298cd54989b702e7963e9b0383875db05439af27e43a61bfbbaaa23587b9ad3a8f076781c4a573bbe545f5052c1bab0af7ae94c8960353780f
|
@@ -18,7 +18,9 @@
|
|
18
18
|
{% endif %}
|
19
19
|
|
20
20
|
{% capture equalsigns %}{% for count in (1..depth) %}={% endfor %}{% endcapture %}{{equalsigns}} {{ package.name }} package
|
21
|
+
{% if klass.xmi_id %}
|
21
22
|
[[section-{{ package.xmi_id }}]]
|
23
|
+
{% endif %}
|
22
24
|
{{equalsigns}}= {{ package.name }} overview
|
23
25
|
|
24
26
|
{% if additional_context.all_macros.size > 0 %}
|
@@ -5,6 +5,7 @@ require "asciidoctor"
|
|
5
5
|
require "asciidoctor/reader"
|
6
6
|
require "lutaml"
|
7
7
|
require "lutaml/uml"
|
8
|
+
require "lutaml/xmi"
|
8
9
|
require "metanorma/plugin/lutaml/utils"
|
9
10
|
require "metanorma/plugin/lutaml/asciidoctor/preprocessor"
|
10
11
|
|
@@ -44,16 +45,21 @@ module Metanorma
|
|
44
45
|
|
45
46
|
private
|
46
47
|
|
47
|
-
def lutaml_document_from_file_or_cache(document, file_path)
|
48
|
+
def lutaml_document_from_file_or_cache(document, file_path, yaml_config)
|
48
49
|
full_path = Utils.relative_file_path(document, file_path)
|
49
50
|
if document.attributes["lutaml_xmi_cache"] &&
|
50
51
|
document.attributes["lutaml_xmi_cache"][full_path]
|
51
52
|
return document.attributes["lutaml_xmi_cache"][full_path]
|
52
53
|
end
|
53
54
|
|
55
|
+
if yaml_config["ea_extension"] && !yaml_config["ea_extension"].empty?
|
56
|
+
ea_extension_path = yaml_config["ea_extension"].first
|
57
|
+
ea_extension_full_path = Utils.relative_file_path(document, ea_extension_path)
|
58
|
+
Xmi::EaRoot.load_mdg_extension(ea_extension_full_path)
|
59
|
+
end
|
60
|
+
|
54
61
|
result_document = ::Lutaml::Parser
|
55
62
|
.parse(File.new(full_path, encoding: "UTF-8")).first
|
56
|
-
result_document
|
57
63
|
document.attributes["lutaml_xmi_cache"] ||= {}
|
58
64
|
document.attributes["lutaml_xmi_cache"][full_path] = result_document
|
59
65
|
result_document
|
@@ -79,13 +85,15 @@ module Metanorma
|
|
79
85
|
block_match = line.match(MACRO_REGEXP)
|
80
86
|
return [line] if block_match.nil?
|
81
87
|
|
88
|
+
yaml_config = parse_yaml_config_file(document, block_match[2])
|
82
89
|
lutaml_document = lutaml_document_from_file_or_cache(document,
|
83
|
-
block_match[1]
|
90
|
+
block_match[1],
|
91
|
+
yaml_config)
|
84
92
|
fill_in_diagrams_attributes(document, lutaml_document)
|
85
93
|
model_representation(
|
86
94
|
lutaml_document, document,
|
87
95
|
collect_additional_context(document, input_lines, input_lines.next),
|
88
|
-
|
96
|
+
yaml_config
|
89
97
|
)
|
90
98
|
end
|
91
99
|
|
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.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|