site  contact  subhomenews

Highlight: convert code to formatted text

March 08, 2011 — BarryK
I discussed Vim in the previous two blog posts. Vim can be used to convert source code such as BaCon or C or Bash (etc.) to various color-highlighted formats, including HTML:
http://bkhome.org/archive/blog2/201103/vim-73.html
http://bkhome.org/archive/blog2/201103/convert-code-to-html-with-vim.html

The 'Highlight' application was suggested as an alternative that will do the same thing.

I have downloaded the latest version of Highlight and compiled it. The PET package has two binary executables, 'highlight' which is a cli converter, and 'highlight-gui' which is a GUI application that uses the Qt4 library.

Highlight (1.1MB):
http://distro.ibiblio.org/quirky/pet_packages-wary5/highlight-3.3-w5.pet

...this creates an entry in the Document menu.

If you want to use the GUI application then you also need Qt4 (9.0MB):
http://distro.ibiblio.org/quirky/pet_packages-wary5/qt4-4.5.3-1-w5.pet

Highlight project page:
http://www.andre-simon.de/

Comments

geany
Username: jamesbond
For info only: geany can do the same if the "Export" plugin is activated (it's part of the default geany package, if not explicitly disabled when compiling geany, I think). Just use menu Tools-Export-As HTML. cheers!

Re Geany export
Username: BarryK
"Ha ha ha, how about that, I never knew Geany could do that! I just tried it, it works, but of course we don't have a syntax highlighter for BaCon -- but I think that someone is/was working on one.

Tea anyone?
Username: scsijon
"Maybe consider Tea, and I quote the deb site: TEA features are: * Spell checker (using aspell and hunspell) * Tabbed layout engine * Support for multiple encodings * Syntax highlighting * Code snippets and templates support * Wikipedia, Docbook, LaTeX, and Lout editing support * Reading of OpenDocument Text, SWX (old OpenOffice.org format), KWord, AbiWord, DOCX, Scribus, RTF, FB2 * Hotkeys customizations * "Open at cursor"-function for HTML-files and images * Miscalleneous HTML tools * Preview in external browsers * String-handling functions such as sorting, reverse, format killing, trimming, filtering, conversions etc. * Bookmarks * Drag'n'drop support (with text files and pictures) * Built-in image viewer (PNG, JPEG, GIF, WBMP, BMP, SVG) I'm building it at the moment for another, so I shall also puppy it! regards


Tags: wary