| plugin-rolltable.js | faster rolling less flashy | |
| README.md | init | |
rolltable plugin for bookstack
injects a roll-button into tables that indicate they can be rolled with a dice formula like "1d20" in their first header cell (first cell of first row, marked as headline)
the plugin comes as a single file with bundled css and jquery-toast-plugin. jQuery is loaded externally
installation
save plugin-rolltable.js where it is publicly accessible (somewhere on your webserver)
add a script tag to "Custom HTML head content" in your bookstack under /settings/customization, like that:
<script src="/path/to/plugin-rolltable.js?v=0.1"></script>
the v parameter is a cachebuster and can be anything - just remember to change it on updates of the plugin
add a script tag for jQuery, like that:
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
in most cases it doesn't matter if you use the CDN or host it yourself
optional: find the line --plugin-rolltable-text-color: #fff; in plugin-rolltable.js and replace #fff with a color contrasting your --color-primary if #fff doesn't fit your color scheme
jquery-toast-plugin
bundles jquery-toast-plugin. If you've already enabled jquery-toast-plugin in your installation, you may wish to delete everything starting with the line // bundle jquery-toast-plugin from plugin-rolltable.js
v0.1, CC-BY-SA by Thomas Nesges https://nesg.es, 2024