MakeCode provides a lightweight blocks rendering engine that renders code snippets as SVG images.
The Curse of screenshots
Unlike text based programming languages, block-based snippets aren't easily rendered in a documentation page. A quick solution is take screenshots of the snippets but things can quickly become unsustainable:
- screenshots can't be compiled - so it's hard to maintain them
- screenshots are not localizable - non-English speaking users won't be able to read the blocks
- screenshots aren't easily reloaded into the editor
- screenshots don't play well with source control systems - you cannot diff changes efficiently
Rendering blocks on the spot
Here are some sample integrations for various documentation/blogging engines.
You can find example of custom blocks embedding in the documentation of your favorite editor.