Skip to content

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

Merged
sonupreetam merged 6 commits intocomplytime:mainfrom
sonupreetam:feat/diagram-rewrite-transform
Mar 31, 2026
Merged

feat(sync): CPLYTM-1290 add diagram block for Kroki rendering#4
sonupreetam merged 6 commits intocomplytime:mainfrom
sonupreetam:feat/diagram-rewrite-transform

Conversation

@sonupreetam
Copy link
Copy Markdown
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
  • - Refer CONTRIBUTING document

@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
Copy link
Copy Markdown
Member

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No major issues with this, but the main dep is not maintained.

Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Copy link
Copy Markdown

@marcusburghardt marcusburghardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A suggestion for a separate PR is to create a Makefile with some handy targets so we can more easily test it locally.

Copy link
Copy Markdown
Member

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonupreetam sonupreetam merged commit 03a6d1c into complytime:main Mar 31, 2026
12 checks passed
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.

4 participants