Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the font size of code formatted by SyntaxHighlight GeSHi in MediaWiki

The font size of my code snippets are too small relative to the default font size of the Wiki, which makes them hard to read (see below for an example). Is there anything I can do to change it?

Example:

enter image description here

The code that generates the above is:

==== Histograms ====
This is the code to compute the histogram:
<source lang="matlab">
nEls = numel(unique_vals);
edges = zeros(nEls+2,1);
</source>
like image 534
Amelio Vazquez-Reina Avatar asked Mar 18 '11 16:03

Amelio Vazquez-Reina


3 Answers

Edit the MediaWiki:Geshi.css.

Example:

div.mw-geshi div,pre {
 font-family: monospace, "Courier New" !important;
 font-size:13px;
}
like image 114
Adrian Archer Avatar answered Oct 23 '22 13:10

Adrian Archer


edit your SyntaxHighlight_GeSHi.class.php

add font-size to following line

$css[] = ".source-$lang {line-height: normal; font-size: 12px;}";
like image 37
Sudi Bianto Avatar answered Oct 23 '22 11:10

Sudi Bianto


Turns out this is a bug in the MediaWiki extension. It is referenced in the bug tracker at https://bugzilla.wikimedia.org/show_bug.cgi?id=26204

We can get a permanent fix in it, will poke some other peoples to get it properly fixed.

like image 3
Antoine 'hashar' Musso Avatar answered Oct 23 '22 13:10

Antoine 'hashar' Musso