Implement CLI mode and Markdown parsing

- Add CLI mode distinction (gocv vs gocv serve)
- Add goldmark dependency for Markdown parsing
- Create content reading logic from ./content directory
- Implement Markdown to HTML conversion
- Add sample content/index.md for testing
- Update .gitignore for build artifacts

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
2026-03-05 02:13:16 +01:00
parent 70ca2e50e5
commit a1d054dfe4
7 changed files with 179 additions and 11 deletions

19
PLAN.md
View File

@@ -1,28 +1,33 @@
# Implementation Plan
## Project Constraints
- [ ] Pure Go binary (no external system dependencies for PDF).
- [ ] Config via `config.yaml` only (no CLI flags).
- [ ] Hardcoded paths: `./content` (input), `./output` (build artifacts).
- [ ] Modes: `gocv` (CLI), `gocv serve` (Daemon).
- [x] Pure Go binary (no external system dependencies for PDF).
- [x] Config via `config.yaml` only (no CLI flags).
- [x] Hardcoded paths: `./content` (input), `./output` (build artifacts).
- [x] Modes: `gocv` (CLI), `gocv serve` (Daemon).
- [ ] Commit at every loop iteration. Do not push. Do not tag.
## Current Status
- [x] Project backbone exists (HTTP server, graceful shutdown, config reading).
- [ ] Markdown parsing logic implemented.
- [x] Markdown parsing logic implemented (using goldmark).
- [ ] HTML Template engine integrated (Hugo-like theme selection).
- [ ] PDF Generation implemented (Pure Go library selected and integrated).
- [ ] CLI Mode (`gocv`) generates static files to `./output` and exits.
- [x] CLI Mode (`gocv`) generates static files to `./output` and exits.
- [ ] Serve Mode (`gocv serve`) hosts HTML and serves PDF on demand.
- [ ] File Watcher implemented for live reload in Serve Mode.
- [ ] Dockerfile created for multi-stage build.
## Active Task
- [ ] Analyze existing backbone code and integrate Markdown parsing.
- [x] Analyze existing backbone code and integrate Markdown parsing.
- [ ] Integrate HTML template engine with theme selection.
## Known Issues / Blockers
- [ ] Identify best Pure Go PDF library that supports HTML/CSS (or define CSS subset).
- [ ] Current output is raw HTML fragments without full HTML document structure.
## Completed Log
- [x] Initial project structure defined.
- [x] Basic HTTP server and signal handling implemented.
- [x] CLI mode vs Serve mode distinction implemented (checks os.Args[1] for "serve").
- [x] Content reading from `./content` directory implemented.
- [x] Markdown to HTML conversion using goldmark library.