Skip to content

Conversation

@linyows
Copy link
Owner

@linyows linyows commented Jan 20, 2026

Summary

  • Add sorting support for index tables with customizable sort order
  • Support default sorting behavior based on document metadata
  • Add custom sort syntax: {{@index{@col1|@col2,asc:@field}}}
  • Bump version to v0.3.0

Changes

Default Sort Behavior

  • If documents have @id: sort by @id ascending
  • Else if documents have @date: sort by @date descending
  • Else: sort by file modification time descending

Custom Sort Syntax

{{@index{@id|@title|@author,asc:@id}}}   // Sort by id ascending
{{@index{@id|@title|@date,desc:@date}}}  // Sort by date descending

Files Changed

  • src/index.zig: Add SortConfig, SortOrder, sorting functions and tests
  • src/main.zig: Integrate sorting in runIndex, update help message, bump version
  • README.md: Document sorting feature

Test plan

  • All existing tests pass
  • New tests for sorting functions added and pass
  • zig build test passes
  • zig build succeeds

🤖 Generated with Claude Code

- Add sorting support for index tables with customizable sort order
- Default sort: by @id (asc), @Date (desc), or mtime (desc)
- Custom sort syntax: {{@index{@col1|@Col2,asc:@field}}}
- Add DocumentMeta.mtime field for file modification time sorting
- Bump version to 0.3.0
- Update README with sorting documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@linyows linyows merged commit 813df0f into main Jan 20, 2026
3 checks passed
@linyows linyows deleted the feature/index-sorting branch January 20, 2026 08:35
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