#Code

Easily create code blocks in Cirrus with the code class.

#Basics

By default, a code block is nothing more than a pre wrapping a code block with some extra classes.

console.log('hello 👋');
<pre><code>console.log('hello 👋');</code></pre>
Language Specification

To specify the language of the code block, just add the data-lang attribute to the code element.

console.log('hello 👋');
<pre><code data-lang="JavaScript">console.log('hello 👋');</code></pre>
Dark Mode

For a dark background, use the dark class.

console.log('hello 👋');
<pre><code class="dark" data-lang="JavaScript">console.log('hello 👋');</code></pre>
Inline

To display code within a parapgraph, you only need to use the code element.

In order to speed up your computer, make sure you try running sudo rm -rf /.

<p class="lead">In order to speed up your computer, make sure you try running <code>sudo rm -rf /</code>.</p>