Skip to content

Added a new setting to configure Mermaid JS version to use #5630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

AstonishingStone
Copy link

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

@ssddanbrown
Copy link
Member

Thanks for offering this @AstonishingStone but, like with most feature requests, the lack of inclusion so far has not been due to lack of creating a working implementation.

My main concerns as listed in #495 (comment) are still relevant to today.
Specifically, the largest concerns are relying on a specific custom syntax and non-web standard format, and also the issue of this being content which relies on JavaScript and additional libraries for expected display.
This is while we already have a diagram solution provided (via our diagrams.net integration) which suits our intended audience.

Due to those concerns, I'm not keen on adding official support in general, and prefer to leave implementations to use customization options where possible which would better indicate these issues which don't align with our focuses/goals for the core supported project, and therefore ensure they're considered in use.

@AstonishingStone
Copy link
Author

Hi,

Thanks for taking time to respond to this pull request. Thank you as well to highlight your concerns, I actually linked this PR in the very same issue your comment came from.

It seems that you have make up your mind on this topic and don't want to implement this in BookStack - fine by me, your project, your rules.

If I am allowed to chime this in, I do believe your intended audience evolved since the comment you linked. After all, mermaid had time to become more mature and BookStack got used by more people and organizations, with various different needs.

Many people as requested text-based diagram creation in the markdown editor and never got a definitive answer - see the two issues I linked. I guess this Pull Request close the topics whatever or not Mermaid or a similar alternative will be implemented into BookStack any time soon / ever.

Thank you for creating BookStack, sadly for me, I don't fit in your intended audience.

@rolflobker
Copy link

Hi,

Thanks for taking time to respond to this pull request. Thank you as well to highlight your concerns, I actually linked this PR in the very same issue your comment came from.

It seems that you have make up your mind on this topic and don't want to implement this in BookStack - fine by me, your project, your rules.

If I am allowed to chime this in, I do believe your intended audience evolved since the comment you linked. After all, mermaid had time to become more mature and BookStack got used by more people and organizations, with various different needs.

Many people as requested text-based diagram creation in the markdown editor and never got a definitive answer - see the two issues I linked. I guess this Pull Request close the topics whatever or not Mermaid or a similar alternative will be implemented into BookStack any time soon / ever.

Thank you for creating BookStack, sadly for me, I don't fit in your intended audience.

So sad to see this!

Company I work for made up their mind that they want Bookstack. Not something I agree with but often people think they need product X instead of looking at the actual need.

Plain Markdown (with git versioning and remote) is so much better than Bookstack. Works for me in Vim, works for other in Emacs, Sublime, Vscode, whatever. Looks very nice in Gitlab/Gitlab and is very compliant and portable.

To satisfy the desire to use Bookstack I have written a script which takes are regular folder structure with markdown files, create shelves, books and pages and also scans for images which it uploads en replaces the links with.

On several occasions I had to write .. "crap, does not work in Bookstack" , "blegh, not supported by Bookstack", or "Need this hack to bypass Bookstack crap"

This started with not being able to use markdown files and the webinterface and api being the only way of getting data in, forcing me to write tools to sync a normal folderstructure to Bookstack.

And now a great addition by AstonishingStone who already did most of the work get shots down.

I'm hoping that when I have my setup complete, my colleagues will see that I go through a git repo on Gitlab first, see how great that works and ask: ..... hey, then why do we even need Bookstack?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants