0.3.2 • Published 11 months ago

@bebeal/rehype-code-terminal v0.3.2

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

@bebeal/rehype-code-terminal

A rehype plugin for rendering code terminals in place of code blocks.

Installation

npm install @bebeal/rehype-code-terminal

Usage

  • Use with rehype-starry-night to syntax highlighted code blocks.
import rehypeCodeTerminal from '@bebeal/rehype-code-terminal'
import rehypeStarryNight from 'rehype-starry-night'
import { common } from '@wooorm/starry-night'
import sourceZig from '@wooorm/starry-night/source.zig'
import sourceScala from '@wooorm/starry-night/source.scala'
import sourceJulia from '@wooorm/starry-night/source.julia'
import sourceHaskell from '@wooorm/starry-night/source.haskell'

export default defineConfig({
  rehypePlugins: [rehypeCodeTerminal, [rehypeStarryNight, { grammars: [...common, sourceZig, sourceScala, sourceJulia, sourceHaskell] }]],
})
  • You'll also need to include the styles, and inject the components
import '@bebeal/rehype-code-terminal/style.css'
import { InlineTerminal, Terminal } from '@bebeal/rehype-code-terminal'

<MDXProvider components={{ InlineTerminal, Terminal }}>
  ...
</MDXProvider>

Demo

0.3.2

11 months ago

0.3.1

11 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago

0.0.0

11 months ago