const mermaidViewers = [];
function initializeMermaidViewers() {
- // Adjust the selector if your CMS wraps mermaid code blocks differently
const codeBlocks = document.querySelectorAll('pre code.language-mermaid');
for (const codeBlock of codeBlocks) {
// Ensure we don't re-initialize if this script runs multiple times or content is dynamic
});
});
- // Optional: If your CMS dynamically adds content, you might need a way to re-run initialization
- // For example, using a MutationObserver or a custom event.
- // document.addEventListener('myCMSContentLoaded', () => initializeMermaidViewers());
-
</script>
<style>
/* Use BookStack's CSS variables for seamless theme integration */