Example post with interactive data
By Abel Rodriguez
Table of contents
This is a sample post so you can see every blog feature. To write your own, copy posts/example-interactive-post.md, change the name and the text, and delete this file before you launch the blog.
What a post can do#
Everything below is plain Markdown. The extras are the callouts, the copy button on code, and the interactive charts.
Note
Callouts come in four kinds: NOTE, TIP, WARNING and IMPORTANT.
Tip
Hover or tap a chart to read exact values, or focus it and use the ← and → keys.
Weekly mileage#
A line chart with one series, written the longer way as JSON. The table underneath is always there for readers who prefer numbers, and for people without JavaScript.
View as a table
| Label | Miles |
|---|---|
| Wk 1 | 22 mi |
| Wk 2 | 26 mi |
| Wk 3 | 29 mi |
| Wk 4 | 24 mi |
| Wk 5 | 31 mi |
| Wk 6 | 34 mi |
| Wk 7 | 28 mi |
| Wk 8 | 20 mi |
Week 4 and week 8 were recovery weeks.
Typing data like a spreadsheet#
You don't have to write JSON. Put a few settings at the top, a line of three dashes, then paste rows straight from a spreadsheet. The first row names the series, and each row after it is a label followed by one value per series. Times like 9:45 are understood, so a pace chart is easy to type.
View as a table
| Label | Easy runs | Tempo runs | Long runs |
|---|---|---|---|
| Jun | 9:45 | 8:18 | 10:05 |
| Jul | 9:38 | 8:14 | 9:58 |
| Aug | 9:32 | 8:09 | 9:51 |
| Sep | 9:26 | 8:05 | 9:46 |
| Oct | 9:21 | 8:01 | 9:40 |
Click a name in the legend to hide that line. Lines differ by dash pattern and marker shape, and are also labelled at their right-hand end, so they are easy to tell apart without relying on colour.
Comparing categories#
View as a table
| Category | Longest run | Average long run |
|---|---|---|
| Build 1 | 18 mi | 13.5 mi |
| Build 2 | 20 mi | 15 mi |
| Build 3 | 22 mi | 16.5 mi |
Showing commands#
Code blocks get a copy button:
npm run build
Leaving the table of contents out#
Posts with three or more headings get a table of contents automatically. Add toc: false to the top of the file to turn it off.