Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
Show line number using geshi
Avatar
justin@kelly.org.au #1
Member since Apr 2007 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: Show line number using geshi
Hi All,

I want to make my code in my wiki pages look all nice with line numbers like ( http://pastie.caboo.se/53238 )

Ive read the geshi docs ( http://qbnz.com/highlighter/geshi-doc.html#line-numbers ) which say adding enable_line_numbers into your code will enable line numbers

Ive added
    $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
into parserutils.php and refreshed my wiki page but no line number show

Anyone know how to add line numbers into the <code></code> sections??

Cheers

Justin
chi #2
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
Hi,

have a look at the code2 plugin [1] it overwrites DokuWikis <code> markup and adds support for line numbers.

Regards

[1] http://wiki.splitbrain.org/plugin:code2
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
justin@kelly.org.au #3
Member since Apr 2007 · 5 posts
Group memberships: Members
Show profile · Link to this post
Thanks Chi,

this plugin is almost perfect, except that as in geshi or http://pastie.caboo.se/53238 when you copy the text the line numbers aren't copied as well

the line numbers are in a separate td to the code - so you can easily copy the contents of just the one table cell

ie
<td>1<br>2<br>3</td><td>my code on first line<br>second line<br>third line</td>

Is there anyway to do that with this plugin?

Cheers

Justin
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-26, 18:18:37 (UTC +02:00)