What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

I don't seem to see where it says that the blog engine in use supports syntax highlighting for code and the like, does the current configuration support syntax highlighting, and if so, how do I use it?

share|improve this question

1 Answer 1

Yes, code formatting is supported via a plugin, but it must be enabled per site, so if you try adding it and nothing happens, then you'll have to ask a community team member.

Everything after this line is copy-pasted as a courtesy, and to make lookups easy, and to make sure documentation doesn't evaporate:


Just wrap your code in these tags:

[sourcecode language="css"]
your code here
[/sourcecode]

The language parameter controls how the code is syntax highlighted. The following languages are supported:

  • actionscript3
  • bash
  • clojure
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • html
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • r
  • ruby
  • scala
  • sql
  • vb
  • xml

If the language parameter is not set, it will default to “text” (no syntax highlighting).

Code in between the source code tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.


That's enough of quoting. This was installed some time ago, and is added to Meta.SE as a courtesy to those looking from across the network. Here's the first "in the wild" spotting of this being installed/enabled: Blog and syntax coloration found by random

share|improve this answer
1  
The blog post used by Security appears to be this example: security.blogoverflow.com/2011/09/… –  random Jun 20 '12 at 23:32
    
Does this mean we need to specifically ask for something for our blog at security? –  Rory Alsop Jun 21 '12 at 8:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .