You could give the wrapper elements (<pre> and <div> tags) CSS classes to identify that it's source code and what language.
So
<source lang="php"> echo('hi there'); </source>
Might become
<pre class="sourcecode php"> .... </pre>
Then the pre-generated GeShi files could be modified to have all elements prefixed with .sourcecode .php or whatever.
It would probably make sense though to put all of this generated stuff into something other than Common.css but still loaded via a <link> tag which only appears on pages with at least one <source> block. Reason being that the CSS for all supported GeShi languages will probably be large, and unnecessary for the wide gamut of Wikipedia articles.
-- Jim
On 4/6/07, Tim Starling tstarling@wikimedia.org wrote:
Jim Wilson wrote:
You may want to disable the inline <style> declarations and move all the
CSS
to an externally loaded document like Common.css.
(Yes, yes, I know that premature optimization is the root of all evil)
The colours are hard-coded into the language-specific files in GeSHi, so you can't generate a compact stylesheet that works for all languages. We could have a separate generated stylesheet for each language, but that would mean an article like [[b:List of hello world programs]] might need to load 50 stylesheets, which would be slow.
Admins should be able to customise the colours by using selectors that are more specific than the default GeSHi selectors.
-- Tim Starling
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l