mold_lib

v2.3.1

Meta-variable Operations for Lean Development (lib)

AlireAlire CI/CDunit-testcodecovGitHub releaseLicense

Welcome to Mold (lib)

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 custom text filters to easy text transformations

  • predefined variables to use in templates

  • support for optional and mandatory variables

  • support for custom filters and variables

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.

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-2025 Francesc Rocher

Install

Globally install this crate:

alr install mold_lib

Add to your project:

alr with mold_lib

Crate Information

Authors

  1. Francesc Rocher

Maintainers

Maintainers (GitHub pseudo)

Release Date

10 days ago

First Release

8/29/2023

License

Statistics

Dependencies: 3

Dependents: 1

Versions: 8

Dependencies

ada_toml~0.3.0
gnat>=2021 | (>=12 & <2000)

Dependents