Kitchen Sink Tufte code

“Everything but the kitchen sink.”

@jez

This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

👋 This page is designed to look similar to Tufte CSS, powered by the customization features in Pandoc Markdown CSS Theme.
→ More information on Tufte CSS

Prose

This is some body text between headings. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

This is some body text between headings. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not ~need JavaScript, even for side notes.

This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

This is some body text between headings. This project provides CSS files and a template for using pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

“Hanging punctuation” is really nice.
Unfortunately it’s only supported in Safari on iOS and macOS.
“Does it work after line breaks,” or just at the block start?


Horizontal rules, too!


Math

There’s inline math: a^2 + b^2 = c^2, and block math:

60 \, \frac{\textrm{seconds}}{\textrm{minute}} \cdot 60 \, \frac{\textrm{minutes}}{\textrm{hour}} = 3,600 \, \frac{\textrm{seconds}}{\textrm{hour}}

\frac{ \Delta \, \Gamma, e : \forall (u :: \kappa). \tau \qquad \Delta \vdash c :: \kappa }{ \Delta \, \Gamma \vdash e[c] : [c/u]\tau }

\frac{ \Delta \, \Gamma, e : \forall (u :: \kappa). \tau \qquad \Delta \vdash c :: \kappa }{ \Delta \, \Gamma \vdash e[c] : [c/u]\tau }

Typing rule for ∀ types

\frac{ \Delta, u :: \kappa \vdash c :: \kappa’ }{ \Delta \vdash \lambda(u :: \kappa). \, c :: \kappa \to \kappa’ }\;(\texttt{lambda-kind}) \quad \frac{ \Delta, u :: \kappa \vdash c :: * }{ \Delta \vdash \forall(u :: \kappa). \, c :: * }\;(\texttt{forall-kind})

Kind rules for two type constructors in System Fω. This text is long enough that it wraps on some screens.

\frac{ \Delta, u :: \kappa \vdash c :: \kappa’ }{ \Delta \vdash \lambda(u :: \kappa). \, c :: \kappa \to \kappa’ }\;(\texttt{lambda-kind}) \quad \frac{ \Delta, u :: \kappa \vdash c :: * }{ \Delta \vdash \forall(u :: \kappa). \, c :: * }\;(\texttt{forall-kind})

This caption will be forcibly left-aligned.

\frac{ \Delta, u :: \kappa_1 \vdash c_2 :: \kappa_2 \qquad \Delta \vdash c_1 :: \kappa_1 }{ \Delta \vdash (\lambda(u :: \kappa_1). \, c_2)(c_1) \equiv [c_1/u]c_2 :: \kappa_2 } \quad \frac{ \Delta, u :: \kappa_1 \vdash c_2 :: \kappa_2 \qquad \Delta \vdash c_1 :: \kappa_1 }{ \Delta \vdash (\lambda(u :: \kappa_1). \, c_2)(c_1) \equiv [c_1/u]c_2 :: \kappa_2 } \quad \frac{ \Delta, u :: \kappa_1 \vdash c_2 :: \kappa_2 \qquad \Delta \vdash c_1 :: \kappa_1 }{ \Delta \vdash (\lambda(u :: \kappa_1). \, c_2)(c_1) \equiv [c_1/u]c_2 :: \kappa_2 } \\ \quad \\ \frac{ \Delta \, \Gamma, e : \forall (u :: \kappa). \tau \qquad \Delta \vdash c :: \kappa }{ \Delta \, \Gamma \vdash e[c] : [c/u]\tau } \quad \frac{ \quad }{ (\Lambda u. \, e)[\tau] \mapsto [\tau / u]e }

Assorted rules from statics and dynamics of Systemω

Headings

This is some body text between headings. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

Smaller heading

This is some body text between headings. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

Even smaller heading code

This is some body text between headings. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

There is no level 4 heading

Level 1 heading code

Level 2 heading code

This is some body text between headings. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

Another level 2 heading

This is some body text between headings. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

Lists

This is some body text between lists. It takes up the full width of the line, but only just barely.

This is some body text between lists. It takes up the full width of the line, but only just barely.

  1. Level 1
    1. Level 2
      1. Level 3
        1. Level 4
          1. Level 5
            1. Level 6

This is some body text between lists. It takes up the full width of the line, but only just barely.

This is some body text between lists. It takes up the full width of the line, but only just barely.

  1. This list
  2. has ten
  3. items which
  4. causes it
  5. to push
  6. the numbers
  7. further left
  8. which extends
  9. the numbers
  10. into the
  11. page margin.

This is some body text between lists. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras.

This is some body text between lists. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras.

  1. Line starts with a short bullet point
    1. First line
      Next line
  2. Notice how the line numbers are tabular numbers, not proportional.
    • First line, switch to bullet
      Next line

This is some body text between lists. This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras.

This is some body text between lists. This project provides CSS files and a template for using Pandoc to generate standalone HTML files.

  1. List item after should line up with check box before

This is some body text between lists. This project provides CSS files and a template for using Pandoc to generate standalone HTML files.

This is some body text between lists. This project provides CSS files and a template for using Pandoc to generate standalone HTML files.

→ Looks like a list
→ Not actually a list

Code blocks

Ah yes, who could forget about the code blocks.

# typed: true
require 'sorbet-runtime'

class A
  extend T::Sig

  sig {void}
  def self.main
    puts "Hello, world!"
  end
end

Here is a short paragraph between code blocks.

# This is a really long line that causes the text to wrap onto multiple lines in a code block that uses syntax highlighting AND line numbers.
puts 'It should also work without line numbers.'

# This is a really long line that causes the text to wrap onto multiple lines in a code block that uses syntax highlighting BUT NOT line numbers.

Check out the subtle line numbers. This is some inline code with text after it.

This code does not have a language associated with it. This is the point at which the code would wrap a long line.

Some more lines to make Paper give us line numbers.
Some more lines to make Paper give us line numbers.
Some more lines to make Paper give us line numbers.
Some more lines to make Paper give us line numbers.
This code does not have a language associated with it. This is the point at which the code would wrap a long line.
┌┐
└┘
This is tight code in action.
This is tight code in action.
┌┐
└┘
This is tight code in action.
This is tight code in action.
source 'https://rubygems.org'

gem 'sorbet'
gem 'sorbet-runtime'
Gemfile contents
This code block has an absolutely large amount of text in it for who knows what reason. Who is the kind of heathen who would willfully write code with lines this long?

Scroll → all the way to the left to double check that this line highlight works.

← A current limitation is that `.wide` + `.numberLines` causes the line numbers to
be hidden.
This is the code block’s caption. Like many of the other captions on the page, it has a lot of text in it so that it’s forced to wrap eventually.

This is the text after the fig caption. How is the gap between the figcaption and this text?

F
Plain code block, no div.sourceCode, but it's wide so the text might wrap around a bit further than code is normally expected to.
L

Block quotes

Block quote, right under heading.

Block quote, right under heading.

A paragraph after the block quote separates it from the second block quote on the page.

This block quote uses bold text and italic text in line one.
It also uses small caps and bold small caps in line two.
It also uses underlined text and linked text and inline code text in line three.

“Here’s an example” of hanging-punctuation,
Followed by normal text again

— Someone famous

The fun thing about markdown versus Dropbox Paper is that you can have lists in block quotes:

Colored notes

There are inline highlights, with various colors:

If you want you can also use HTML that’s a little more semantic:
the HTML mark tag.

There are also single-element, colored tables, which get treated as colored notes.

🛑 Look before you leap!
⚠️ This is a warning!

Hopefully this could just fall out if tables work well?

✅ Success! The deed is now done.

Feel free to retry whatever it is you were trying to do.
ℹ️ Consecutive notes are like consecutive tables.
🔮 Can you see into the future?

Might make sense to do these in terms of like divs but for now they’re tables.

Side notes

Markdown footnotes become side notes.Is the beginning aligned?
Is the beginning aligned?

Versus sup.1 It would be neat to associate a range of text with a footnote, rather than a single point. The second side note baseline will not line up. If we wrap this third line all the way around, we can see how it behaves for longer lines as well. First: 1st

Markdown footnotes become side notes.This is a margin note without a number. It spans just a few lines. Maybe it gets to three?

After the note. It would be neat to associate a range of text with a footnote, rather than a single point. This is longer text to give the paragraph some heft to it, so that the side note doesn’t feel overpowering.

Markdown footnotes become side notes.There’s code in this side note!

After the note. It would be neat to associate a range of text with a footnote, rather than a single point. The second side note baseline will not line up. If we wrap this third line all the way around, we can see how it behaves for longer lines as well.

Markdown footnotes become side notes.In this margin note, we’ve got quite a bit of text. It spans multiple so many lines that even in the Pandoc markdown source it spans multiple lines.

It can have line breaks too. This should be a test of what happens when the margin note is more lines than the paragraph it’s commenting on.

After the note. This paragraph is not short, but the margin note next to us is much longer, which pushes the subsequent notes further away from their anchor. But also, footnotes.1

Without doing anything else,This side note attaches to a blockquote. Why would that be any different? Not sure. We reset the font-style and that’s it.

side notes that attach to text inside a block quote would magically become italic, because they’d inherit the styles of the surrounding block quote. Luckily, we have a test for this case, and that does not to happen because we fixed it.

Images

We can also handle images:

Sugarloaf Hill, San Mateo, CA, April 2021

This is some text after the image. The interesting thing is that the presence of a caption pushes the following paragraph down. For example, here’s an image without a caption:

Notice how the text after the image resumes further away, instead of being close to the image.

We can also do extra wide and full width images:

This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

Sugarloaf Hill, San Mateo, CA. Left: April 2021, right: June 2021

This project provides CSS files and a template for using Pandoc to generate standalone HTML files. It supports most features Pandoc Markdown has to offer, and some extras. The default look can be tweaked via CSS variables, and it does not need JavaScript, even for side notes.

Upper Crystal Springs Reservoir, near Belmont, CA

And some text after the extra wide image. There’s currently a bug making it so that this text isn’t as tight as text for non-extra-wide images because there’s an extra div around it. But maybe that’s actually a feature not a bug.

Tables

Column 1 Column 2
This is some text. This is some text.
This is some text. This is some text.
Column 1 Column 2
This is some text. This is some text.
This is some text. This is some text.

The wild thing is that this is as tight as the body text gets to the table.

Column 1 Column 2
This is some text. This is some text.
This is some text. This is some text.
This table has a caption.
Column 1 Column 2
This is some text. This is some text.
This is some text. This is some text.

We can also make tables become wider than the main text if there’s a lot of stuff in the table. They suffer the same “margin is too big” bug that extra wide images do.

The difference between wide and extra-wide is that extra-wide is the only one that will expand into the left and right columns.

Meanwhile, wide will expand past the right column when the center column is smaller than --main-width.
Column 1 Column 2 Column 3 Column 4 Column 5
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This extra wide table also has a caption. It has quite a bit of text in the caption, so it wraps onto multiple lines when rendered at smaller screen sizes.
Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9 Column 10
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This extra wide table also has a caption. It has quite a bit of text in the caption, so it wraps onto multiple lines when rendered at smaller screen sizes.
Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9 Column 10 Column 11 Column 12 Column 13 Column 14 Column 15 Colum 16 Colum 17 Colum 18 Colum 19 Colum 20
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
A full width table takes up pretty much all space available.
Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9 Column 10 Column 11 Column 12 Column 13 Column 14 Column 15 Colum 16 Colum 17 Colum 18 Colum 19 Colum 20
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

Maybe it would be nice to have some way to dynamically say how much extra space a table should take up, but for nowe we have only three break points: wide, extra-wide, and full-width.

We can use Pandoc’s fancy tables to make some columns wider:

Column 1 Column 2
This is a really wide column using pandoc’s fancy tables. This is narrow.
This is a really wide column using pandoc’s fancy tables. This is narrow.
No header Still works

  1. Use a prefix of {.} to leave it as a footnote. Unfortunately, side notes and margin notes don’t share the same namespace. If you want to mix side notes and footnotes in the same document, you might want to use margin notes, so that there is only one kind of numbered note.↩︎