Code Colorizer Formatter
Colorize BASH, Basic, C++, Java, Perl, PHP, Python, R, SQL, XML, C#, 8085 Assembler, and x86 Assembler.
Colorize Bash, Basic, C++, Java, Perl, PHP, Python, R, SQL, XML, C#, 8085 Assembler, and x86 Assembler.
A simple parser is used to identify elements in the supported languages; for example, keywords, literals, comments, and operators. Each element type is set to use a specific character style. The style sets the color used for that portion. In BASIC, the colors resemble those used by the Basic IDE. This allows for "pretty" code fragments in a Writer document.
Menu options exist to "colorize" selected text in the specified language.
I format my code snippets using paragraph styles. I place the cursor in the code snippet and then use Tools > Addons > MacroFormatterADP > Colorize Basic to colorize the current paragraph and all adjacent paragraphs that use a paragraph style that identifies the paragraph as code. The currently supported paragraph styles are "_OOoComputerCode", "_OOoComputerCodeInTable", "_OOoComputerCodeLastLine", "_code", "_code_first_line", "_code_last_line", and "_code_one_line".
It is up to the user to make sure code is formatted using a paragraph style with one of the supported names. Note that my macro documents contain these styles, and, they can be created in the current document using Tools > Addons > MacroFormatterADP > Create Paragraph Styles. When a paragraph style is created, it must have a next paragraph style. Some of the styles assume that the next paragraph style is a code type; for example, _OOoComputerCode style assumes that the next paragraph style is _OOoComputerCode. OOoComputerCodeLastLine, however, assumes that the next paragraph style is OOoTextBody. This is used when the paragraph styles are created. Use Tools > Addons > MacroFormatterADP > Configure to set the Font name, the next paragraph style, text size, and where tab stops should be set.
I attempted to configure appropriate localizations for English, French, German, Spanish, Russian, and Japanese. I have no abilities in some of these languages, so, feel free to provide corrections.
[ ] Unit tests
[ ] End-user documentation
[ ] Internal documentation (documentation, interfaces, etc.)
[X] Existed and maintained for at least 6 months
[X] Installs and uninstalls cleanly
[ ] Code structure follows best practice
Code Colorizer Formatter 3.04
Released Jun 02, 2014 — tested with LibreOffice 4.2
Added PHP and SQL support. Added a few new C++ keywords.
More about this release…
|3.1.1||Feb 27, 2015||This release adds support for BASH. More about this release…||
|3.04||Jun 02, 2014||Added PHP and SQL support. Added a few new C++ keywords. More about this release…||
|3.0.1||Dec 01, 2011||Added menu options to support 8085 and x86 Assembler. Recognize more registers and assembler directives. Fixed a assembler directives that contained an extra space in the name. More about this release…||
|3.0.0||Nov 30, 2011||First release for LibreOffice. Added support for 8085 Assembler and x86 assembler. This capability is available from the macro menus (as in you must run them manually) and I have not yet added them to the menus. More about this release…||