astro-better-code-blocks
v0.2.5
Published
Remark/rehype and Sätteri plugins plus a copy-code web component for enhanced code blocks in Astro
Maintainers
Readme
astro-better-code-blocks
Remark/rehype plugins, matching Sätteri plugins (astro-better-code-blocks/satteri), and a copy-code web component for enhanced code blocks in Astro.
Install
npm install astro-better-code-blocksWhat it does
- Line highlights with
{n,m-p}syntax - Collapsible line ranges with
[n-p]syntax - Diff overlay on any language with the
diffkeyword - File name tabs with
title="..."syntax - A copy button that works correctly with all of the above
- Shell-session prompts added per command (not on continuation lines); copying a shell session gives only the commands, without prompts or output
Documentation
Full documentation, including configuration and examples, is at https://better-static-sites.github.io/build-tools/code-blocks.
This package is published from the Better Static Sites monorepo; the directory it lives in has a combined README covering it and its sibling package.
