Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lutaml_uml_datamodel_description macro #34

Closed
w00lf opened this issue Jul 8, 2021 · 5 comments
Closed

lutaml_uml_datamodel_description macro #34

w00lf opened this issue Jul 8, 2021 · 5 comments

Comments

@w00lf
Copy link
Contributor

w00lf commented Jul 8, 2021

We need to create a new macro for generating datamodel ascidoc code similar to the one used in metanorma/ogc-citygml-xmi#1 in lutaml macro. Proposed format:

[lutaml_uml_datamodel_description, /path/to/file.xmi, /path/to/config.yml]
--
[.preface]
---
some text
---

[.footer]
---
My custom footer text
--- 
--

Where:

  • /path/to/file.xmi - required, path to uml datamodel xmi file
  • /path/to/config.yml - optional, path to special yaml config file, look below for format
  • block text, .preface, .footer macroses - optional, sets predefined text to be inserted into the temaplte during render, .preface and .footer is just an example of naming, TODO: define actual blocks

The above-mentioned macro need to use supplied xmi file and generate adoc code similar to the one used here - https://github.com/metanorma/ogc-citygml-xmi/blob/master/sources/standard/_packages.liquid and insert into the document.

Yaml config file.

Additional config file used to tell the parser what packages to use in the render and in what order, also it can hold packages to skip.

example:

packages_to_render:
  - one
  - two*
  - skip: three
  - four
  • packages_to_render - main attribute, need to be a list of string/objects. Each string interpreted as a pattern that will be used to select packages can have a wildcard - * in order to match multiply packages. In order to skip some packages one can use an object instead of a string: skip: three*, each object will be taken and matched against package name and if pattern matches it will skip it.
w00lf pushed a commit that referenced this issue Jul 8, 2021
…code to read and serialize xmi file, use liquid includes from gem, insert predefined code blocks from macro, test.xmi test file
@ronaldtse
Copy link
Contributor

I think at the current point we can use a YAML file like this:

packages:
  # includes these packages
  - "Package *"
  - two*
  - three
  # skips these packages
  - skip: four
[lutaml_uml_datamodel_description, /path/to/file.xmi, /path/to/config.yml]
--
[.before,package="Package 1"]
---
Text before Package 1
---

[.after,package="Package 2"]
---
Text after Package 2
--- 
--

@w00lf
Copy link
Contributor Author

w00lf commented Jul 16, 2021

@ronaldtse implemented in #35

w00lf pushed a commit to metanorma/metanorma.org that referenced this issue Jul 18, 2021
ronaldtse pushed a commit that referenced this issue Jul 26, 2021
…code to read and serialize xmi file, use liquid includes from gem, insert predefined code blocks from macro, test.xmi test file
ronaldtse pushed a commit that referenced this issue Jul 26, 2021
w00lf pushed a commit that referenced this issue Aug 2, 2021
ronaldtse pushed a commit that referenced this issue Aug 4, 2021
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Aug 9, 2021
@w00lf
Copy link
Contributor Author

w00lf commented Aug 9, 2021

Implement support for xmi file diagrams lookup. Example of diagram ref in requirement file - https://raw.githubusercontent.com/metanorma/ogc-dggs-xmi/feature/lutaml_uml_datamodel_description/sources/as21-dggs/requirements/_temporal_geometry_and_topology.adoc?token=AAI2XFBA62KNW4HLX5A6GXLBCEDPW. Proposed syntax:

lutaml-figure:[name="Fig: Primitives of Zonal Identifier"]

Eg: use diagram name as a lookup id and transform it into <<figure-{{ diagram.xmi_id}}>>(EA names diagram images by this pattern)

@ronaldtse
Copy link
Contributor

For the record with @w00lf we've also discussed:

Because lutaml programmatically generates content, you can generate attributes like:

:figure-MyFigureName: EAID_C2D34AA2_FF6B_4b2d_BF51_89A80AE81170

Then in asciidoc you can retrieve it via:

This is my ID {figure-MyFigureName}

ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Aug 10, 2021
w00lf pushed a commit that referenced this issue Aug 11, 2021
…up by package and diagram names. Support for mutiply internal diagrams lutaml_datamodel_description macro, fixes
w00lf pushed a commit to metanorma/metanorma-standoc that referenced this issue Aug 11, 2021
@ronaldtse
Copy link
Contributor

This is implemented. Thanks @w00lf .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants