https://github.com/rocher/mold_lib
Meta-variable Operations for Lean Development
https://github.com/rocher/mold_lib
ada ada-library alire-crate template template-engine template-project
Last synced: 5 months ago
JSON representation
Meta-variable Operations for Lean Development
- Host: GitHub
- URL: https://github.com/rocher/mold_lib
- Owner: rocher
- License: mit
- Created: 2023-08-03T19:51:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-21T21:50:01.000Z (about 1 year ago)
- Last Synced: 2025-05-21T22:40:33.189Z (about 1 year ago)
- Topics: ada, ada-library, alire-crate, template, template-engine, template-project
- Language: Ada
- Homepage: https://rocher.github.io/mold
- Size: 439 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://alire.ada.dev/crates/mold_lib.html)
[](https://alire-crate-ci.ada.dev/crates/mold_lib.html)

[](https://codecov.io/gh/rocher/mold_lib/tree/main)
[](https://github.com/rocher/mold_lib/releases/latest)
[](https://github.com/rocher/mold_lib/blob/master/LICENSE)

## Welcome to **Mold**
> **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 file names
* inclusion of other templates
* definition of variables with a simple TOML file
* predefined and customized text filters to easily apply text
transformations
Variable replacement can be specified as *normal*, *optional* or *mandatory*.
For example, the variable `foo = "bar"` can be specified with `{{foo}}`,
`{{?foo}}` (optional) or `{{#foo}}` (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.
Text filters can be used to apply text transformations, for example
`{{foo/W5}}` truncates the contents of the variable `foo` to a maximum width
of 5 characters.
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](https://rocher.github.io/mold) for more
information.
---
## License
MIT (c) 2023-2025 Francesc Rocher