Self-Printing Code Block
A code block that contains the code that drew it, with an explanation of the trick.
A code block that contains itself: everything in it is the code that drew it, including the line that put it there. The page explains how it copies its own markup and writes that copy into the empty block.
Related
- Layouts with route groups
The plan to give each kind of page its own layout with Next.js route groups: (site), (notes) with a left notes aside, (bare), and (artifacts) for self-contained HTML files.
- Highlight
The Highlight text component: a faint blue tint with square corners, whose side padding repeats on every line it wraps across.
- UI stress test
Nested components stacked inside each other, like bold and code inside links and tables inside lists, to find where the styles break.
- Route groups
An interactive explainer of Next.js route groups: how folders in parentheses leave the URL, share layouts, opt pages in and out, and isolate loading and error states.