← Return to Style Guide

Code

This sentence contains <code>inline code</code>.

This is a sample ruby code block.

{% highlight ruby %}
['one', 'two', 'three'].each do |num|
  p num
end
{% endhighlight %}

This is a sample ruby code block with line numbers.

{% highlight ruby linenos %}
['one', 'two', 'three'].each do |num|
  p num
end
{% endhighlight %}

This is a sample code block pulled.

<div class="pull">
{% highlight ruby %}
['one', 'two', 'three'].each do |num|
  p num
end
{% endhighlight %}
</div>

This is a sample code block pulled full with line numbers.

<div class="pull pull-full">
{% highlight ruby linenos %}
['one', 'two', 'three'].each do |num|
  p num
end
{% endhighlight %}
</div>

Rendering

This sentence contains inline code.

This is a sample ruby code block.

['one', 'two', 'three'].each do |num|
  p num
end

This is a sample ruby code block with line numbers.

1 ['one', 'two', 'three'].each do |num|
2   p num
3 end

This is a sample code block pulled.

['one', 'two', 'three'].each do |num|
  p num
end

This is a sample code block pulled full with line numbers.

1 ['one', 'two', 'three'].each do |num|
2   p num
3 end

Pygments Code Coloring

.lineno Line numbers
.c Comment
.err Error
.k Keyword
.o Operator
.cm Comment.Multiline
.cp Comment.Preproc
.c1 Comment.Single
.cs Comment.Special
.gd Generic.Deleted
.gd .x Generic.Deleted.Specific
.ge Generic.Emph
.gr Generic.Error
.gh Generic.Heading
.gi Generic.Inserted
.gi .x Generic.Inserted.Specific
.go Generic.Output
.gp Generic.Prompt
.gs Generic.Strong
.gu Generic.Subheading
.gt Generic.Traceback
.kc Keyword.Constant
.kd Keyword.Declaration
.kp Keyword.Pseudo
.kr Keyword.Reserved
.kt Keyword.Type
.m Literal.Number
.s Literal.String
.na Name.Attribute
.nb Name.Builtin
.nc Name.Class
.no Name.Constant
.ni Name.Entity
.ne Name.Exception
.nf Name.Function
.nn Name.Namespace
.nt Name.Tag
.nv Name.Variable
.ow Operator.Word
.w Text.Whitespace
.mf Literal.Number.Float
.mh Literal.Number.Hex
.mi Literal.Number.Integer
.mo Literal.Number.Oct
.sb Literal.String.Backtick
.sc Literal.String.Char
.sd Literal.String.Doc
.s2 Literal.String.Double
.se Literal.String.Escape
.sh Literal.String.Heredoc
.si Literal.String.Interpol
.sx Literal.String.Other
.sr Literal.String.Regex
.s1 Literal.String.Single
.ss Literal.String.Symbol
.bp Name.Builtin.Pseudo
.vc Name.Variable.Class
.vg Name.Variable.Global
.vi Name.Variable.Instance
.il Literal.Number.Integer.Long
← Return to Style Guide