Skip to content

Add title format transformations for template variables#12

Merged
linyows merged 1 commit intomainfrom
feature/title-format-transform
Mar 8, 2026
Merged

Add title format transformations for template variables#12
linyows merged 1 commit intomainfrom
feature/title-format-transform

Conversation

@linyows
Copy link
Owner

@linyows linyows commented Mar 8, 2026

Summary

  • Add {{@title{format}}} template syntax to transform titles into filename-friendly formats
  • Supported formats: snake, kebab, lower, camel, pascal
  • Handles spaces, mixed separators, and camelCase boundaries

Examples

Syntax Input Output
{{@title{snake}}} API Design Review api_design_review
{{@title{kebab}}} API Design Review api-design-review
{{@title{lower}}} API Design Review api design review
{{@title{camel}}} API Design Review apiDesignReview
{{@title{pascal}}} API Design Review ApiDesignReview

Usage in config

{
  "filename_format": "{{@id{4}}}-{{@title{kebab}}}.md"
}

draft adr "Authentication System"0001-authentication-system.md

Both {{@title}} and {{@title{format}}} can be used together in the same template.

Test plan

  • Unit tests for each transformation function (snake, kebab, lower, camel, pascal)
  • Tests for edge cases: camelCase input, mixed separators, consecutive spaces
  • Integration tests for replaceTitleWithFormat within template strings
  • Integration tests for replaceVariables with combined {{@title}} and {{@title{format}}}
  • All existing tests still pass

🤖 Generated with Claude Code

Support {{@title{format}}} syntax to transform titles into
filename-friendly formats: snake, kebab, lower, camel, pascal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linyows linyows merged commit 1267543 into main Mar 8, 2026
3 checks passed
@linyows linyows deleted the feature/title-format-transform branch March 8, 2026 12:32
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.

1 participant