Skip to content

v0.1.0

Latest

Choose a tag to compare

@f440 f440 released this 22 Jun 05:00

🚀 Handlebars Template System

This is a breaking change release that migrates from simple variable templates to a powerful Handlebars templating system.

⚠️ Breaking Changes

  • Template syntax changed from %variable to {{variable}} format
  • Line numbers now provided as separate startLine and endLine variables
  • All existing custom formats need to be updated (see migration guide below)

✨ New Features

  • Handlebars templating engine for powerful format customization
  • Helper functions: replace for regex replacement, encodeURIComponent for URL encoding
  • Conditional logic support (e.g., {{#if endLine}})
  • Enhanced error handling for malformed templates
  • Comprehensive test suite for template functionality

📋 Migration Guide

Old format (no longer supported):

{
  "name": "Path with line",
  "format": "%r:%l"
}

New format:

{
  "name": "Path with line", 
  "format": "{{relativePath}}:{{startLine}}{{#if endLine}}-{{endLine}}{{/if}}"
}

Variable mapping:

  • %p → {{absolutePath}}
  • %r → {{relativePath}}
  • %n → {{fileName}}
  • %s → {{selectedText}}
  • %l → {{startLine}}{{#if endLine}}-{{endLine}}{{/if}}

🎯 Why This Change?

The new Handlebars system provides much more powerful templating capabilities including conditional logic, helper functions, and better extensibility for future features.