Skip to content

fix(generator): resolve expr-based headings to the target filename - #84

Merged
jackchuka merged 1 commit into
jackchuka:mainfrom
toiroakr:fix/generate-heading-placeholder
Aug 27, 2026
Merged

fix(generator): resolve expr-based headings to the target filename#84
jackchuka merged 1 commit into
jackchuka:mainfrom
toiroakr:fix/generate-heading-placeholder

Conversation

@toiroakr

Copy link
Copy Markdown
Contributor

Summary

  • generate scaffolds an expr-based heading (e.g. filename == heading) as that literal expression text, since the generator doesn't know the target filename — the file then fails its own check.
  • Now tries the filename itself as the heading, verifies it against the real expression (vast.EvaluateHeadingExpr), and only falls back to the old text if that candidate doesn't actually satisfy it.
$ mdschema generate --schema schema.yml --output CreateOrder.md
$ head -1 CreateOrder.md
# filename == heading      # before
# CreateOrder              # after

filename == heading (and similar) now scaffolds the real filename
instead of the literal expression, when heading == filename actually
satisfies it.

@jackchuka jackchuka left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jackchuka
jackchuka merged commit 00381ce into jackchuka:main Aug 27, 2026
1 check passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 28, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jackchuka/mdschema](https://github.com/jackchuka/mdschema) | patch | `v0.15.1` → `v0.15.2` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jackchuka/mdschema (jackchuka/mdschema)</summary>

### [`v0.15.2`](https://github.com/jackchuka/mdschema/releases/tag/v0.15.2)

[Compare Source](jackchuka/mdschema@v0.15.1...v0.15.2)

#### What's Changed

- fix(generator): resolve expr-based headings to the target filename by [@&#8203;toiroakr](https://github.com/toiroakr) in [#&#8203;84](jackchuka/mdschema#84)
- fix(generator): let expr win over pattern and guard empty filenames by [@&#8203;jackchuka](https://github.com/jackchuka) in [#&#8203;85](jackchuka/mdschema#85)

#### New Contributors

- [@&#8203;toiroakr](https://github.com/toiroakr) made their first contribution in [#&#8203;84](jackchuka/mdschema#84)

**Full Changelog**: <jackchuka/mdschema@v0.15.1...v0.15.2>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODguMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants