Code Highlighter

223 113

This extension highlights the code snippets over 350 languages in LibreOffice.

Project Description

To highlight a code snippet, follow these steps:

  1. Insert a new Text Box (Insert -> Text Box)
  2. Copy and paste/write your code snippet into the text box (You can choose any fonts based on your preference)
  3. Select the text box
  4. Go to Tools -> Highlight Code -> <Language of the code>

That's it. Your code should be colored based on the syntax.

I have tested only a few languages. If you find any bugs, please report them at GiHub Issues.

Note: This extension uses pygments to color the code. Pygments does not highlight some languages properly. Therefore, you may not get the best outcome for some languages. Sorry for the inconvenience.

 

Requirements (Close all LibreOffice products before installing these dependencies):

  • Python 3
  • python3-pygments
  • libreoffice-script-provider-python (May be optional)

Ubuntu and its derivatives users can install the dependencies using the following commands:

sudo apt-get install libreoffice-script-provider-python
sudo pip3 install pygments


Windows users can install the dependencies using the following commands:

pip3 install pygments

Windows requires the environment variable: PYTHONPATH pointing to: C:\Users\<UserName>\AppData\Local\Programs\Python\Python<PythonVersion>\Lib\site-packages

Category/Categories

Writer Extension, Calc Extension, Impress Extension

Homepage of the Project

https://github.com/slgobinath/libreoffice-code-highlighter

Logo

Current Release

Code Highlighter - 1.1

Released May 18, 2017 — tested with:

LibreOffice 4.0, LibreOffice 4.1, LibreOffice 4.2, LibreOffice 4.3, LibreOffice 4.4, LibreOffice 5.0, LibreOffice 5.1, LibreOffice 5.2, LibreOffice 5.3,

Fixed error when coloring Yaml
More about this release…

codehighlighter.oxt
Linux
Linux-x64
File size: 19 kb

All Releases

Version

Released

Platform(s)

Compatibility

Description

License(s)

Status

1.1

May 18, 2017
  • Linux
  • Linux-x64
  • LibreOffice 4.0
  • LibreOffice 4.1
  • LibreOffice 4.2
  • LibreOffice 4.3
  • LibreOffice 4.4
  • LibreOffice 5.0
  • LibreOffice 5.1
  • LibreOffice 5.2
  • LibreOffice 5.3
Fixed error when coloring Yaml
  • GNU-GPL-v3 (General Public License Version 3)
final

1.0

May 02, 2017
  • Linux
  • Linux-x64
  • LibreOffice 4.0
  • LibreOffice 4.1
  • LibreOffice 4.2
  • LibreOffice 4.3
  • LibreOffice 4.4
  • LibreOffice 5.0
  • LibreOffice 5.1
  • LibreOffice 5.2
  • LibreOffice 5.3
Code Highlighter 1.0 379 Languages Tested with LO 5.3.2.2
  • GNU-GPL-v3 (General Public License Version 3)
final

Legal Disclaimer and Limitations for Downloads

The Document Foundation has not reviewed, and cannot review, all of the material, including computer software, available on or by means of The Document Foundation's
websites, and cannot therefore be responsible for that material's content, use or effects. By operating its websites, The Document Foundation does not represent or imply that it endorses the material there available, or that it believes such material to be accurate, useful or nonharmful. You are responsible for taking precautions as necessary to protect yourself and your computer systems from viruses, worms, Trojan horses and other harmful or destructive content. The Document Foundation's websites may contain content that is offensive, indecent or otherwise objectionable, as well as content containing technical inaccuracies, typographical mistakes and other errors. The Document Foundation's websites may also contain material that violates the privacy or publicity rights, or infringes the proprietary rights, of third parties, or the downloading, copying or use of which is subject to additional terms and conditions, stated or unstated. The Document Foundation disclaims any responsibility for any harm resulting from the use by The Document Foundation's visitors of The Document Foundation's websites, or from any downloading by those visitors of content available on or by means of The Document Foundation's websites.

Changes

Content contained on The Document Foundation's websites, including these Legal Disclaimers and Limitations, may be changed at the sole discretion of The Document Foundation and without notice. You are bound by any such updates or changes, and so should periodically review these Legal Disclaimers and Limitations.

If you believe any file is present on the site contrary to any TDF rule or applicable law, please supply full details to info@documentfoundation.org for impartial consideration.