Skip to content

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

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

feat(sync): CPLYTM-1290 add diagram block for Kroki rendering#4
sonupreetam wants to merge 10 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

…ment

Signed-off-by: Sonu Preetam <spreetam@redhat.com>
…covery

Signed-off-by: Sonu Preetam <spreetam@redhat.com>
…cleanup

Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
…egration

Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
@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
- cron: '0 6 * * 1'

permissions:
contents: write

Check failure

Code scanning / Scorecard

Token-Permissions High

score is 0: topLevel 'contents' permission set to 'write'
Remediation tip: Visit https://app.stepsecurity.io/secureworkflow.
Tick the 'Restrict permissions for GITHUB_TOKEN'
Untick other options
NOTE: If you want to resolve multiple issues at once, you can visit https://app.stepsecurity.io/securerepo instead.
Click Remediation section below for further remediation help
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
@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
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