Guidance for implementing a SkiaSharp renderer #683

Open
opened 2026-01-29 14:42:53 +00:00 by claunia · 2 comments
Owner

Originally created by @kpko on GitHub (Jun 29, 2024).

Hi!

I'm interested in implementing a custom renderer for Markdig to render to SkiaSharp. SkiaSharp provides a "Canvas" element with methods like DrawLine, DrawImage, DrawText etc. That would make it possible to render to PNGs, PDFs...

Could somebody give me a starting point? I got a bit confused by the Normalize-Render classes, ObjectRenderers.. What would be the easiest point to start an implementation? Also, what would be the best thing to make the implementation as complete as possible (i.e. no missing renderers for components)?

Thank you very much!

Originally created by @kpko on GitHub (Jun 29, 2024). Hi! I'm interested in implementing a custom renderer for Markdig to render to SkiaSharp. SkiaSharp provides a "Canvas" element with methods like DrawLine, DrawImage, DrawText etc. That would make it possible to render to PNGs, PDFs... Could somebody give me a starting point? I got a bit confused by the Normalize-Render classes, ObjectRenderers.. What would be the easiest point to start an implementation? Also, what would be the best thing to make the implementation as complete as possible (i.e. no missing renderers for components)? Thank you very much!
claunia added the question label 2026-01-29 14:42:53 +00:00
Author
Owner

@xoofx commented on GitHub (Jul 13, 2024):

You can try to get some inspiration from https://github.com/Kryptos-FR/markdig.wpf/tree/main/src/Markdig.Wpf/Renderers/Wpf which translates a Markdown document to WPF elements.

@xoofx commented on GitHub (Jul 13, 2024): You can try to get some inspiration from https://github.com/Kryptos-FR/markdig.wpf/tree/main/src/Markdig.Wpf/Renderers/Wpf which translates a Markdown document to WPF elements.
Author
Owner

@jefflomax commented on GitHub (Aug 17, 2024):

I'm interested in this idea also - I have a very primitive one and found this thinking I could use markdig to handle the markdown far better than I have. It I get it good enough I'll open source it.
I found these https://swharden.com/csdv/skiasharp/drawtext-rectangle/ instructions helpful getting lots of the SkiaSharp backend working.

@jefflomax commented on GitHub (Aug 17, 2024): I'm interested in this idea also - I have a very primitive one and found this thinking I could use markdig to handle the markdown far better than I have. It I get it good enough I'll open source it. I found these https://swharden.com/csdv/skiasharp/drawtext-rectangle/ instructions helpful getting lots of the SkiaSharp backend working.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#683