← All releases

wp-content/themes/trestle/

Trestle

An engineering blog theme with code blocks that are readable on a phone.

== Description ==

Syntax highlighting libraries add 90KB and a flash of unhighlighted code. Trestle highlights at save time and stores the result, so the front end ships coloured markup and no highlighter at all.

Code blocks scroll horizontally inside their own container rather than forcing the page to scroll, which is the difference between a readable article on a phone and an unreadable one. Long lines are not wrapped, because a wrapped line of code is a lie about the code.

Diff blocks render additions and removals with a symbol as well as a colour, so the meaning survives a monochrome print and a colour-blind reader.

== Screenshots ==

Numbered the way they ship in /assets/. Click any one to see it full width.

== Installation ==

  • Install and activate the theme.
  • Use the ordinary code block and set its language.
  • Resave existing posts, or run wp trestle highlight --all.

Highlighting covers 40 languages. Anything else renders as plain monospace, which is correct rather than wrong.

== Frequently asked questions ==

What if I change themes?

Highlighted markup is stored alongside the original, not instead of it. Your content is untouched.

Line numbers?

Optional per block, and excluded from copy — copying line numbers is the classic annoyance.

Does the copy button need JavaScript?

Yes, and it is the only script in the theme. Without it the code is still selectable.

== Changelog ==

= 3.5.0 =

  • Diff blocks use symbols as well as colour.
  • Copy button excludes line numbers.

= 3.2.0 =

  • Highlighting moved to save time. The front-end highlighter is gone: 91KB removed.

= 3.0.0 =

  • Converted to a block theme.
  • Minimum PHP is now 8.1.