typestar

Code, samples and variables in HTML

Marking up the parts of a terminal session so each one means something.

<p>Run <code>typestar serve --port 8080</code> to start it.</p>

<pre><code>def total(items):
    return sum(item.price for item in items)
</code></pre>

<p>It prints <samp>listening on 8080</samp> when it is ready.</p>
<p>Replace <var>port</var> with any free port number.</p>

How it works

  1. <pre> keeps whitespace; <code> marks the text as code.
  2. <samp> is program output and <var> is a placeholder to fill in.
  3. The pair <pre><code> is the usual way to write a code block.

The run, in numbers

Lines
8
Characters to type
273
Tokens
67
Three-star pace
60 tpm

At the three-star pace of 60 tokens a minute, this run takes about 67 seconds.

Type this snippet

Step 5 of 7 in Text & headings, step 8 of 28 in Document structure.

← Previous Next →