metanorma-plugin-lutaml 0.7.13 → 0.7.15
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: '084aa029d93896c415377c7d2cf97cbc449c4105e838496cc8d598ecf3aa9a5f'
|
|
4
|
+
data.tar.gz: 50347ca8bb82cb0cf10a3c07eb2df5386180395948b06dd7a266bcd50565bb93
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5298953ac429e585eab80983840e541f83be422e7ffec84c8c4dd398aba5a3e0534146e775088e9dcf6659ef3747718953a95d25b37b3b76ae50ad2ea971057f
|
|
7
|
+
data.tar.gz: 6533e3763431b164961944be151092bec140137d244b8fad2664d59aec2854d8bc955bb733c1a439eddb3450aa239aff9d5bfdfa02814b34f15ce920a304dd35
|
data/README.adoc
CHANGED
|
@@ -386,7 +386,28 @@ The command accepts the options listed below:
|
|
|
386
386
|
|
|
387
387
|
* `/path/to/example.xmi` specifies the path of xmi file.
|
|
388
388
|
|
|
389
|
-
* `name
|
|
389
|
+
* `name` option only, `name` option with `package` option or `path` option.
|
|
390
|
+
One of 3 forms of options can be used to specify the name of the class.
|
|
391
|
+
|
|
392
|
+
** `name="NameOfClass"` specifies the name of the `class`.
|
|
393
|
+
(e.g. `name="Building"`)
|
|
394
|
+
If there are multiple classes with the same name, other form of options
|
|
395
|
+
are recommended to specify the class.
|
|
396
|
+
|
|
397
|
+
** `package="NameOfPackage"name="NameOfClass"` specifies the name of the
|
|
398
|
+
`class` (specified by `name` option) inside the `package`
|
|
399
|
+
(specified by `package` option).
|
|
400
|
+
The `package` option must be used with the `name` option.
|
|
401
|
+
(e.g. `package="uro",name="_BoundarySurface"`)
|
|
402
|
+
|
|
403
|
+
** `path="PathOfClass"` specifies the `absolute` path of the `class`
|
|
404
|
+
which is started with `::`
|
|
405
|
+
(e.g. `path="::EA_Model::Conceptual Models::i-UR::Urban Planning ADE 3.
|
|
406
|
+
1::uro::_BoundarySurface"`)
|
|
407
|
+
or `relative` path of the `class` which is not started with `::`
|
|
408
|
+
(e.g. `path="uro::_BoundarySurface"`).
|
|
409
|
+
The last part of the path separated by `::` is the name of the `class`.
|
|
410
|
+
The other parts of the path are the names of the `packages`.
|
|
390
411
|
|
|
391
412
|
* `template="/path/to/templates/_my_klass_table.liquid"` specifies the path of
|
|
392
413
|
the liquid template. (Optional)
|
|
@@ -394,7 +415,7 @@ The command accepts the options listed below:
|
|
|
394
415
|
`lib/metanorma/plugin/lutaml/templates`. This template can be customized by
|
|
395
416
|
changing the template path in the `template` option.
|
|
396
417
|
|
|
397
|
-
* `guidance="/path/to/my_guidance.yml"`specifies the path of
|
|
418
|
+
* `guidance="/path/to/my_guidance.yml"` specifies the path of
|
|
398
419
|
the yaml file of the guidance. (Optional)
|
|
399
420
|
|
|
400
421
|
The guidance file should be in the following format:
|
|
@@ -886,8 +907,36 @@ packages:
|
|
|
886
907
|
guidance: "path/to/guidance.yaml"
|
|
887
908
|
-----
|
|
888
909
|
|
|
889
|
-
|
|
890
|
-
|
|
910
|
+
The guidance file should be in the following format:
|
|
911
|
+
|
|
912
|
+
[source,yaml]
|
|
913
|
+
----
|
|
914
|
+
---
|
|
915
|
+
classes:
|
|
916
|
+
- name: "NameOfClass"
|
|
917
|
+
attributes:
|
|
918
|
+
- name: Name Of Attribute (e.g. gml:boundedBy)
|
|
919
|
+
used: false
|
|
920
|
+
guidance: |
|
|
921
|
+
Drop guidance message here.
|
|
922
|
+
...
|
|
923
|
+
----
|
|
924
|
+
|
|
925
|
+
If you want to define the guidance, you can define the `name` of the class
|
|
926
|
+
under `classes`. Then define which `attributes` you want to add guidance by the
|
|
927
|
+
`name`. Set `used` to show the attribute is used or not. Drop the message of
|
|
928
|
+
guidance in `guidance`.
|
|
929
|
+
|
|
930
|
+
The `name` of class can be defined in the following ways:
|
|
931
|
+
|
|
932
|
+
* `name: "NameOfClass"` specifies the name of the `class`.
|
|
933
|
+
(e.g. `name: "Building"`)
|
|
934
|
+
If there are multiple classes with the same name, it is recommended to
|
|
935
|
+
specify the class by absolute path.
|
|
936
|
+
|
|
937
|
+
* `name: "::NameOfPackage::NameOfClass"` specifies the name of the `class` in
|
|
938
|
+
`absolute` path.
|
|
939
|
+
(e.g. `name: "::EA_Model::Conceptual Models::CityGML2.0::bldg::Building"`)
|
|
891
940
|
|
|
892
941
|
== Documentation
|
|
893
942
|
|
|
@@ -28,8 +28,16 @@ module Metanorma
|
|
|
28
28
|
)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
path = if !attrs["path"].nil?
|
|
32
|
+
attrs["path"]
|
|
33
|
+
elsif !attrs["package"].nil? && !attrs["name"].nil?
|
|
34
|
+
"#{attrs['package']}::#{attrs['name']}"
|
|
35
|
+
else
|
|
36
|
+
attrs["name"]
|
|
37
|
+
end
|
|
38
|
+
|
|
31
39
|
klass = ::Lutaml::XMI::Parsers::XML.serialize_generalization_by_name(
|
|
32
|
-
xmi_path,
|
|
40
|
+
xmi_path, path, attrs["guidance"]
|
|
33
41
|
)
|
|
34
42
|
|
|
35
43
|
render(klass, parent, attrs)
|
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.15
|
|
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-
|
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciidoctor
|