Commit Graph

4 Commits

Author SHA1 Message Date
Luong NGUYEN 553a319934 feat(scripts): add markdown rendering validator (#119) (#120)
Catches mechanical rendering bugs that look fine in a diff but render
wrong on GitHub / in the EPUB build: inner backticks inside inline-code
spans (PR #114), unescaped pipes in table cells (PR #115), stray
`$ARGUMENTS` outside code, and unmatched fences.

Scope: `**/README.md` across tutorial modules + translations (ja, uk,
vi, zh). Excludes dev tooling dirs (`.claude`, `.venv`, `openspec`, …).

Rule registry: each rule is `(Path, content) -> list[str]`. Adding a
new rule = one function + one registry entry + one test fixture.

- scripts/check_markdown_rendering.py: 4 rules, CommonMark-aware code-
  span consumption, blockquote-fence-aware masking
- scripts/tests/test_check_markdown_rendering.py: 20 unit tests,
  positive + negative per rule, currency-false-positive guard
- .pre-commit-config.yaml: new global `markdown-rendering` hook
2026-05-11 23:49:39 +02:00
Luong NGUYEN eff5bd226a test(scripts): cover repo-root boundary in check_cross_references (#95)
* test(scripts): cover repo-root boundary in check_cross_references

Locks in the boundary behavior added in #91: links resolving outside
the repo root are silently skipped, in-repo broken links still error,
and valid in-repo links still pass.

* test(scripts): cover missing-README detection in numbered lesson dirs
2026-04-25 00:33:21 +02:00
Luong NGUYEN e76bbe40f2 refactor(epub): replace Kroki HTTP dependency with local mmdc rendering (#10) (#52)
* refactor(epub): replace Kroki HTTP dependency with local mmdc rendering (#10)

Remove httpx/tenacity dependencies and Kroki.io API calls from the EPUB
build pipeline. MermaidRenderer now invokes mmdc (mermaid-cli) as a local
subprocess, eliminating intermittent CI failures caused by network
unavailability. CI workflow installs @mermaid-js/mermaid-cli before build.

* fix(epub): add subprocess timeout and fix deduplication log count

- Add 60s timeout to mmdc subprocess.run to prevent hanging builds
  when Chromium/Puppeteer stalls in headless CI environments
- Fix misleading log that printed unique/total as equal counts;
  now logs "N unique diagrams (M total blocks)" explicitly
- Add test_render_all_timeout and strengthen deduplication assertion
2026-04-06 23:44:59 +02:00
Luong NGUYEN 540508f392 ci: Add DevOps quality assurance with pre-commit hooks and GitHub Actions
- Add pre-commit hooks: Ruff lint/format, Bandit security scan, YAML/TOML validation
- Add GitHub Actions CI workflow: lint, security, test, and build jobs
- Configure Ruff and Bandit in pyproject.toml
- Add pytest test suite for build_epub.py (25 tests)
- Fix code issues: exception chaining, httpx timeout, formatting
- Add requirements.txt and requirements-dev.txt
2025-12-10 23:49:52 +01:00