Difference between revisions of "syntax highlight example"

From thelinuxwiki
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
how to enable sane line wrapping of code / other markup
 
how to enable sane line wrapping of code / other markup
  
 +
mediawiki versions (tested on) = 1.21.5,1.21.10
  
 +
To make the long commands wrap, I modified the commonElements.css file in $wikihome/skins/common. Find the section:
  
 +
pre, code, tt, kbd, samp, .mw-code {
 +
        /*
 +
        * Some browsers will render the monospace text too small, namely Firefox, Chrome and Safari.
 +
        * Specifying any valid, second value will trigger correct behaviour without forcing a different font.
 +
        */
 +
        font-family: monospace, Courier;
 +
}
 +
and add
  
 +
        white-space: pre-wrap;
 +
        white-space: -moz-pre-wrap;
 +
        white-space: -pre-wrap;
 +
        white-space: -o-pre-wrap;
 +
        word-wrap: break-word;
 +
after the font-family line.
  
 +
<nowiki>
 +
Viola, the <pre> text will now wrap.
 +
</nowiki>
  
 +
Note: when upgrading MediaWiki this file may be overwritten, so you may need to make this modification again.
  
 +
==links==
  
 +
Thanks to dan at makethenmakeinstall.com for this information!!!!
  
 +
taken from...
  
 +
[http://www.makethenmakeinstall.com/2012/12/makepretagtextwrapinmediawiki/ MAKE PRE TAG TEXT WRAP IN MEDIAWIKI]
  
cpmiquerybin attr "" network_objects "(type='gateway_cluster') & (location='internal') | (type='gateway') & (location='internal')" -a __name__,svn_version_name
+
[[category:mediawiki]]
 
+
<pre>
+
cpmiquerybin attr "" network_objects "(type='gateway_cluster') & (location='internal') | (type='gateway') & (location='internal')" -a __name__,svn_version_name
+
</pre>
+
 
+
<code>
+
cpmiquerybin attr "" network_objects "(type='gateway_cluster') & (location='internal') | (type='gateway') & (location='internal')" -a __name__,svn_version_name
+
</code>
+

Latest revision as of 22:28, 16 April 2017

how to enable sane line wrapping of code / other markup

mediawiki versions (tested on) = 1.21.5,1.21.10

To make the long commands wrap, I modified the commonElements.css file in $wikihome/skins/common. Find the section:

pre, code, tt, kbd, samp, .mw-code {
       /*
        * Some browsers will render the monospace text too small, namely Firefox, Chrome and Safari.
        * Specifying any valid, second value will trigger correct behaviour without forcing a different font.
        */
       font-family: monospace, Courier;
}

and add

       white-space: pre-wrap;
       white-space: -moz-pre-wrap;
       white-space: -pre-wrap;
       white-space: -o-pre-wrap;
       word-wrap: break-word;

after the font-family line.

Viola, the <pre> text will now wrap.

Note: when upgrading MediaWiki this file may be overwritten, so you may need to make this modification again.

links

Thanks to dan at makethenmakeinstall.com for this information!!!!

taken from...

MAKE PRE TAG TEXT WRAP IN MEDIAWIKI