They can cause instability, introduce issues and may conflict with future updates. Apply at your own risk!
WYSIWYG Docx Import
This hack adds the ability to import “.docx” files into the WYSIWYG editor, by dragging and dropping a “docx” file into the editor area. The file contents are converted to HTML then inserted into the editor at the current cursor position.
Conversion is performed browser-side using the mammoth.js library. Warning messages from the conversion will be logged to the browser console, and a popup warning notification will advise of this.
Considerations
- This hack uses an externally hosted library, hosted on
jsdelivr.net
. You could host this locally instead if desired. - The conversion is relatively simplistic, to result in clean HTML for use in BookStack. Not all formatting is supported by the conversion and you’ll likely loose layout or formatting. Don’t expect a replica result in BookStack, this is more for easy importing of existing content.
- Images will be within content, base64 included, until save when BookStack will attempt to extract them out. This may cause editor performance to be particular slow until first save after import.
- You will likely see a “Dropped file type is not supported” warning message pop-up in the editor.
Code
head.html
|
|
Request an Update
Hack not working on the latest version of BookStack?
You can request this hack to be updated & tested for a small one-time fee.
This helps keeps these hacks updated & maintained in a sustainable manner.
Latest Hacks
Tag Values in Page Content via Includes
This hack allows you to dynamically pull in the value of tags into page content, via customizing how page include tags are parsed. This hack will attempt to use tags on the page itself, then look to the parent chapter (if existing), then the parent book’s tags. »
Mermaid Viewer
This hack enables interactive Mermaid diagrams to be rendered within a page on BookStack. The Mermaid diagram code itself can be written & edited using either BookStack’s WYSIWYG editor, by creating a code block and assigning it the language “mermaid”, or via the Markdown editor using standard mermaid code fences like so: »
Interactive Embedded Page Drawings
This hack will, on page view, attempt to convert any drawing images into interactive embedded drawing viewers so that you’ll be able to pan & zoom around the drawings while also being able to interact with things like links within the drawings. »
Dynamic Glossary
This hack adds the ability to write global and book-level glossaries, which will then be utilised when viewing pages by marking those words in page content with a dashed underline. On hover, the set definitions will show in a popup below the word. »