Skip to content

Added Liquid Filter methods for UnitsML template - #251

Closed
suleman-uzair wants to merge 47 commits into
mainfrom
feature/unitsml_liquid_filters
Closed

Added Liquid Filter methods for UnitsML template#251
suleman-uzair wants to merge 47 commits into
mainfrom
feature/unitsml_liquid_filters

Conversation

@suleman-uzair

@suleman-uzair suleman-uzair commented Aug 15, 2025

Copy link
Copy Markdown
Member

Metanorma PR checklist

This PR updates the Liquid filter methods for UnitsML template processing.

closes #177

@suleman-uzair
suleman-uzair force-pushed the feature/lutaml_xsd_command branch from ab3e7b5 to 238117d Compare August 15, 2025 15:49
@suleman-uzair
suleman-uzair force-pushed the feature/unitsml_liquid_filters branch 2 times, most recently from 8bbbdaf to d8c36a6 Compare August 18, 2025 12:36
@suleman-uzair

suleman-uzair commented Aug 21, 2025

Copy link
Copy Markdown
Member Author

@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 cc

This implementation doesn't contain any diagrams/images yet, based on our previous discussion:

let's get the document first without the diagrams, we should not do all at once

Please let me know if you have any comments or require any changes.

cc: @HassanAkbar

@suleman-uzair
suleman-uzair force-pushed the feature/unitsml_liquid_filters branch from 8e30cc2 to 47f83f3 Compare October 10, 2025 07:05
@suleman-uzair
suleman-uzair force-pushed the feature/lutaml_xsd_command branch from 8972c92 to 2e0df96 Compare October 10, 2025 07:06
@suleman-uzair
suleman-uzair force-pushed the feature/unitsml_liquid_filters branch from 47f83f3 to a2c8a5b Compare October 10, 2025 07:07
@suleman-uzair
suleman-uzair force-pushed the feature/lutaml_xsd_command branch from 2e0df96 to 5c01435 Compare November 5, 2025 13:54
@suleman-uzair
suleman-uzair force-pushed the feature/unitsml_liquid_filters branch from 9c3e7a1 to ec28ea4 Compare November 5, 2025 15:25
@suleman-uzair
suleman-uzair marked this pull request as ready for review December 11, 2025 12:41
@suleman-uzair
suleman-uzair marked this pull request as draft December 11, 2025 12:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_representation for 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-metadata section

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
suleman-uzair marked this pull request as ready for review December 11, 2025 12:43
@opoudjis

opoudjis commented May 6, 2026

Copy link
Copy Markdown
Contributor

@suleman-uzair @HassanAkbar @ronaldtse What is the status of this PR?

@suleman-uzair
suleman-uzair force-pushed the feature/unitsml_liquid_filters branch from 63d733a to cd689fb Compare May 6, 2026 15:10
suleman-uzair added 14 commits May 7, 2026 20:07
…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
@ronaldtse
ronaldtse force-pushed the feature/lutaml_xsd_command branch 2 times, most recently from b77c3a8 to bf5bc38 Compare May 13, 2026 13:08
Base automatically changed from feature/lutaml_xsd_command to main May 13, 2026 15:13
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

Successfully merging this pull request may close these issues.

Create new lutaml_xsd default template for rendering XSD schemas in Metanorma

3 participants