Colourised bbcode in a text editor
Posted: Thu Apr 16, 2026 5:40 pm
When I write long things for the forums with a lot of styling or other reasons for bbcode tags, I use a text editor called Kate made by KDE. This works in Windows, Linux and MacOS.
To make the editing more readable, I have a tool that highlights and colourises the actual code, making it clearly separate from the text. For example, here is what it looks like in the file of the biography of my gnome character Uranhed:
I figured I might offer this to others making such posts as well. You can download Kate itself from the link above, and then install it as normal.
Make sure to start and close Kate once to set up all the paths.
Then you need this XML-file:
bbcode.xml
This needs to be placed in the following folder (make the folder if it doesn't exist):
I don't use MacOS, so I'm not 100% sure where it goes there, but given that MacOS is a UNIX-based system, it isn't entirely out of the question that it's in the same path as in Linux.
Then start Kate, make a new document (or open an existing one) and go here:
Now your bbcode should be colourised the same way as mine. It won't colourise absolutely every tag, as I haven't added all the custom ones we have, but it's easy to add more tags to the XML.
You can also open the bbcode.xml and change the colour hexcodes if you want different colours on these lines:
As an aside, Kate has a lot of other utilities I use, like Replace All (say you want to replace all color=#ff0000 with color=#0000ff, for example, or Find In All Open Documents (like some people use Textcrawler) to scour through logs for example.
To make the editing more readable, I have a tool that highlights and colourises the actual code, making it clearly separate from the text. For example, here is what it looks like in the file of the biography of my gnome character Uranhed:
I figured I might offer this to others making such posts as well. You can download Kate itself from the link above, and then install it as normal.
Make sure to start and close Kate once to set up all the paths.
Then you need this XML-file:
bbcode.xml
This needs to be placed in the following folder (make the folder if it doesn't exist):
- Linux: ~/.local/share/org.kde.syntax-highlighting/syntax/
- Windows: %localappdata%\org.kde.syntax-highlighting\syntax\
I don't use MacOS, so I'm not 100% sure where it goes there, but given that MacOS is a UNIX-based system, it isn't entirely out of the question that it's in the same path as in Linux.
Then start Kate, make a new document (or open an existing one) and go here:
Now your bbcode should be colourised the same way as mine. It won't colourise absolutely every tag, as I haven't added all the custom ones we have, but it's easy to add more tags to the XML.
You can also open the bbcode.xml and change the colour hexcodes if you want different colours on these lines:
Code: Select all
<itemData name="Tag" defStyleNum="dsKeyword" color="#00ff88" bold="true"/>
<itemData name="Attribute" defStyleNum="dsString" color="#ffcc00"/>
