Gajim Plugin that highlights source code blocks in chat window.
The recommended way of installing this plugin is to use
Gajim's Plugin Installer.
For more information and instruction on how to install plugins manually, please
refer to the Gajim Plugin Wiki.
This plugin uses markdown-style syntax to identify which parts of a message
should be formatted as code in the chat window.
Inline source code will be highlighted when placed in between `two singleback-ticks`.
The language used to highlight the syntax of inline code is selected as the default language in the plugin settings.
Multi-line code blocks are started by three back-ticks followed by a newline.
Optionally, a language can be specified directly after the opening back-ticks and
before the line break:
```languageNote, that the last line of a code block may only contain the closing back-ticks,i.e. there must be a newline here.```
In case no languge is specified with the opening tag or the specified language
could not be identified, the default languge configured in the settings is
You can test it by copying and sending the following text to one of your
```pythondef test(): print("Hello, world!")```
(Note: The contact will not receive highlighted text unless the plugin is installed on their computer as well.)
The configuration can be found via 'Gajim' > 'Plugins', then select the
'Source Code Syntax Highlight' Plugin and click the gears symbol.
The configuration options let you specify many details how code is formatted,
including default language, style, font settings, background color and formatting
of the code markers.
In the configuration window, the current settings are displayed in an
interactive preview panel. This allows you to directly check how code would
look like in the message
Gajim crashes when correcting a message containing highlighted code.
(fixed in version 1.1.0)
Since I had no experience in writing Plugins for Gajim, I used the
written by Yves Fischer and Yann Leboulanger as an example and copied a big
portion of initial code. Therefore, credits go to the authors of the Latex
Plugin for providing an example.
The syntax highlighting itself is done by pygments.