Jump to content

Help:Syntax Highlighting: Difference between revisions

m
missed some
m (Geishi no longer supported)
m (missed some)
Line 2:
 
== How to highlight ==
Prefix your code with <code>&lt;syntaxhighlight lang ''="foo''"&gt;</code> (where ''foo'' is the language to use for highlighting) and suffix it with <code>&lt;/langsyntaxhighlight&gt;</code>. Be sure not to insert extra space between the tags and your code. For example, here's how you'd highlight a C program:
 
<pre>
Line 23:
Also, if it hasn't been done yet, add the identifier to your language's category page. Use the "tags" parameter in the [[Template:Language|language template]] to specify it (e.g. "tags=foo" for the example above). If you find that your language already has a tag listed there that isn't in the Village Pump post, add it to the post as well.
 
If you'd like to, it's surprisinglynot easydifficult to write a new language definition for GeSHiPygments. See [[Rosetta Code:Village Pump/Syntax Highlighting#Relationship Between Rosetta Code and GeSHi|this post]] for more on the relationship between GeSHi and Rosetta Code. [httphttps://rosettacodepygments.org/geshidocs/lexerdevelopment/ AutoGeSHi]Write mayyour beown oflexer] use,for althoughmore iton isn'tadding nearlysupport asfor fancya asnew its name suggests; see [[Rosetta Code:AutoGeSHi|this page]]language.
 
===Recommended language tag usage===
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.