aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md37
1 files changed, 34 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b659aec..376b2b7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,12 +11,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-- Simplified `tmpl!` macro syntax: supports `tmpl!(tmpl, block_name { key = val, ... })` form, removing the `+=` operator and parentheses around each parameter group
-- Old syntax `tmpl!(tmpl += { ... })` remains backward compatible
+- **Display blocks (`??? >>> name` / `??? <<<`)** — new template syntax for
+ conditionally included sections. Controlled by `params` key presence: default
+ hidden, enabled via `template.insert_param("name", "")`.
+- **Per-arm display block control** — each implementation arm can independently
+ enable display blocks by including the block name in its own parameter map,
+ e.g. `{ crate_name = "you", extra = "" }` enables `??? >>> extra` for that
+ arm only.
+- **`just_template_macros` proc-macro crate** — new `tmpl!` proc macro replaces
+ the old `macro_rules!` macros (`tmpl!`, `tmpl_param!`), supporting:
+ - `tmpl!(tmpl, key = val)` and `tmpl! { key = val }` call forms
+ - Mixed simple parameters and implementation blocks in one call
+ - Braced multi-parameter arms: `{ key = val, key = val }` inside impl blocks
+ - Implicit template variable name (defaults to `tmpl` when omitted)
+- **Comprehensive test suite** — `test_expand.rs` (direct API tests) and
+ `test_macros.rs` (macro syntax tests), covering all features.
+- `Template::add_impl` now uses `HashMap::entry(...).or_default()` for brevity.
+- Public documentation for `Template` fields.
### Changed
-- Documentation and test code unified to use the simplified `tmpl!` syntax
+- **Restructured to workspace layout** — root `Cargo.toml` is now a workspace
+ root. Library code moved to `just_template/`, proc-macro code to
+ `just_template_macros/`.
+- **Replaced `macro_rules!` macros with proc macro** — old `tmpl_param!` and
+ `tmpl!` (declarative) macros are removed in favor of the new `tmpl!` proc
+ macro from `just_template_macros`.
+- **`expand.rs` refactored** — added `apply_display_blocks()`, per-arm display
+ param merging, migrated from `mem::replace` to `std::mem::take`, and replaced
+ `.len() < 1` / `.len() > 0` with `.is_empty()` / `!is_empty()`.
+
+### Removed
+
+- Old deprecated module (`deprecated.rs`) containing the old `macro_rules!`
+ macros.
+- Standalone test files `test_input.txt` and `test_expect.txt` — replaced by
+ inline tests in `test_expand.rs`.
+- Root-level `src/lib.rs` and `src/test.rs` — moved into workspace crates.
## [0.1.3] - 2026-03-02