10. Use expressive-code for enriching code blocks progressively
Code blocks should have certain ergonomics.
- file-name clearly destinguished from code (where appropriate)
- diffs with language support
But these need to be done in a way that is progressive. Any enhancements should be ignored by markdown-processors I don’t control (dev.to, Notion, StackOverflow, GitHub, etc.) This ensures that visitors to my site get a great experience but snippets don’t have to re-formatted to be useful elsewhere.
You can find examples of my intended use-cases at chan.dev/styleguide/post.
expressive-code via the first-class Astro integration.
prose needs additional styles to make
figure > code look like