[PR #5630] [CLOSED] Added a new setting to configure Mermaid JS version to use #6536

Closed
opened 2026-02-05 10:34:55 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5630
Author: @AstonishingStone
Created: 5/28/2025
Status: Closed

Base: developmentHead: feature/plugin/mermaid


📝 Commits (1)

  • a4a2f03 Added a new setting to configure mermaid version

📊 Changes

13 files changed (+446 additions, -15 deletions)

View changed files

📝 app/Config/setting-defaults.php (+1 -0)
app/Plugins/MermaidProvider.php (+63 -0)
app/Settings/Plugins/MermaidController.php (+57 -0)
📝 lang/en/settings.php (+2 -0)
resources/views/exports/parts/mermaid-js.blade.php (+24 -0)
📝 resources/views/layouts/base.blade.php (+3 -0)
📝 resources/views/layouts/export.blade.php (+2 -0)
resources/views/layouts/parts/mermaid-js.blade.php (+25 -0)
📝 resources/views/layouts/plain.blade.php (+3 -0)
📝 resources/views/settings/categories/customization.blade.php (+83 -1)
📝 routes/web.php (+16 -14)
tests/MermaidHeaderTest.php (+56 -0)
tests/Plugins/MermaidProviderTest.php (+111 -0)

📄 Description

Hi,

This is a modest PR to implement Mermaid JS into BookStack.
I took various recommendations into account — you can now select which version of Mermaid JS you'd like to use in your BookStack instance. It supports both Markdown and WYSIWYG editors. Mermaid JS can be activated in the settings of BookStack, in the Customization category.

When a Mermaid JS version is selected, the corresponding file is downloaded and stored on the BookStack instance server. It is then linked in the page header, similar to how custom header settings work.

Versions are fetched from the Mermaid JS GitHub repository, and the files are pulled from https://cdn.jsdelivr.net/.

Rendering is handled client-side.

I'm open to any feedback, recommendations, or suggestions.

I didn’t go into much detail here, but this should cover the basic requests others have made so far.

Page result
Page result

Markdown page editor
Markdown

WYSISWYG page editor
WYSISWYG

Settings selection
Settings


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5630 **Author:** [@AstonishingStone](https://github.com/AstonishingStone) **Created:** 5/28/2025 **Status:** ❌ Closed **Base:** `development` ← **Head:** `feature/plugin/mermaid` --- ### 📝 Commits (1) - [`a4a2f03`](https://github.com/BookStackApp/BookStack/commit/a4a2f03ae4fa7e008334be94a4969c3cde879473) Added a new setting to configure mermaid version ### 📊 Changes **13 files changed** (+446 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `app/Config/setting-defaults.php` (+1 -0) ➕ `app/Plugins/MermaidProvider.php` (+63 -0) ➕ `app/Settings/Plugins/MermaidController.php` (+57 -0) 📝 `lang/en/settings.php` (+2 -0) ➕ `resources/views/exports/parts/mermaid-js.blade.php` (+24 -0) 📝 `resources/views/layouts/base.blade.php` (+3 -0) 📝 `resources/views/layouts/export.blade.php` (+2 -0) ➕ `resources/views/layouts/parts/mermaid-js.blade.php` (+25 -0) 📝 `resources/views/layouts/plain.blade.php` (+3 -0) 📝 `resources/views/settings/categories/customization.blade.php` (+83 -1) 📝 `routes/web.php` (+16 -14) ➕ `tests/MermaidHeaderTest.php` (+56 -0) ➕ `tests/Plugins/MermaidProviderTest.php` (+111 -0) </details> ### 📄 Description Hi, This is a modest PR to implement Mermaid JS into BookStack. I took various recommendations into account — you can now select which version of Mermaid JS you'd like to use in your BookStack instance. It supports both Markdown and WYSIWYG editors. Mermaid JS can be activated in the settings of BookStack, in the Customization category. When a Mermaid JS version is selected, the corresponding file is downloaded and stored on the BookStack instance server. It is then linked in the page header, similar to how custom header settings work. Versions are fetched from the [Mermaid JS GitHub repository](https://github.com/mermaid-js/mermaid), and the files are pulled from https://cdn.jsdelivr.net/. Rendering is handled client-side. I'm open to any feedback, recommendations, or suggestions. I didn’t go into much detail here, but this should cover the basic requests others have made so far. Page result ![Page result](https://github.com/user-attachments/assets/5f78bf64-fb68-455a-a351-24e5b7607252) Markdown page editor ![Markdown](https://github.com/user-attachments/assets/1417b6fe-32cf-4632-85cd-e16053d8b6a0) WYSISWYG page editor ![WYSISWYG](https://github.com/user-attachments/assets/93d7829a-5b8d-4371-9a10-ed87a6f23638) Settings selection ![Settings](https://github.com/user-attachments/assets/a240feec-2fa0-4eef-9ae8-fe37f646d1b3) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:34:55 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6536