QSource-Highlight
by Lorenzo BettiniQSource-Highlight is a Qt4 front-end for GNU Source-Highlight, http://www.gnu.org/software/src-highlite.
QSource-Highlight uses the library included in GNU Source-Highlight, since version 3, thus you need that library to build QSource-Highlight; in particular it uses Source-Highlight-Qt additional library, http://srchiliteqt.sourceforge.net, which provides highlighting in Qt relying on GNU Source-Highlight. Thus, you need to install Source-Highlight-Qt as well. we refer to GNU Source-Highlight's and Source-Highlight-Qt's websites for further information about the library and its installation (you may want to check whether your distribution already provides packages for these two libraries).
QSource-Highlight is free and open source GPL software.
You can highlight your code on the fly, and have the highlighted output in all the formats supported by source-highlight (e.g., HTML, LaTeX, Texinfo, etc.). You can then copy the formatted output and paste it (e.g., in your blog), or save it to a file.A preview of the highlighted output is available for some output formats (e.g., HTML, XHTML, etc.).
The language definition file is automatically selected according to the input file extension, but you can change it manually by using the corresponding combo box. In particular you have three combo boxes:
- the combo box for the input language definition (e.g., C, C++, Java, etc.); in particular, the combo box refers to the .lang files of Source-Highlight, which, however, should have quite intuitive names.
- the combo box for the output format (e.g., HTML, LaTeX, etc.); in particular, the combo box refers to the .outlang files of Source-Highlight, which, however, should have quite intuitive names (e.g., htmltable.outlang generates HTML output into an html table).
- the combo box for the highlighting style (e.g., colors, and formats of the elements of the language); these elements refer to Source-Highlight .style files and to .css files.
All the files named in these combo boxes refer to files shipped with Source-highlight, and they are searched for in the Source-highlight corresponding installation path. In case the combo boxes are empty, then the path where source-highlight searches for these files is wrong: you should then configure the correct path for source-highlight using the settings dialog (Source-Highlight Settings).
The complete documentation is available here.
Download
Sources and binaries (when available) can be downloaded from http://sourceforge.net/projects/qsrchilite/files/.
You can also get the source code via git (this way you will also access the latest version - probably the one in development stage, and not yet released):
git clone git://qsrchilite.git.sourceforge.net/gitroot/qsrchilite/qsrchilite
and you can also browse the repository at http://qsrchilite.git.sourceforge.net.
Installation
We suggest to create a build directory, cd to that directory and then run qmake accordingly
qmake -recursive ../qsource-highlight.pro
and then run make; the binary will be created in the bin directory.
Once the building has sucessfully finished, you can install the files with the command make install; binaries will be installed into /bin and documentation (the one readable with qt assistant) into /share/doc/qsource-highlight and html documentation into /share/doc/qsource-highlight/html. You can customize the root of the installation directory with the environment variable INSTALL_ROOT; for instance,
INSTALL_ROOT=$HOME/usr/local make install
You might need to become root if you install in a path different from your home.
The qmake project of QSource-Highlight uses pkg-config, http://pkg-config.freedesktop.org to detect the library Source-Highlight-Qt (and implicitly also the GNU Source-Highlight library). If the library is installed in a standard system path (e.g., /usr) running qmake should be enough; otherwise you should tell pkg-config, through the environment variable PKG_CONFIG_PATH, where to find the .pc file of source-highlight-qt4 (source-highlight-qt4.pc; note that this file will also contain the references to GNU Source-highlight library and headers, so you won't have to worry about that). For instance, if you've installed source-highlight-qt4 using the prefix ~/usr/local, the .pc file will be installed into ~/usr/local/lib/pkgconfig, thus you should run qmake as follows:
PKG_CONFIG_PATH=~/usr/local/lib/pkgconfig qmake -recursive ../qsource-highlight.pro
If pkg-config is not installed in your system, you'll have to specify the LIBS and INCLUDEPATH qmake variables manually (e.g., by modifying the .pro file), using the correct path, for instance:
LIBS += -L~/usr/local/lib -lsource-highlight-qt4
INCLUDEPATH = ~/usr/local/include
License
qsource-highlight is Open Source, under the GPL license.
News :
2009-11-15: release 0.2:
- documentation is already provided (no need to build it)
- install also html documentation.
- save as is always enabled
- open style implemented
- source-highlight settings dialog initialized with a non empty value
2009-09-26: This is the first release of qsource-highlight.