Jump to content

Geshi Highlighting a line of code.


D4rkH0rse

Recommended Posts

I know it's possible but I can not find out how. I would like to highlight one line of code, for example line 5 in the following snippet.

<?php// De te verwerken code$source = '{printf("hello, worldn");}';// De taal $language = 'c';// Een nieuw object$geshi = new GeSHi($source, $language);// Gebruik lijnnummering en startnummer.$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);$geshi->start_line_numbers_at(4);// Schrijf naar het beeldschermecho $geshi->parse_code();?>	

Does any of you know a trick how to do this?

Link to comment
Share on other sites

I could find out if its possible. But what I would be doing, essentially, is searching Google to find out what Geshi is, and then reading through Geshi's documentation to see what functions it has. If the documentation isn't clear enough I would search for "geshi highlight line" in Google and it probably will bring a few search results from stackoverflow.

 

If none of these procedures provided a way to do it, then I could be reasonably certain it can't be done.

 

These are all things you're capable of doing, so try it out. If you tried and had no luck I can then repeat the procedure myself to see if I get different results.

Link to comment
Share on other sites

I decided to search for the documentation on Google. Here's something I found about highlighting lines: http://milianw.de/files/geshi-doc.html#specifying-lines-to-highlight-extra

 

It seems to add the class "ln-extra" to the line, so you could choose to manually style that class in your stylesheet.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...