inrupt / artifact-generator

Tool for generating and publishing programming-language-specific libraries (i.e., artifacts) that bundle together source-code classes to represent individual RDF vocabularies, where each class contains constants for all of the RDF terms (i.e., the RDF Classes and Properties) defined in each of those vocabularies.
MIT License
10 stars 3 forks source link

[2pt] Use partial templates to reduce yaml template #86

Open NSeydoux opened 4 years ago

NSeydoux commented 4 years ago

Related to #74

Currently, the YAML file template includes both language-agnostic (e.g. programmingLanguage) and language-specific (e.g. npmModuleScope) options. This leads to a somewhat messy template, and it will grow more and more complex as support for additional languages is added to the artifact generator.

Handlebar makes it possible to define partial templates, which would reduce the main YAML by moving to dedicated files language-specific templates.

pmcb55 commented 4 years ago

Cool (I didn't know about that Handlebars feature) - sounds like a nice tidy-up. Should probably be tackled as part of the broader clean-up refactoring issue (which I can't find now (the one about the current ArtifactGenerator.js code iterating multiple times through the YAML vocab list)).