Mold

Website:

https://rocher.github.io/mold

Author:
  • Francesc Rocher
Maintainer:
  • Francesc Rocher <francesc.rocher@gmail.com>
License:

MIT

Version:

1.0.3

Alire CI:

Dependencies: Dependents:

No dependents.

Badge:

Meta-variable Operations for Lean Development (cli)

#template #template-engine #template-repo

Alire Alire CI/CD unit-test codecov GitHub release License

Welcome to Mold (cli)

MOLD: Meta-variable Operations for Lean Development

Mold is a Template Processor, or Template Engine, to work with repository templates. The main motivation of Mold is to have repositories in GitHub used as template repositories to create new, customized repositories for other users.

Main features supported in Mold include

  • variable replacement in mold files (*.mold)

  • for a given directory, variable replacement recursively for all mold files in all subdirectories

  • variable replacement in filenames

  • inclusion of other templates

  • definition of variables with a simple TOML file

  • predefined and custom text filters to easy text transformations

  • variable values can be defined with other variables

Variable replacement can be specified as normal, optional or mandatory. For example, the variable foo = "bar" can be specified with , (optional) or `` (mandatory). The difference is the handling of errors when an undefined variable is encountered.

All mold files must end with the extension .mold, for example README.md.mold. Destination files (with variables replaced) have the same name without the mold extension: README.md. This simplifies the work done in large subdirectories with few templates.

This crate contains the Ada library and unit tests. For a CLI tool, please take a look at the crate mold.

Reference Guide

Please visit Mold documentation for more information.


License

MIT (c) 2023, 2024 Francesc Rocher