BBCodeEdit (for script editor1)
A Godot addon that brings BBCode completion and QOL tools to the script editor in order to help format documentation comments. (May be extended to any CodeEdit in the future.1)
There are shortcuts to easily toggle some formattings:
Completion for formatting tags, with some special completions implemented for specific tags:
Documentation references are completed:
Some useful snippets are included:
Checked items are the implemented ones, unchecked are the ones in development.1
- Code completion for:
- Most used BBCode tags
- All BBCode tags1 (See Godot Reference)
- Documentation comments:
- formatting tags
- referencing tag
-
@
tags:- deprecated
- experimental
- tutorial
- Snippets:
- Note:, Warning:...
- Classify tags accepted in documentation comments according to Godot Reference
- Advanced completions:
- Color:
- Named colors
- Hexadecimal color preview (**Note: ** If it starts with a digit,
0x
will be prefixed temporarily because Godot cancels int completion) - Color picker
- URL of files? (I don't know if file URLs work)
- Documentation comments' references: (NB: Inner classes won't be properly proposed in completions)
- Classes
- Parameters
- Members (aka. Properties)
- Methods (aka. Functions)
- Constants
- Signals
- Enums
- Other references, like annotations or operators, are not implemented because they are rarely used.
- Color:
-
BBCode preview (through SyntaxHighlighter?)
Edit: Won't work because GDSCriptSyntaxHighlighter can't be extended
BBCode spellcheck/semi-preview (through_draw()
?)
Edit 2: Won't implement, because there is easier: - Add a shortcut to open:
- Current file documentation (May have a problem if pressed before the editor checks unsaved status of the file)
- Preview of the selected text (or autodetect start and end if no selection)
- Add shortcuts for:
You can rebind them inProject → Project settings → Input Map
. If you just enabled the addon, they may appear here only after a restart of the editor. You will have to restart the editor for any change to take effect.- bold (
alt + B
) - italic (
alt + I
) -
striketrough(alt + C
, but if you had unboundalt + S
fromopen shader editor
, it will bealt + S
) - underline (
alt + U
) - Wrap in any tag?
- bold (
- Add an external CodeEdit in the editor to write bbcode, because completion inside strings is a nightmare due to builtin behaviors.1
You can download the addon:
- On GitHub:
Code
→Download ZIP
. - Through the editor:
AssetLib
→ Search for "BBCodeEdit"
By default, this readme is included, along with it's illustrations. If you don't want them,
do not download addons/bbcode_edit.editor/README.md
nor addons/bbcode_edit.editor/.assets_for_readme/*
To edit shortcuts, first restart the editor, then modify them, and restart the editor so that Godot updates the input map.
You can also exclude *.editor/*
or bbcode_edit.editor/
from your export presets,
because this addon is (for now1) script-editor-only.
Godot 4.3 (May work with previous 4.x versions)
Development halted. But the addon is really handy as-is.
Footnotes
-
Note: All non-script-editor-related features are on hold for now because I don't have the time nor the need to implement them. This would also require refactoring
bbcode_edit.gd
into two separate classes. One with all RichTextLabel's tags and one with documentation comments' tags. If you really need BBCode completion in a CodeEdit (eg. for an inspector plugin, or for any code edit within an exported project), I may give it a try, or you could contribute this refactor (this repo is under the MIT Licence). ↩ ↩2 ↩3 ↩4 ↩5 ↩6