3 Code

Inline code snippets, keyboard user input display, blocks of pre-formatted text, highlighted code via Jekyll+Pygments, sample code output, etc.

This section will roughly follow the Bootstrap Code CSS outline: http://getbootstrap.com/css/#code

3.1 Block

A block of syntax-highlighted code wrapped with <pre> tags. If inside a Liquid template, you can use the Pygments syntax highlighting style {% highlight lang %}. Learn more: http://jekyllrb.com/docs/templates/#code-snippet-highlighting

   var name = 'Vito';
   if(name.length > 10) return;
 
 <pre>
   var name = 'Vito';
   if(name.length > 10) return;
 </pre>

3.2 Inline

Wrap inline snippets of code with <code>.

There was a bug in the getDataHandler() class method.
 There was a bug in the <code>getDataHandler()</code> class method.

3.3 User Input

Use the <kbd> tag to indicate input that is typically entered via keyboard.

To exit press the ESC or q keys.
 To exit press the <kbd>ESC</kbd> or <kbd>q</kbd> keys.

3.4 Variables

For indicating variables use the <var> tag.

y = mx + b
 <var>y</var> = <var>m</var><var>x</var> + <var>b</var>

3.5 Output

For indicating blocks sample output from a program use the <samp> tag.

An error occured, please try running me again.
 <samp>An error occured, please try running me again.</samp>