Post with codeblocks
This is how to add codeblocks to your posts
Codeblocks
Input:
Output:
def show
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
Codeblocks with line numbers
Input:
Output:
1
2
3
4
5
6
7
def show
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
Command line prompt
Input:
{% highlight shell %}
$ gem install jekyll
{% endhighlight %}
Output:
$ gem install jekyll
Code in a paragraph
Input:
This is what `<html>` code looks like in a paragraph of text.
Output:
This is what <html>
code looks like in a paragraph of text.