Conversation
Implement a Markdown template generator with the following features: - Template-based document generation with variable substitution - Auto-increment document IDs - Index generation with customizable table format - Built-in ADR and Design Doc templates - Modular code structure (config, template, index, utils) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add CI workflow for testing on Ubuntu and macOS - Test against Zig 0.13.0 and master - Add lint job for format checking - Configure Dependabot for GitHub Actions updates Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces the initial implementation of a Markdown template generator CLI tool written in Zig. The tool enables generation of Markdown documents from templates with variable substitution, auto-incrementing document IDs, and index file generation.
Changes:
- Implements core CLI with template-based document generation supporting variable substitution (
{{@title}},{{@date}},{{@name}},{{@id}}) - Adds auto-increment ID functionality with configurable digit width formatting
- Includes built-in ADR and Design Doc templates with index generation
- Sets up CI/CD with GitHub Actions for testing and linting across multiple platforms
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main.zig | Main CLI entry point with command routing for init, generate, and index operations |
| src/config.zig | Configuration loading from JSON with default values |
| src/template.zig | Template variable replacement and ID formatting logic |
| src/index.zig | Document metadata extraction and index table generation |
| src/utils.zig | Utility functions for date, username, and next ID retrieval |
| src/templates/*.md | Built-in template files for ADR and Design documents |
| build.zig | Zig build configuration |
| build.zig.zon | Package metadata |
| README.md | Comprehensive documentation with usage examples |
| .github/workflows/ci.yml | CI workflow for testing and building |
| .github/dependabot.yml | Dependabot configuration for GitHub Actions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
|
|
||
| ### Build from source | ||
|
|
||
| Requires Zig 0.13.0 or later. |
There was a problem hiding this comment.
The build.zig.zon specifies minimum_zig_version as '0.15.0', but the documentation states '0.13.0 or later'. These should be consistent.
| Requires Zig 0.13.0 or later. | |
| Requires Zig 0.15.0 or later. |
.github/workflows/ci.yml
Outdated
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| zig-version: ['0.13.0', 'master'] |
There was a problem hiding this comment.
The CI workflow tests with Zig 0.13.0, but build.zig.zon specifies minimum_zig_version as '0.15.0'. The test matrix should use the actual minimum version or higher.
.github/workflows/ci.yml
Outdated
| - name: Setup Zig | ||
| uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 | ||
| with: | ||
| version: '0.13.0' |
There was a problem hiding this comment.
The lint job uses Zig 0.13.0, but build.zig.zon specifies minimum_zig_version as '0.15.0'. This should match the minimum required version.
| version: '0.13.0' | |
| version: '0.15.0' |
- Update test matrix to use Zig 0.15.0 (remove 0.13.0 and master) - Update lint job to use Zig 0.15.0 - Update README to specify correct minimum version The project requires Zig 0.15.0+ due to build.zig.zon syntax and stdlib API usage. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
goto-bus-stop/setup-zig doesn't support Zig 0.15.0 yet. mlugg/setup-zig has better support for recent Zig versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The official Zig download mirrors don't have 0.15.0 indexed yet. Use zml.ai mirror which has the release available. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use Zig 0.15.2 which is available in setup-zig - Update minimum_zig_version in build.zig.zon - Update README to reflect correct version requirement Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
{{@title}},{{@date}},{{@name}},{{@id}})Test plan
zig build test- All tests passzig build- Build succeedsdraft help- Shows usagedraft version- Shows versiondraft init- Creates .draft directory with templates🤖 Generated with Claude Code