While WordPress.com doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:
Wrap your code in these tags:
[sourcecode language='css']
your code here
[/sourcecode]
Any of the following can be used for the language parameter (using one is required):
- cpp
- csharp
- css
- delphi
- html
- java
- jscript
- php
- python
- ruby
- sql
- vb
- xml
Alex Gorbatchev’s syntaxhighligher Google Code project was used to implement this feature.
No comments:
Post a Comment