Tags:
create new tag
view all tags

Question

How can I make verbatim text (enclosed within VERBATIM-tags) coloured? Is there a way to attach a stylesheet and a class-attribute on PRE?

  • TWiki version: 01 Sep 2001
  • Web server: Apache
  • Server OS: Linux
  • Web browser: Mozilla 0.9.5
  • Client OS: Linux

-- TWikiGuest - 31 Oct 2001

Answer

This is not currently supported as far as I know - however, you can modify TWiki's templates to use a CSS stylesheet (and in the Sep 2001 release this may just be a matter of setting a variable). This would let you control the colour of all VERBATIM-tagged text, by controlling it at the HTML level. Not exactly what you want perhaps, but you can always have a go at TWiki coding yourself!

-- RichardDonkin - 05 Nov 2001

Discussion

On this subject, a useful plugin could be to provide a "poor man's XSLT": have a way in TWiki to "define" html tags as CSS selectors:

example:

  • define somewhere: day = span class='day'
  • then, in the wiki page, you can write: on <day>first</day>, we...
  • the plugin will expanse it to: on <span class='day'>first</span>, we...
  • and then we can color it via CSS as: span.day { color: red; }

I think this would provide a simple way to add color to text, with a "html" flavor already known from users (rather than using a TWiki syntax %DAY{first}%, which is a bit unnatural for end users. Moreover this syntax can also be easily parser by XSLT parsers, allowing other transforms.

Back to our subject, that would mean using <pre> rather than <verbatim> and custom "tags" defined this way, maybe <red>foo</red>, etc...

-- ColasNahaboo - 06 Nov 2001

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2001-11-10 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.