Octopress

A blogging framework for hackers.

Codeblock

With this plugin you can write blocks of code directly in your posts and optionally add titles and links.

Syntax

{% codeblock [title] [url] [link text] %}

Example 1

{% codeblock %}
Awesome code snippet
{% endcodeblock %}
Awesome code snippet

Example 2

# Including a file extension in the title enables highlighting
{% codeblock Time to be Awesome - awesome.rb %}
puts "Awesome!" unless lame
{% endcodeblock %}
Time to be Awesome - awesome.rb
1
puts "Awesome!" unless lame

Example 3

# Add an optional URL to enable downloading or linking to source
{% codeblock Got pain? painreleif.sh http://example.com/painreleief.sh Download it! %}
$ rm -rf ~/PAIN
{% endcodeblock %}
Javascript Array Syntax (array.js)MDN Documentation
1
2
var arr1 = new Array(arrayLength);
var arr2 = new Array(element0, element1, ..., elementN);

The last argument link_text is optional. You may want to link to a source for download file, or documentation on some other site.