Desired Feature: Math & UML
I would really like a simple way to write down Math and UML. There are enough libaries which support Markdown and WYSIWYG (at least Math, not sure about UML). Also if Math is going to be included please don't forget an easy way to paste special symbols.
For the UML part, do you mean something like this?
Yes, exactly. Both seem to give enough options to explain a process visually.
For the math part of your feature request would https://www.mathjax.org/ suffice?
For Mathjax, here the MD / TinyMCE implementation:
+1 for Mermaid!
@ssddanbrown could this be a v0.27.0 target? 馃檹
I also would appreciate this very much :)
Mermaid is available in Gitlab and is easy to use.聽It would be great to have this feature in Bookstack as well.
+1 :)
+1 mermaid looks super dope
+1 for Mermaid features :)
For the math side of this might I recommend KaTeX https://katex.org/ instead of mathjax -- it's significantly faster and has no dependencies. I've had partial success in fact simply adding the required javascript include to the customer header section of bookstack. The problem comes when attempting to bind the auto-rendering to a javascript event as it seems to break the image insertion as described in #1588
Another +1 from me. Having embedded UML support via Mermaid or PlantUML instead of having to render it locally and upload would be a great feature!
+1 for Mathjax or KaTeX
Another +1 from me. Having embedded UML support via Mermaid or PlantUML instead of having to render it locally and upload would be a great feature!
The included draw.io has support for PlantUML
+1 Seriously need this support. A lot of stuffs cannot be written well without math equations.
I'll probably consider Math as part of the "Editor Alignment & Review" on the roadmap.
If you need something to get by for now, it is possible to insert math via the draw.io integration as described in my comment here:
https://github.com/BookStackApp/BookStack/issues/639#issuecomment-597112337
For markdown editor users, markdown is converted to HTML on the front-end using markdown-it. Looks like there's a few math based markdown-it plugins out there. We fire some events for the editors for people to "hook" into. Details of this can be found here:
https://www.bookstackapp.com/docs/admin/hacking-bookstack/#bookstack-editor-events
You may be able to use a plugin and the above editor hooks to implement this for your own system. An example of doing this for a different markdown-it plugin can be seen here:
https://github.com/BookStackApp/BookStack/issues/1671#issuecomment-607480496
Note, any custmomizations like this are out-of-support so could get broken in future updates.
So I have been successful in adding KaTeX rendering with just a simple addition to the custom header. This code snippet works only on the main content of an entry so it won't work in the editor or in page titles etc. I did that on purpose because the KaTeX auto-render plugin has some unintended effects when run on the parts of the DOM that include the add-image icon in the editor.
I'm no javscript expert -- feel free to suggest changes, I just couldn't stand not having math in my wiki pages.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"></script>
<script>
var katexRenderFilter = function katexRenderFilter () {
var content = document.body.getElementsByClassName("page-content");
if (content.length > 0) {
renderMathInElement(content[0],
{
delimiters:
[
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
{left: "\\(", right: "\\)", display: false},
{left: "\\[", right: "\\]", display: true}
]
}
);
}
}
document.addEventListener("DOMContentLoaded", katexRenderFilter);
</script>
The process of writing math would be a lot easier I think if we included the "preview" plugin for the tinyMCE GUI editor, I haven't gotten around to re-building the assets for bookstack to include that plugin though. So as of now you have to write the math in latex, and save the page to get it to render. The primary problem with just enabling it in editor is if you enable it then proceed to save the rendered math you get issues in the finished page. So either we need a button to "un-render" the math before the save or the preview function. Maybe a good use of the the new editor hooks?
+1 I would _really_ appreciate this feature. Right now I'm resorting to writing an equation and taking a screenshot of it.
+1 this would make bookstack an even better contender to confluence for example! the work around with draw.io, just isnt great ...
Just had a quick review/think about this, Putting down some thoughts so I don't forget them:
Would be nice if we could get some content like drawio from: https://www.mathcha.io. I do not think they are opensource though so that would be a problem, maybe you could get some ideas from it.
Some other nice graphical things would be:
But tbh. only a little bit of latex like it is in most markdown processors would be enough for me.
Just noticed that the embedded draw.io app now features math support, even in the bookstack demo. It's under extra's -> mathematical typesetting. It's mathjax and works great:
_"Not available in offline versions of draw.io"_, not sure how that would impact bookstack.
Not available offline is incorrect. Previously, draw didn't have a way to generate client-side PNG if Math was included, but now does.
+1 this would be an amazing feature
Mermaid or PlantUML is very amazing in Markdown editor +1
Most helpful comment
+1 for Mermaid!