Any example sites? Having a hard time seeing how everything comes together.
ocamlbook.org may be the most illustrative one: it exploits soupault's ability to pipe HTML element content through an external program to automatically type-check code examples in <code> tags with the compiler and also syntax-highlight them with an external tool. The approach would translate to any language without a need for language-specific tools.
The main repository also has directories called 'sample-site' and 'examples': https://github.com/dmbaturin/soupault