Creating Python bindings for KSyntaxHighlighter with shiboken
-
I'm building a PySide6 application which needs to have syntax highlighting for Markdown, amongst other languages. Rather than reinvent the wheel with QSyntaxHighlighter, as I'm sure lots of other developers may have had to do, I was hoping to create Python bindings for KSyntaxHighlighter, which is currently written in C++ with Qt and powers the Kate editor. This is a subclass of QSyntaxHighlighter and has support for numerous languages and colour themes.
The source can be found here: https://invent.kde.org/frameworks/syntax-highlighting
With some further documentation here: https://api.kde.org/frameworks/syntax-highlighting/html/index.html
I understand that Shiboken was the tool created by Qt to develop the PySide bindings, and I wondered if this was the best fit to build Python bindings, a standalone Python package that could be used alongside PySide6 to use this syntax highlighter in my project?
Does anyone have any strong experience using Shiboken? I'm going to have a stab at it myself but would appreciate anyone else who would be keen to help. Or any pointers/guidance would be much appreciated.
-
Hi and welcome to devnet,
I would recommend checking with both KDE and the Qt for Python folks. There have been bindings generated earlier using PyQt's sip but I don't think anybody has tried with shiboken.