rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

MIT License

Downloads
651.8K
Stars
1K
Committers
30

Bot releases are hidden (Show)

rehype-pretty-code - v0.10.0

Published by atomiks over 1 year ago

This release adds better defaults so you don’t need to specify any options or callback hooks.

Breaking Changes

  • Default theme is github-dark-dimmed, not Shiki’s default of nord.
  • .line class selector has been replaced with [data-line].
  • grid: true option has been added to prevent lines from collapsing by default with code blocks, allowing you to remove the onVisitLine callback hook.
  • keepBackground is now true by default.
  • onVisitHighlightedWord is now onVisitHighlightedChars.

Features

  • Highlighted lines now have data-highlighted-line attribute by default.
  • Highlighted chars now have data-highlighted-chars attribute by default.
  • Highlighted chars with id now have data-chars-id attribute by default.
  • onVisitTitle and onVisitCaption visitor hooks have been added.
    View changes on GitHub