metanorma-plugin-lutaml 0.7.6 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/metanorma/plugin/lutaml/liquid/custom_filters.rb +2 -2
- data/lib/metanorma/plugin/lutaml/liquid_drops/klass_table_attribute_drop.rb +67 -0
- data/lib/metanorma/plugin/lutaml/liquid_drops/klass_table_content_drop.rb +23 -0
- data/lib/metanorma/plugin/lutaml/liquid_drops/klass_table_drop.rb +45 -0
- data/lib/metanorma/plugin/lutaml/liquid_drops/klass_table_general_drop.rb +33 -0
- data/lib/metanorma/plugin/lutaml/liquid_templates/_klass_assoc_row.liquid +11 -0
- data/lib/metanorma/plugin/lutaml/liquid_templates/_klass_row.liquid +11 -0
- data/lib/metanorma/plugin/lutaml/liquid_templates/_klass_table.liquid +23 -0
- data/lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb +3 -1
- data/lib/metanorma/plugin/lutaml/lutaml_klass_table_block_macro.rb +201 -0
- data/lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb +5 -2
- data/lib/metanorma/plugin/lutaml/lutaml_uml_datamodel_description_preprocessor.rb +5 -5
- data/lib/metanorma/plugin/lutaml/utils.rb +10 -4
- data/lib/metanorma/plugin/lutaml/version.rb +1 -1
- data/lib/metanorma-plugin-lutaml.rb +1 -0
- data/metanorma-plugin-lutaml.gemspec +1 -1
- metadata +14 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '091036d68a92b76cdfb383ae829bd65182a26ddc1146cce1d844a5646c27ca83'
|
4
|
+
data.tar.gz: 39bfe3ec5d4b57985902f5ab17f6d097db903f3151efee95068cefe4d2861f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4276c20cae2b83cc37b562217429e00b951a2e0a73bf384f931b47bd94b71774db3b42d62cfc1c380bf3b64bf9b6d5c6b8d98fbe18b5b2d9426558ba8aa40a1e
|
7
|
+
data.tar.gz: 4323e58139487b3192af2da916a8142f1bd56b7cf8d2df3dae2882172ea7cf22c10e0cfd4d31278cbd3e731f2a689ab871e6a5baa1d89d462a95df90ab389500
|
data/Gemfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "coradoc"
|
2
|
-
require "coradoc/
|
2
|
+
require "coradoc/input/html"
|
3
3
|
|
4
4
|
module Metanorma
|
5
5
|
module Plugin
|
@@ -7,7 +7,7 @@ module Metanorma
|
|
7
7
|
module Liquid
|
8
8
|
module CustomFilters
|
9
9
|
def html2adoc(input)
|
10
|
-
Coradoc::
|
10
|
+
Coradoc::Input::HTML.convert(input)
|
11
11
|
end
|
12
12
|
|
13
13
|
def interpolate(input)
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class KlassTableAttributeDrop < Liquid::Drop
|
4
|
+
LOWER_VALUE_MAPPINGS = {
|
5
|
+
"C" => "0",
|
6
|
+
"M" => "1",
|
7
|
+
}.freeze
|
8
|
+
|
9
|
+
def initialize(attr) # rubocop:disable Lint/MissingSuper
|
10
|
+
@attr = attr
|
11
|
+
end
|
12
|
+
|
13
|
+
def id
|
14
|
+
@attr[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
def name
|
18
|
+
@attr[:name]
|
19
|
+
end
|
20
|
+
|
21
|
+
def type
|
22
|
+
@attr[:type]
|
23
|
+
end
|
24
|
+
|
25
|
+
def xmi_id
|
26
|
+
@attr[:xmi_id]
|
27
|
+
end
|
28
|
+
|
29
|
+
def is_derived
|
30
|
+
@attr[:is_derived]
|
31
|
+
end
|
32
|
+
|
33
|
+
def cardinality
|
34
|
+
min = @attr[:cardinality]["min"]
|
35
|
+
min = min.nil? ? nil : LOWER_VALUE_MAPPINGS[min]
|
36
|
+
|
37
|
+
"#{min}..#{@attr[:cardinality]['max']}"
|
38
|
+
end
|
39
|
+
|
40
|
+
def definition
|
41
|
+
@attr[:definition]
|
42
|
+
end
|
43
|
+
|
44
|
+
def association
|
45
|
+
@attr[:association]
|
46
|
+
end
|
47
|
+
|
48
|
+
def has_association?
|
49
|
+
!!@attr[:association]
|
50
|
+
end
|
51
|
+
|
52
|
+
def upper_klass
|
53
|
+
@attr[:upper_klass]
|
54
|
+
end
|
55
|
+
|
56
|
+
def name_ns
|
57
|
+
@attr[:name_ns]
|
58
|
+
end
|
59
|
+
|
60
|
+
def type_ns
|
61
|
+
@attr[:type_ns]
|
62
|
+
end
|
63
|
+
|
64
|
+
def gen_name
|
65
|
+
@attr[:gen_name]
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class KlassTableContentDrop < Liquid::Drop
|
4
|
+
def initialize(content) # rubocop:disable Lint/MissingSuper
|
5
|
+
@content = content
|
6
|
+
end
|
7
|
+
|
8
|
+
def owned_props
|
9
|
+
@content[:owned_props]
|
10
|
+
end
|
11
|
+
|
12
|
+
def assoc_props
|
13
|
+
@content[:assoc_props]
|
14
|
+
end
|
15
|
+
|
16
|
+
def inherited_props
|
17
|
+
@content[:inherited_props]
|
18
|
+
end
|
19
|
+
|
20
|
+
def inherited_assoc_props
|
21
|
+
@content[:inherited_assoc_props]
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class KlassTableDrop < Liquid::Drop
|
4
|
+
def initialize(klass) # rubocop:disable Lint/MissingSuper
|
5
|
+
@klass = klass
|
6
|
+
end
|
7
|
+
|
8
|
+
def id
|
9
|
+
@klass[:general_id]
|
10
|
+
end
|
11
|
+
|
12
|
+
def name
|
13
|
+
@klass[:name]
|
14
|
+
end
|
15
|
+
|
16
|
+
def stereotype
|
17
|
+
@klass[:stereotype]
|
18
|
+
end
|
19
|
+
|
20
|
+
def definition
|
21
|
+
@klass[:definition]
|
22
|
+
end
|
23
|
+
|
24
|
+
def type
|
25
|
+
@klass[:type]
|
26
|
+
end
|
27
|
+
|
28
|
+
def upper_klass
|
29
|
+
@klass[:general_upper_klass]
|
30
|
+
end
|
31
|
+
|
32
|
+
def general
|
33
|
+
KlassTableGeneralDrop.new(@klass[:general]) if @klass[:general]
|
34
|
+
end
|
35
|
+
|
36
|
+
def has_general?
|
37
|
+
!!@klass[:general]
|
38
|
+
end
|
39
|
+
|
40
|
+
def attributes
|
41
|
+
@klass[:general_attributes].map do |attr|
|
42
|
+
KlassTableAttributeDrop.new(attr)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class KlassTableGeneralDrop < Liquid::Drop
|
4
|
+
def initialize(gen) # rubocop:disable Lint/MissingSuper
|
5
|
+
@gen = gen
|
6
|
+
end
|
7
|
+
|
8
|
+
def id
|
9
|
+
@gen[:general_id]
|
10
|
+
end
|
11
|
+
|
12
|
+
def name
|
13
|
+
@gen[:general_name]
|
14
|
+
end
|
15
|
+
|
16
|
+
def upper_klass
|
17
|
+
@gen[:general_upper_klass]
|
18
|
+
end
|
19
|
+
|
20
|
+
def general
|
21
|
+
KlassTableGeneralDrop.new(@gen[:general]) if @gen[:general]
|
22
|
+
end
|
23
|
+
|
24
|
+
def has_general?
|
25
|
+
!!@gen[:general]
|
26
|
+
end
|
27
|
+
|
28
|
+
def attributes
|
29
|
+
@gen[:general_attributes].map do |attr|
|
30
|
+
KlassTableAttributeDrop.new(attr)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{%- for attr in attributes -%}
|
2
|
+
{%- if attr.has_association? != false -%}
|
3
|
+
{%- capture name_col -%}
|
4
|
+
{{ attr.name_ns }}:{{ attr.name }}
|
5
|
+
({{ attr.gen_name }})
|
6
|
+
{%- endcapture -%}
|
7
|
+
| {{ name_col | newline_to_br }}
|
8
|
+
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality }}]
|
9
|
+
| {{ attr.definition }}
|
10
|
+
{%- endif -%}
|
11
|
+
{%- endfor -%}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{%- for attr in attributes -%}
|
2
|
+
{%- if attr.has_association? == false -%}
|
3
|
+
{%- capture name_col -%}
|
4
|
+
{{ attr.name_ns }}:{{ attr.name }}
|
5
|
+
({{ attr.gen_name }})
|
6
|
+
{%- endcapture -%}
|
7
|
+
| {{ name_col | newline_to_br }}
|
8
|
+
| {{ attr.type }} [{{ attr.cardinality }}]
|
9
|
+
| {{ attr.definition }}
|
10
|
+
{%- endif -%}
|
11
|
+
{%- endfor -%}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
[cols="1a,1a,2a"]
|
2
|
+
|===
|
3
|
+
| 型の定義
|
4
|
+
2+| {{ root.definition }}
|
5
|
+
|
6
|
+
h| 上位の型 2+| {{ root.general.upper_klass }}:{{ root.general.name }}
|
7
|
+
h| ステレオタイプ 2+| << {{ root.stereotype }} >>
|
8
|
+
|
9
|
+
3+h| 継承する属性
|
10
|
+
h| 属性名 h| 属性の型及び多重度 h| 定義
|
11
|
+
{{ content.inherited_props }}
|
12
|
+
|
13
|
+
3+h| 自身に定義された属性
|
14
|
+
{{ content.owned_props }}
|
15
|
+
|
16
|
+
3+h| 継承する関連役割
|
17
|
+
h| 関連役割名 h| 関連役割の型及び多重度 h| 定義
|
18
|
+
{{ content.inherited_assoc_props }}
|
19
|
+
|
20
|
+
3+h| 自身に定義された関連役割
|
21
|
+
h| 関連役割名 h| 関連役割の型及び多重度 h| 定義
|
22
|
+
{{ content.assoc_props }}
|
23
|
+
|===
|
@@ -21,7 +21,9 @@ module Metanorma
|
|
21
21
|
|
22
22
|
def gml_dictionary_template(document, template_path)
|
23
23
|
if template_path.nil?
|
24
|
-
|
24
|
+
::Metanorma::Util.log(
|
25
|
+
"[lutaml_gml_dictionary] Error: Template not found!", :error
|
26
|
+
)
|
25
27
|
end
|
26
28
|
|
27
29
|
rel_tmpl_path = Utils.relative_file_path(
|
@@ -0,0 +1,201 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "liquid_drops/klass_table_drop"
|
4
|
+
require_relative "liquid_drops/klass_table_attribute_drop"
|
5
|
+
require_relative "liquid_drops/klass_table_general_drop"
|
6
|
+
require_relative "liquid_drops/klass_table_content_drop"
|
7
|
+
|
8
|
+
module Metanorma
|
9
|
+
module Plugin
|
10
|
+
module Lutaml
|
11
|
+
class LutamlKlassTableBlockMacro < ::Asciidoctor::Extensions::BlockMacroProcessor
|
12
|
+
DEFAULT_TEMPLATE_PATH = File.join(
|
13
|
+
Gem::Specification.find_by_name("metanorma-plugin-lutaml").gem_dir,
|
14
|
+
"lib/metanorma/plugin/lutaml/liquid_templates/<NAME>.liquid",
|
15
|
+
)
|
16
|
+
DEFAULT_TABLE_TEMPLATE = DEFAULT_TEMPLATE_PATH
|
17
|
+
.gsub("<NAME>", "_klass_table")
|
18
|
+
DEFAULT_ROW_TEMPLATE = DEFAULT_TEMPLATE_PATH
|
19
|
+
.gsub("<NAME>", "_klass_row")
|
20
|
+
DEFAULT_ASSOC_ROW_TEMPLATE = DEFAULT_TEMPLATE_PATH
|
21
|
+
.gsub("<NAME>", "_klass_assoc_row")
|
22
|
+
|
23
|
+
use_dsl
|
24
|
+
named :lutaml_klass_table
|
25
|
+
|
26
|
+
def process(parent, target, attrs)
|
27
|
+
result_path = Utils.relative_file_path(parent.document, target)
|
28
|
+
|
29
|
+
gen = ::Lutaml::XMI::Parsers::XML.serialize_generalization_by_name(
|
30
|
+
result_path, attrs["name"]
|
31
|
+
)
|
32
|
+
|
33
|
+
render(gen, parent, attrs)
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def render(gen, parent, attrs) # rubocop:disable Metrics/MethodLength
|
39
|
+
content = {}
|
40
|
+
|
41
|
+
content[:owned_props] = render_owned_props(
|
42
|
+
gen, parent, attrs
|
43
|
+
)
|
44
|
+
content[:assoc_props] = render_assoc_props(
|
45
|
+
gen, parent, attrs
|
46
|
+
)
|
47
|
+
content[:inherited_props] = render_inherited_props(
|
48
|
+
gen, parent, attrs
|
49
|
+
)
|
50
|
+
content[:inherited_assoc_props] = render_inherited_assoc_props(
|
51
|
+
gen, parent, attrs
|
52
|
+
)
|
53
|
+
|
54
|
+
# content[:inherited_props] += render_named_inherited_props(
|
55
|
+
# gen, parent, attrs, "gml"
|
56
|
+
# )
|
57
|
+
# content[:inherited_props] += render_named_inherited_props(
|
58
|
+
# gen, parent, attrs, "core"
|
59
|
+
# )
|
60
|
+
# content[:inherited_assoc_props] += render_named_inherited_props(
|
61
|
+
# gen, parent, attrs, "gen"
|
62
|
+
# )
|
63
|
+
|
64
|
+
rendered_table = render_table(gen, parent, attrs, content)
|
65
|
+
|
66
|
+
block = create_open_block(parent, "", attrs)
|
67
|
+
parse_content(block, rendered_table, attrs)
|
68
|
+
end
|
69
|
+
|
70
|
+
def render_table(gen, parent, attrs, content)
|
71
|
+
table_tmpl = get_template(
|
72
|
+
parent.document, attrs["table_template"], :table
|
73
|
+
)
|
74
|
+
|
75
|
+
table_tmpl.assigns["root"] = KlassTableDrop.new(gen)
|
76
|
+
table_tmpl.assigns["content"] =
|
77
|
+
KlassTableContentDrop.new(content)
|
78
|
+
|
79
|
+
table_tmpl.render
|
80
|
+
end
|
81
|
+
|
82
|
+
def render_general_rows(general_item, parent, attrs)
|
83
|
+
row_tmpl = get_template(
|
84
|
+
parent.document, attrs["row_template"], :row
|
85
|
+
)
|
86
|
+
render_rows(general_item, row_tmpl)
|
87
|
+
end
|
88
|
+
|
89
|
+
def render_assoc_rows(general_item, parent, attrs)
|
90
|
+
row_tmpl = get_template(
|
91
|
+
parent.document, attrs["assoc_template"], :assoc_row
|
92
|
+
)
|
93
|
+
render_rows(general_item, row_tmpl)
|
94
|
+
end
|
95
|
+
|
96
|
+
def render_rows(general_item, row_tmpl)
|
97
|
+
gen_attrs = general_item[:general_attributes]
|
98
|
+
upper_klass = general_item[:general_upper_klass]
|
99
|
+
gen_name = general_item[:general_name]
|
100
|
+
attributes = prepare_row_drops(gen_attrs, upper_klass, gen_name)
|
101
|
+
row_tmpl.assigns["attributes"] = attributes
|
102
|
+
row_tmpl.render
|
103
|
+
end
|
104
|
+
|
105
|
+
def prepare_row_drops(gen_attrs, upper_klass, gen_name) # rubocop:disable Metrics/MethodLength
|
106
|
+
gen_attrs.map do |attr|
|
107
|
+
attr[:gen_name] = gen_name
|
108
|
+
attr[:upper_klass] = upper_klass
|
109
|
+
attr[:name_ns] = case attr[:type_ns]
|
110
|
+
when "core", "gml"
|
111
|
+
upper_klass
|
112
|
+
else
|
113
|
+
attr[:type_ns]
|
114
|
+
end
|
115
|
+
|
116
|
+
attr[:name_ns] = upper_klass if attr[:name_ns].nil?
|
117
|
+
|
118
|
+
KlassTableAttributeDrop.new(attr)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def render_owned_props(gen, parent, attrs)
|
123
|
+
render_general_rows(gen, parent, attrs)
|
124
|
+
end
|
125
|
+
|
126
|
+
def render_assoc_props(gen, parent, attrs)
|
127
|
+
render_assoc_rows(gen, parent, attrs)
|
128
|
+
end
|
129
|
+
|
130
|
+
def render_gml_inherited_props(gen, parent, attrs)
|
131
|
+
render_named_inherited_props(gen, parent, attrs, "gml")
|
132
|
+
end
|
133
|
+
|
134
|
+
def render_core_inherited_props(gen, parent, attrs)
|
135
|
+
render_named_inherited_props(gen, parent, attrs, "core")
|
136
|
+
end
|
137
|
+
|
138
|
+
def render_gen_inherited_props(gen, parent, attrs)
|
139
|
+
render_named_inherited_props(gen, parent, attrs, "gen")
|
140
|
+
end
|
141
|
+
|
142
|
+
def render_named_inherited_props(gen, parent, attrs, name)
|
143
|
+
attr_key = "#{name}_attributes".to_sym
|
144
|
+
general_item = {}
|
145
|
+
general_item[:general_attributes] = gen[attr_key]
|
146
|
+
general_item[:general_upper_klass] = gen[attr_key].first[:upper_klass]
|
147
|
+
general_item[:general_name] = name
|
148
|
+
|
149
|
+
render_general_rows(general_item, parent, attrs)
|
150
|
+
end
|
151
|
+
|
152
|
+
def render_inherited_props(gen, parent, attrs)
|
153
|
+
render_inherited_rows(gen, parent, attrs, assoc: false)
|
154
|
+
end
|
155
|
+
|
156
|
+
def render_inherited_assoc_props(gen, parent, attrs)
|
157
|
+
render_inherited_rows(gen, parent, attrs, assoc: true)
|
158
|
+
end
|
159
|
+
|
160
|
+
def render_inherited_rows(gen, parent, attrs, assoc: false) # rubocop:disable Metrics/MethodLength
|
161
|
+
rendered_rows = ""
|
162
|
+
general_item = gen[:general]
|
163
|
+
|
164
|
+
while general_item && !general_item.empty?
|
165
|
+
rendered_rows += if assoc
|
166
|
+
render_assoc_rows(general_item, parent, attrs)
|
167
|
+
else
|
168
|
+
render_general_rows(general_item, parent, attrs)
|
169
|
+
end
|
170
|
+
general_item = general_item[:general]
|
171
|
+
end
|
172
|
+
|
173
|
+
rendered_rows
|
174
|
+
end
|
175
|
+
|
176
|
+
def get_template(document, template_path, tmpl_type)
|
177
|
+
if template_path.nil?
|
178
|
+
template_path = get_default_template_path(tmpl_type)
|
179
|
+
end
|
180
|
+
|
181
|
+
rel_tmpl_path = Utils.relative_file_path(
|
182
|
+
document, template_path
|
183
|
+
)
|
184
|
+
|
185
|
+
::Liquid::Template.parse(File.read(rel_tmpl_path))
|
186
|
+
end
|
187
|
+
|
188
|
+
def get_default_template_path(tmpl_type)
|
189
|
+
case tmpl_type
|
190
|
+
when :row
|
191
|
+
DEFAULT_ROW_TEMPLATE
|
192
|
+
when :assoc_row
|
193
|
+
DEFAULT_ASSOC_ROW_TEMPLATE
|
194
|
+
else
|
195
|
+
DEFAULT_TABLE_TEMPLATE
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
@@ -229,9 +229,12 @@ module Metanorma
|
|
229
229
|
)
|
230
230
|
end.flatten
|
231
231
|
rescue StandardError => e
|
232
|
+
::Metanorma::Util.log(
|
233
|
+
"[LutamlPreprocessor] Failed to parse LutaML block: #{e.message}",
|
234
|
+
:error,
|
235
|
+
)
|
236
|
+
# [] # Return empty array to avoid breaking the document
|
232
237
|
raise e
|
233
|
-
document.logger.warn("Failed to parse LutaML block: #{e.message}")
|
234
|
-
[]
|
235
238
|
end
|
236
239
|
|
237
240
|
def parse_options(options_string)
|
@@ -121,10 +121,10 @@ options)
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
124
|
-
|
124
|
+
children_pks_diags = package_flat.call(all_children_packages)
|
125
125
|
ref_dictionary = ref_dictionary
|
126
126
|
.merge(package_flat.call(lutaml_document.packages)
|
127
|
-
.merge(
|
127
|
+
.merge(children_pks_diags))
|
128
128
|
end
|
129
129
|
document.attributes["lutaml_entity_id"] = ref_dictionary
|
130
130
|
end
|
@@ -138,12 +138,12 @@ options)
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
end
|
141
|
-
|
141
|
+
children_pks_diags = package_flat_diagrams.call(
|
142
142
|
lutaml_document.packages.map(&:children_packages).flatten,
|
143
143
|
)
|
144
144
|
document.attributes["lutaml_figure_id"] = package_flat_diagrams
|
145
145
|
.call(lutaml_document.packages)
|
146
|
-
.merge(
|
146
|
+
.merge(children_pks_diags)
|
147
147
|
end
|
148
148
|
|
149
149
|
def collect_additional_context(document, input_lines, end_mark)
|
@@ -265,7 +265,7 @@ options)
|
|
265
265
|
|
266
266
|
def config_entity_regexp(entity)
|
267
267
|
additional_sym = ".*" if /\*$/.match?(entity)
|
268
|
-
%r{^#{Regexp.escape(entity.
|
268
|
+
%r{^#{Regexp.escape(entity.delete('*'))}#{additional_sym}$}
|
269
269
|
end
|
270
270
|
|
271
271
|
def model_representation(lutaml_document, document, additional_context,
|
@@ -48,9 +48,11 @@ module Metanorma
|
|
48
48
|
|
49
49
|
def notify_render_errors(document, errors)
|
50
50
|
errors.each do |error_obj|
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
::Metanorma::Util.log(
|
52
|
+
"[metanorma-plugin-lutaml] Liquid render error: " \
|
53
|
+
"#{error_obj.message}",
|
54
|
+
:error,
|
55
|
+
)
|
54
56
|
end
|
55
57
|
end
|
56
58
|
|
@@ -87,7 +89,11 @@ module Metanorma
|
|
87
89
|
force_read: true,
|
88
90
|
)
|
89
91
|
rescue StandardError => e
|
90
|
-
|
92
|
+
::Metanorma::Util.log(
|
93
|
+
"[metanorma-plugin-lutaml] Failed to load " \
|
94
|
+
"#{full_path}: #{e.message}",
|
95
|
+
:error,
|
96
|
+
)
|
91
97
|
raise e
|
92
98
|
# nil
|
93
99
|
end
|
@@ -11,6 +11,7 @@ require "metanorma/plugin/lutaml/lutaml_ea_diagram_block_macro"
|
|
11
11
|
require "metanorma/plugin/lutaml/lutaml_gml_dictionary_base"
|
12
12
|
require "metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro"
|
13
13
|
require "metanorma/plugin/lutaml/lutaml_gml_dictionary_block"
|
14
|
+
require "metanorma/plugin/lutaml/lutaml_klass_table_block_macro"
|
14
15
|
|
15
16
|
module Metanorma
|
16
17
|
module Plugin
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
28
|
spec.add_dependency "asciidoctor"
|
29
|
-
spec.add_dependency "coradoc"
|
29
|
+
spec.add_dependency "coradoc", "~> 1.1.1"
|
30
30
|
spec.add_dependency "expressir", "~> 1.4.0"
|
31
31
|
spec.add_dependency "liquid"
|
32
32
|
spec.add_dependency "lutaml", ">= 0.9.4"
|
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.8
|
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-
|
11
|
+
date: 2024-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: coradoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: expressir
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -332,7 +332,14 @@ files:
|
|
332
332
|
- lib/metanorma/plugin/lutaml/liquid/multiply_local_file_system.rb
|
333
333
|
- lib/metanorma/plugin/lutaml/liquid_drops/gml_dictionary_drop.rb
|
334
334
|
- lib/metanorma/plugin/lutaml/liquid_drops/gml_dictionary_entry_drop.rb
|
335
|
+
- lib/metanorma/plugin/lutaml/liquid_drops/klass_table_attribute_drop.rb
|
336
|
+
- lib/metanorma/plugin/lutaml/liquid_drops/klass_table_content_drop.rb
|
337
|
+
- lib/metanorma/plugin/lutaml/liquid_drops/klass_table_drop.rb
|
338
|
+
- lib/metanorma/plugin/lutaml/liquid_drops/klass_table_general_drop.rb
|
335
339
|
- lib/metanorma/plugin/lutaml/liquid_templates/_diagrams_block.liquid
|
340
|
+
- lib/metanorma/plugin/lutaml/liquid_templates/_klass_assoc_row.liquid
|
341
|
+
- lib/metanorma/plugin/lutaml/liquid_templates/_klass_row.liquid
|
342
|
+
- lib/metanorma/plugin/lutaml/liquid_templates/_klass_table.liquid
|
336
343
|
- lib/metanorma/plugin/lutaml/liquid_templates/_packages.liquid
|
337
344
|
- lib/metanorma/plugin/lutaml/liquid_templates/_packages_class.liquid
|
338
345
|
- lib/metanorma/plugin/lutaml/liquid_templates/_packages_data_dictionary.liquid
|
@@ -352,6 +359,7 @@ files:
|
|
352
359
|
- lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_base.rb
|
353
360
|
- lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block.rb
|
354
361
|
- lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb
|
362
|
+
- lib/metanorma/plugin/lutaml/lutaml_klass_table_block_macro.rb
|
355
363
|
- lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb
|
356
364
|
- lib/metanorma/plugin/lutaml/lutaml_table_inline_macro.rb
|
357
365
|
- lib/metanorma/plugin/lutaml/lutaml_uml_attributes_table_preprocessor.rb
|