mini-format-pack
mini-format-pack copied to clipboard
Allow users to specify a custom class to add to generated HTML elements
It would be neat for users to be able to create custom buttons that both create an HTML element and equip it with a predefined CSS class. Coupled to Anki's templatting system, this would grant advanced users a very powerful tool to customize their card formatting.
Implementation specs:
- expand the add-on configuration with an additional action key that allows users to specify a CSS class for a button
- add a function that's capable of applying/removing that CSS class on selected text
- hook everything up, so that clicking on a button with a CSS class set does the following:
- if formatting in question present: Remove formatting and CSS class
- if formatting in question not present: Apply formatting and CSS class