You are here: Home / Extensions / Code Colorizer Formatter

Code Colorizer Formatter

Colorize Basic, C++, Java, Perl, Python, R, XML, C#, 8085 Assembler, and x86 Assembler.

Project Description

Colorize Basic, C++, Java, Perl, Python, R, 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.

Self-Certification

[X] Internationalized

[ ] 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

Current Release
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…

Download file Get Code Colorizer Formatter for All platforms
MacroFormatterADP_3_0_4.oxt
Download file Get Code Colorizer Formatter for All platforms
MacroFormatterADP_3_0_4.tar
If you don't know, how to install an extension in LibreOffice, see our howto about installing extension for detailed instructions.

All Releases

Version Released Description Compatibility Licenses Status
3.04 Jun 02, 2014 Added PHP and SQL support. Added a few new C++ keywords. More about this release…
LibreOffice 4.2
Public Domain final
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…
LibreOffice 3.3
LibreOffice 3.4
Public Domain final
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…
LibreOffice 3.4
Public Domain final
Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!


Legal Disclaimers and Limitations | Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0. License. This does not include the source code of LibreOffice, which is licensed under the GNU Lesser General Public License ( LGPL v.3 ).

"LibreOffice" and "The Document Foundation" are registered trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.