MediaWiki talk:SyntaxHighlightingStylesheet

From LiteratePrograms
Jump to: navigation, search

This page consists of sets of three lines (you only see these after you click edit). Each triple denotes:

  1. A style, which is referred to by a rule for a particular syntax expression on MediaWiki talk:SyntaxHighlightingRegexps.
  2. The HTML syntax placed before the expression, usually opening tags.
  3. The HTML syntax placed after the expression, usually closing tags.

Please ask me if you have any questions. Deco 05:02, 5 March 2006 (PST)

[edit] Using CSS for syntax highlighting?

What about using CSS for syntax highlighting? That is, instead of using

<font color="#444444">

you'd use

<span class="highlight-comment">

and add in MediaWiki:Common.css:

span.highlight-comment { color:#444444; }

The advantage would be that any user could easily adapt the syntax highlighting style from his own user CSS file (e.g. Special:Mypage/monobook.css). --Ce 10:14, 22 June 2007 (PDT)

That's a good idea and more flexible - in fact, what I really ought to do is just assign a CSS class to each type of code element and then specify their rendering in the stylesheet. In fact, we can pretty much do this already in the manner you suggest, although it'd be simpler to just specify the class name for each. I'm not sure if there's anything we're doing now that wouldn't be supported by this. Deco 20:55, 12 August 2007 (PDT)