Thursday, July 17, 2008

GNU Source-Highlight 2.10

Here's the new release of GNU Source-Highlight.

From the architectural point of view, I completely re-written the engine that uses regular expression, since it is now oriented towards a library (I'll try to extract a library from source-highlight as soon as possible, in order to provide, e.g., highlighting functionalities to qt text editors without the need to implement the qt highlighter yourself).

Here's the complete list of changes:

Version 2.10

* formatting is applied even when generating anchors and references
* noref is handled also for output languages using onestyle (e.g., xhtml)
* improved fortran highlighting
* improved python highlighting
* fixed title in docbook output
* language definition for ldap files (e.g., ldiff files)
* language definition for autoconf files
* improved m4 language definition
* improved logtalk language definition
* url.lang handles ~ in urls
* language definition for glsl.lang (provided by Cesare Tirabassi)

There are some new languages that are highlighted, in the following you will see some examples:

autoconf:


dnl this is only for developers who use double dispatch
dnl doublecpp can be found at http://www.lorenzobettini.it/software/doublecpp
AC_PATH_PROGS(DOUBLECPP, doublecpp)
AM_CONDITIONAL(NO_DOUBLECPP, test -z "$ac_cv_path_DOUBLECPP" )

dnl this is for testing purpose and development
AC_PATH_PROGS(VALGRIND, valgrind)

dnl this is only for developers who use change command line options
AC_PATH_PROGS(HELP2MAN, help2man)
AM_CONDITIONAL(NO_HELP2MAN, test -z "$ac_cv_path_HELP2MAN" )

dnl this is for generating references
AC_PATH_PROGS(CTAGS, ctags exuberant-ctags)
if test -n "$ac_cv_path_CTAGS"; then
AC_CTAGS_FLAGS
AM_CONDITIONAL(NO_CTAGS, test "$ac_ctags_flags" = "no" )
else
AM_CONDITIONAL(NO_CTAGS, test -z "$ac_cv_path_CTAGS" )
fi

ldiff:

# comment line

dn: cn=Foo Bar,mail=foo@bar.com
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: mozillaAbPersonAlpha
givenName: Foo
sn: Bar
cn: Foo Bar
mozillaNickname: albe
mail: foo@bar.com
modifytimestamp: 0Z
my_odifytimestamp: 0Z

glsl:

#version 120
#pragma optimize off
#pragma debug on

uniform vec4 vSkyParams;
varying ivec4 vpos, lpos;
varying bvec2 wave0, wave1, wave2;
const float lambda = 2.0;

void main(void)
{
// Texture coordinates generation
vec2 vTexCoords = gl_Vertex.xz*vSkyParams.z;

// Scale texture coordinates to get mix of low/high frequency details
wave0 = vTexCoords * lambda + vSkyParams.w * vec2( 0.5, 1.0 );

// Perspective corrected projection
gl_Position = ftransform();
vpos = gl_Vertex;
lpos = gl_LightSource[0].position;

// Compute normal (assumes this is a sphere)
vec3 norm = normalize(vpos).xyz;

//Compute sun light
vec4 sunlight = vec4(pow( max(0.0, dot(light,norm)), 1024.0 ));

// Get bump layers
vec3 vBumpTexA = texture2D(BumpMap, wave0).xyz;

//Add an horizon haze
float haze = pow(gl_FragCoord.z*(1.0-norm.y), 10.0);
skyColor = mix( grey, skyColor, haze );

gl_FragColor = skyColor + vSkyParams.x*sunlight;
}

4 comments:

Anonymous said...

Can we get a windows exe for 2.10 posted somewhere?

thanks a million for writing this sw..

betto said...

Hi
happy you like source-highlight :-)

here you can find windows binaries:

http://www.lorenzobettini.it/software/source-highlight/

these are NOT official binaries, but just binaries created by me.

Anonymous said...

Thanks a lot! In our environment, unfortunately the unix style make files dont work :(..

betto said...

mh... that's quite strange: the configure script should be able to generate Makefiles that are handled by all makes...

If you have time could you please send me (privately) the output of configure and of the errors generated by your make?