[dokuwiki] Re: syntax hilighting

Galen Johnson wrote:
Chris Smith wrote:

You shouldn't need to override the classes.  redefine the styles or
define a new set of styles with a greater specificity.  Dokuwiki only
uses the basic geshi classes for its colouring.  However the <code
lang> syntax will apply a lang as a class to the surrounding <pre>
element, allowing you to define your own style selectors as a
decendent of the lang (or even .page or .dokuwiki) and override the
default settings.

Cheers,

Chris

Walk me through an example or point me to the docs,
please. I'd prefer not to disable any other features of dokuwiki but
really need this to work.
The file lib/styles/style.css contains the GeSHi colouring. You can edit the colours there to any dokuwiki code highlighting. If you wish to specify highlighting for a specific code language you would add a style rule of the following type (I have assumed a language of php, any of the languages can be used in the same way).

.code.php .br0 { color: #3333ff; font-weight: bold;}
.code.php .co1 { color: #cc9933; font-decoration: underline; }

etc.

those styles can go in lib/styles/style.css or in your template stylesheet. Making your own template (its enough to just make a straight copy and change the $conf[template] variable) and modifying its stylesheet makes most sense as then you don't risk losing your changes when upgrading dokuwiki.

I don't know how GeSHi decides which class gets applied to which aspects of the particular code. However, with Firefox, its Web Developer extension & the CSS/View Style Information tool its easy to hover over bits of the web page and see the id & class heirarchy for any page element.

Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: