Skip to content

feat(sync): CPLYTM-1290 add diagram block for Kroki rendering#4

Open
sonupreetam wants to merge 5 commits intocomplytime:mainfrom
sonupreetam:feat/diagram-rewrite-transform
Open

feat(sync): CPLYTM-1290 add diagram block for Kroki rendering#4
sonupreetam wants to merge 5 commits intocomplytime:mainfrom
sonupreetam:feat/diagram-rewrite-transform

Conversation

@sonupreetam
Copy link
Contributor

@sonupreetam sonupreetam commented Mar 23, 2026

Summary

  • Adds rewriteDiagramBlocks transform to transform.go that converts standard diagram code blocks (```mermaid, ```plantuml, ```d2, etc.) to the ```kroki {type=...} format Hugo's Kroki render hook expects
  • Wires the transform into all three sync pipelines: syncConfigSource (opt-in via rewrite_diagrams: true), syncRepoDocPages (always-on), and processRepo README processing (always-on)
  • Adds RewriteDiagrams field to the Transform config struct for per-file control in sync-config.yaml
  • 12 unit tests covering all supported diagram types, edge cases (dot→graphviz normalisation, already-kroki blocks, inline references, trailing whitespace)

Test plan

  • All 12 new TestRewriteDiagramBlocks subtests pass
  • Full test suite passes (all existing tests unaffected)
  • Code compiles cleanly, no lint errors
  • Verify end-to-end: sync a repo containing a ```mermaid block and confirm Hugo renders it as SVG via Kroki
  • - Dependency: feat(cli): CPLYTM-1291 content sync tool org wide doc #2

@sonupreetam sonupreetam marked this pull request as ready for review March 23, 2026 14:04
@sonupreetam sonupreetam changed the title feat(sync): add diagram block rewrite transform for Kroki rendering feat(sync): CPLYTM-1290 add diagram block for Kroki rendering Mar 23, 2026
@sonupreetam sonupreetam requested a review from a team March 24, 2026 09:10
@sonupreetam sonupreetam force-pushed the feat/diagram-rewrite-transform branch from 1be3f9c to 9341cf8 Compare March 24, 2026 12:23
@sonupreetam sonupreetam removed the request for review from a team March 25, 2026 10:11
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
@sonupreetam sonupreetam force-pushed the feat/diagram-rewrite-transform branch from 9341cf8 to 18d4de8 Compare March 26, 2026 08:46
@sonupreetam sonupreetam marked this pull request as draft March 26, 2026 11:05
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
@sonupreetam sonupreetam force-pushed the feat/diagram-rewrite-transform branch from 9e383a9 to 5635156 Compare March 26, 2026 14:35
@sonupreetam sonupreetam requested review from jpower432 and removed request for AlexXuan233 March 26, 2026 14:44
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
@sonupreetam sonupreetam marked this pull request as ready for review March 26, 2026 14:51
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