Skip to content

A Godot addon that brings BBCode completion and QOL tools to the script editor in order to help formatting documentation comments.

License

Notifications You must be signed in to change notification settings

xorblo-doitus/BBCodeEdit

Repository files navigation

BBCodeEdit (for script editor1)

alt text

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)

Showcase

There are shortcuts to easily toggle some formattings:

Using the keyboard to toggle bold, italic, underline, striketrough

Completion for formatting tags, with some special completions implemented for specific tags:

Advanced completion for color tag

Documentation references are completed:

Reference completion

Some useful snippets are included:

A "Note" snippet, with the same formatting as the one used in the official documentation

Features / Roadmap

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.
  • 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 in Project → 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 unbound alt + S from open shader editor, it will be alt + S)
    • underline (alt + U)
    • Wrap in any tag?
  • Add an external CodeEdit in the editor to write bbcode, because completion inside strings is a nightmare due to builtin behaviors.1

Intallation

You can download the addon:

  • On GitHub: CodeDownload 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 version

Godot 4.3 (May work with previous 4.x versions)

Development Status

Development halted. But the addon is really handy as-is.

Footnotes

  1. 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

About

A Godot addon that brings BBCode completion and QOL tools to the script editor in order to help formatting documentation comments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published