Added Liquid Filter methods for UnitsML template - #251
Conversation
ab3e7b5 to
238117d
Compare
8bbbdaf to
d8c36a6
Compare
|
@ronaldtse, Here's the list of draft PRs (ready on my end) for this feature:
I have included the HTML file here for you to review the presentation of the output, generated with the following command: bundle exec metanorma sources/unitsml_xsd_docs/document.adoc -t ccThis implementation doesn't contain any diagrams/images yet, based on our previous discussion:
Please let me know if you have any comments or require any changes. cc: @HassanAkbar |
8e30cc2 to
47f83f3
Compare
8972c92 to
2e0df96
Compare
47f83f3 to
a2c8a5b
Compare
2e0df96 to
5c01435
Compare
9c3e7a1 to
ec28ea4
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds Liquid filter methods and template processing capabilities for UnitsML XSD schema documentation generation. The changes introduce a new to_xml_representation filter to replace the previous used_by filter, add support for direct block processing of XSD schemas with Liquid templates, and refactor test fixtures to use external files instead of inline strings.
Key changes:
- Introduced new Liquid filter
to_xml_representationfor XML schema rendering - Added direct block syntax for XSD processing:
lutaml_xsd::<schema>[<context>,<template>,options] - Refactored tests to use external fixture files for maintainability
- Updated metadata structure with
semantic-metadatasection
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/spec_helper.rb | Added strip_filename helper, updated BLANK_HDR with semantic-metadata section and changed title attribute from format to type |
| spec/metanorma/plugin/lutaml/lutaml_xsd_preprocessor_spec.rb | Refactored tests to use external fixture files, added new test context for template-based XSD documentation |
| spec/metanorma/plugin/lutaml/*_spec.rb | Updated tests to use strip_filename helper for image filename attributes |
| spec/fixtures/lutaml/unitsml_liquid_templates/*.adoc | Added Liquid template files for rendering XSD elements, complex types, and attribute groups |
| spec/fixtures/lutaml/*.xml | Added expected output fixture files for UnitsML schema documentation tests |
| spec/fixtures/lutaml/xsd_schemas/omml.xsd | Added documentation annotation to CT_OMathArgPr complex type |
| lib/metanorma/plugin/lutaml/utils.rb | Added LIQUID_INCLUDE_PATH constant for default template location |
| lib/metanorma/plugin/lutaml/lutaml_xsd_preprocessor.rb | Added direct block processing support, template file reading, and options parsing |
| lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb | Added assign_options_in_liquid method stub |
| lib/metanorma/plugin/lutaml/lutaml_ea_xmi_base.rb | Moved LIQUID_INCLUDE_PATH to Utils module |
| lib/metanorma/plugin/lutaml/liquid/custom_filters/xsd/used_by.rb | Removed (94 lines deleted) |
| lib/metanorma/plugin/lutaml/liquid/custom_filters/xsd/to_xml_representation.rb | Added new filter for XML representation rendering |
| lib/metanorma/plugin/lutaml/base_preprocessor.rb | Extracted file_system method, added FILE_SYSTEM_PATTERNS constant |
| Gemfile | Updated dependencies including metanorma-standoc branch reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@suleman-uzair @HassanAkbar @ronaldtse What is the status of this PR? |
63d733a to
cd689fb
Compare
…mmand # Conflicts: # Gemfile # lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb # metanorma-plugin-lutaml.gemspec
…_filters # Conflicts: # Gemfile # lib/metanorma/plugin/lutaml/lutaml_xsd_preprocessor.rb # lib/metanorma/plugin/lutaml/utils.rb # spec/metanorma/plugin/lutaml/lutaml_diagram_block_spec.rb # spec/metanorma/plugin/lutaml/lutaml_express_preprocessor_spec.rb # spec/metanorma/plugin/lutaml/lutaml_text_preprocessor_spec.rb # spec/spec_helper.rb
b77c3a8 to
bf5bc38
Compare
Metanorma PR checklist
This PR updates the
Liquidfilter methods for UnitsML template processing.closes #177