For the coders among you, you may already know that posting source code is really easy here on WordPress.com thanks to the sourcecode shortcode. You just wrap your code in
[sourcecode] and you're good to go -- no code escaping or anything.
If you are one of those code posters, or are looking to become one, then you'll be happy to know that we've updated the feature allowing more flexibility as well as adding support for additional coding languages like Bash and SVN diff.
See for yourself -- here's some HTML with a little bit of PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>WordPress.com Code Example</title> </head> <body> <h1>WordPress.com Code Example</h1> <p><?php echo 'Hello World!'; ?></p> <p>This line is highlighted.</p> <p>This line is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long.</p> <div class="foobar"> This is an example of smart tabs. </div> <p><a href="http://wordpress.com/">WordPress.com</a></p> </body> </html>
Besides a completely new, easier to use look, you may notice that line number 12 is highlighted. It's just one of the many new features offered in the new version which also includes things like first line number control and the much better toolbar (hover over the code block to make it show up).
To see the full list of available languages and configurations parameters as well as some working examples, check out our in-depth support document.
Many thanks for supporting Scala syntax highlighting ! :D
thks for the update and the features
This is cool.
Someday I’ll learn CSS and HTML and use all these features.
I use these features extensively, and these are very important to me. The feature is perfect for me, except some minor visual issues (padding and borders in some variant) which i have already discussed on forums and #wordpress.com freenode channel.
Um, okaaaaay. I just tried wrapping the source code for a widget as described above, and all that happens is the actual code appears on my blog??? I’ve read just about everything I can find on the subject and I’m starting to feel like I’m missing something? A brain perhaps? Any ideas anyone? Thx
Copy to the toolbar alone is worth its weight in gold. Very nice feature!
The code itself looks kind of cramped though by default in Chrome on XP.
Excellently spruced up feature. Congrat’ :-) and glad to know it made its way as a plugin into WP.
I know this may be a silly question, but does this mean first I have to purchase CSS upgrade in order to do sourcecoding?
Plus would you recommend a site I can learn just a little bit more.
I understand HTML. I’m pretty good with the basics, and I’d love to learn some more. I’m going out to find an HTML5 book today just to stay on top of the little i know.
Very nice, first line number control is a great improvement. Thanks WP.com
This is great! Having the language syntax highlight is a nice plus over the code view I’ve been using prior to this.
This exactly is what I want! Thænkz!
Wow, it’s just like you’re speaking English in another language!! I vow before I die I am going to take the time to decipher it, and I trust that by then WP will have made even more amazing updates. :)
Sounds good for me, since I’m going to post any source code to my blog.. ^^
Thanks a lot…
Thanks for another great addition to the wordpress.com functionality
Guys, you screwed up the SourceCode engine. Now, at the time of posting, everything shows up like it would be just formatted with ::pre:: tag. See your own blog post for the ‘nice’ effect.
This is an awesome extension! I was wondering if we can have syntax highlighting for lisp?
Something that I was waiting for…Thanks a lot.
Would you guys also consider adding Cisco or Juniper Syntax hightlight?
mmm,…. good info
Thank God.. I was pretty tired of converting my code into html decorated form and pasting ‘em in my blog. That is a good one. Java and C# should be added to the feature. Thanks a bunch.
Truly awesome-tastic! Thanks.
Good work folks
Yea…Better source code..Nice..Very simple to using about that
Thank you so much. Id love to use this feature. WordPress is getting better
It’s Very useful for me ;) thx
Any chance we’ll get support for ML style languages (like SML, Ocaml, and F#) and Lisps (like CL, Clojure, and elisp)?
Thank you. Much appreciated.
Very useful plug-in.
I was looking for this, great help, thanks. So long I was having difficulty in posting those codes.
I prefer specialized plugins for source posting, cause there’s some highlighting as well
The .com versions/themes are much easier, you don’t have to think about how things work ;-)
The highlighting feature is greate. I missed it for quite long.
nice info.. lets try it :D
Great but its about time .. I would say..
I still don’t get it. And why should you source code posts?
Want to learn how to make my blog look right
Speak english, I don’t understand this source coding stuff… I’m just a daily photo blogger waiting for my blog to be freshly pressed.
Could you please let me know these coding will help me to promote my blog?
Thank you so much..
Thanks, that’s great ! A really nice thing :)
wow wow wow,,, this is nice!
UUhh what is source coding?? Im learning pple… :/
thanks so much
Thx so much! It’s a lot like BBCode.
Thx this is really great :)
Me thinks its a snowin on this here page!
that is really cool ;)
muchas gracias for this!
Sounds very good! (and if it’s all beyond my wit then I know others will help me if I ask). :)
Looks great! One thing, though…
I’ve got some articles where code is inside code-tags. When I replace those tags with the new sourcecode-block, the quote-characters are rendered for html and are thus displayed as " instead of ‘just’ the normal character.
Am I doing something wrong here?
Good Work! Keep going!
Thank you! Thank you!
It’s all greek to me.
I came to know ab’t this from your blog only and used it… Thanks,