From my first project report containing code at school I had the need to create a syntax highlighting tool for OpenOffice.org. These last years I had no time to do it. Even if I don't have more currently, having stopped the Eclipse plugin for OpenOffice.org development gives me a little more time for it.
To implement such a tool, I started from GeSHi, the famous PHP tool for syntax highlightinh. I'm converting the GeSHi algorithm into a Java extension for OpenOffice.org. The only problem is that applying OpenOffice.org styles for the highlighting imposes rethinking some parts of the algorithm. For example:
- GeSHi adds the style for a string before having found its end. In OpenOffice.org I need to get the end of the string before defining its style.
- GeSHi defines the style of the escaped characters first and then finds the end of the string. In OpenOffice.org I first need to get the end of the string to set the string style before setting the escaped characters style.
After some other troubles like these there will be an OpenOffice.org extension to format source code in a clean and easy way. Thus stay tuned...