Skip to content

feat(templates): Markdown as single source of truth - #12

Merged
gerfru merged 3 commits into
mainfrom
feat/md-single-source
Jul 4, 2026
Merged

feat(templates): Markdown as single source of truth#12
gerfru merged 3 commits into
mainfrom
feat/md-single-source

Conversation

@gerfru

@gerfru gerfru commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Single source of truth: All 5 QMS templates are now Markdown (.md.j2) — no more per-adapter duplicates
  • md_to_xwiki() converter in the XWiki adapter handles headings, tables, bold/italic, links, lists, blockquotes at deploy time
  • XWiki page hierarchy: deploy() now creates WebHome (index) → QM Manual (parent page) → nested document pages
  • New templates/qms_index.md.j2: space landing page with document index table and XWiki internal links
  • 17 new unit tests for the Markdown converter (tests/test_md_to_xwiki.py)
  • Deleted 5 orphaned .xwiki.j2 templates from PR fix: convert templates to XWiki 2.1 syntax (no extensions required) #11

Adapter strategy per phase

Phase Platform Template handling
1 (this PR) XWiki md_to_xwiki() regex converter
2 (future) Confluence Markdown natively supported
3 (future) SharePoint python-markdown to HTML

Test plan

  • All 54 tests pass (uv run python -m pytest tests/ -v)
  • Dry-run works: uv run qms-kit deploy --target selfhosted --config config/clients/example.yaml --dry-run
  • Live deploy to local XWiki: WebHome index + QM Manual parent + nested pages appear

Generated with Claude Code

gerfru and others added 3 commits July 4, 2026 21:22
- Restore all 5 templates to clean Markdown (.md.j2) — removes the
  per-adapter .xwiki.j2 duplicates from PR #11
- Add templates/qms_index.md.j2: space landing page with document
  index table and XWiki internal links
- Rewrite adapters/selfhosted/xwiki.py: add md_to_xwiki() converter
  (headings, tables, bold/italic, links, lists, blockquotes) and
  _md_inline() helper; deploy() now creates the full page hierarchy
  (WebHome index → QM Manual parent → nested document pages)
- Update cli/main.py: renders qms_index.md.j2 first, uses .md.j2 ext
- Add tests/test_md_to_xwiki.py: 17 unit tests for the converter
- Update tests/test_adapters.py: adjust PUT call count to 3 (parent +
  2 doc pages) to match new hierarchy deploy logic
- Add pytest as dev dependency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gerfru
gerfru merged commit 935fa61 into main Jul 4, 2026
6 checks passed
@gerfru
gerfru deleted the feat/md-single-source branch July 4, 2026 19:30
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.

1 participant