Turns out in all my experimentation I couldn't use just plain javascript to add to the TinyMCE options. It appears that it needs to be done upon loading to modify the UI.
That is basically what I am saying. Just keep in mind, this is Confluence, so there are many parts of the menu you just don't have access to, or are not documented. So be prepared for some experimentation!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've been wondering if I can do it with the TinyMCE API and just add javascript to the Confluence theme.
https://www.tinymce.com/docs/api/tinymce/tinymce.formatter/
This really shouldn't be so complicated. And macros that format text in-line in the TinyMCE editor should also be easier to build.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Possible? Yes. Easy? No. Confluence uses a version of TinyMCE, so it is possible to write a plugin for TinyMCE to add styles (basically adding references to classed HTML tags). The second part of the solution is easy – adding custom CSS to Confluence.
The workaround is user macros. Not as elegant, but does get the job done. For example, I wrote some simple user macros years ago we use for formatting figure and table titles in Confluence (and when exported) – a hole that has been in Confluence since the start.
Keep in mind, that the editor was designed by coders and not tech writers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did anyone ever try writing a plugin to add styles? Did it work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.