Implementation of Style Enhancer - Waidanian/style-enhancer GitHub Wiki
Language
In order to reliably target both OpenOffice and LibreOffice, the extension is written in Basic. This has the benefit of allowing development to happen entirely in the office suite, with constant testing on real-life documents.
It would be very nice to use Python 3, but unless OpenOffice eventually bundles Python 3, it does not seem to be the most satisfactory solution.
Using Basic also means that no additional UNO services or components are created; Style Enhancer only uses what is readily available in OpenOffice and LibreOffice and focuses on always using the most high-level and up-to-date methods.
New Regexp engine
There is a big change in OpenOffice 3.4 and LibreOffice 4.0 that goes largely unnoticed but is very important for all future versions: a new regular expression engine from the ICU project, which replaces the old custom regexp engine in both office suites. Regular expressions are an essential tool for many advanced tasks and it is important to build all future extensions around the new engine to ensure forward-compatibility.
Code examples in this Wiki
GitHub’s Markdown supports syntax highlighting for many languages, but not specifically VBA or OpenOffice Basic. However, Visual Basic.Net is supported, so OpenOffice Basic code blocks are marked as VB.Net code, which approximates the desired syntax highlighting. Here is an example, which at the same time shows a very simple but very useful subroutine:
Option Explicit
sub UpdateDocumentLayout()
dim theCurrentDocument as Object
theCurrentDocument = ThisComponent
theCurrentDocument.reFormat
end sub