D4rkH0rse Posted December 8, 2014 Share Posted December 8, 2014 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 More sharing options...
Ingolme Posted December 8, 2014 Share Posted December 8, 2014 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 More sharing options...
D4rkH0rse Posted December 8, 2014 Author Share Posted December 8, 2014 The problem is that a google search results in mostly matrial on how to do it when you are using it as a plugin for WP or Joomla. Link to comment Share on other sites More sharing options...
Ingolme Posted December 8, 2014 Share Posted December 8, 2014 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 More sharing options...
D4rkH0rse Posted December 8, 2014 Author Share Posted December 8, 2014 I must be an idiot for having missed that. I read through the documentation earlier and didn't noticed it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now