Depending on the diagram format, you may be able to render with Kroki, then embed the resulting image within the rendered page.
Depending on the diagram format, you may be able to render with Kroki, then embed the resulting image within the rendered page.