1.0.0-beta.31 • Published 12 days ago

@kitbook/mdsvex-shiki-twoslash v1.0.0-beta.31

Weekly downloads
-
License
MIT
Repository
github
Last release
12 days ago

mdsvex-shiki-twoslash

Usage

  • npm i -D @kitbook/mdsvex-shiki-twoslash

  • Add to your mdsvex.config.js:

import { defineMDSveXConfig as defineConfig } from 'mdsvex'
import { shikiTwoslashHighlighter } from '@kitbook/mdsvex-shiki-twoslash'

const config = defineConfig({
  // ...
  highlight: shikiTwoslashHighlighter({ themes: ['dark-plus'] }),
})

export default config
  • Add the css to your project: import "@kitbook/mdsvex-shiki-twoslash/shiki-twoslash.css"; (or import from https://www.unpkg.com/@kitbook/mdsvex-shiki-twoslash@0.0.3/src/shiki-twoslash.css) > I recommend you read through the entire CSS and adjust to your liking. It's been optimized for dark-plus, but as you'll see from the light-plus version, there's no border around the code. So it's a good starting point but you really should look it over and make it fit your needs.

Themes

ShikiTwoslash will default to using the dark-plus and light-plus themes if you don't pass a theme/themes option. If you leave alone the themes option and let it spit out both dark and light versions, you can then use media queries to show the desired option depending on dark/light mode. To adjust themes you could simply look at the default ones found in the themes folder of the shiki package. See also the Shiki-Twoslash docs and Shiki docs for more about themes as it's very flexible in allowing you to add any VS Code theme or even create a new one via a json file.

Other Helpful links

These initially got me going, but really in hindsight, just reading the the Shiki-Twoslash docs and Shiki docs right from the start would have been better.

1.0.0-beta.31

12 days ago

1.0.0-beta.30

13 days ago

1.0.0-beta.29

14 days ago

1.0.0-beta.28

15 days ago

1.0.0-beta.27

15 days ago

1.0.0-beta.26

16 days ago

1.0.0-beta.24

1 month ago

1.0.0-beta.23

2 months ago

1.0.0-beta.22

2 months ago

1.0.0-beta.21

2 months ago

1.0.0-beta.20

3 months ago

1.0.0-beta.19

3 months ago

1.0.0-beta.17

3 months ago

1.0.0-beta.18

3 months ago

1.0.0-beta.16

3 months ago

1.0.0-beta.15

3 months ago

1.0.0-beta.13

3 months ago

1.0.0-beta.14

3 months ago

1.0.0-beta.12

3 months ago

1.0.0-alpha.52

7 months ago

1.0.0-alpha.51

7 months ago

1.0.0-alpha.53

7 months ago

1.0.0-alpha.50

7 months ago

1.0.0-beta.2

6 months ago

1.0.0-beta.3

6 months ago

1.0.0-beta.4

6 months ago

1.0.0-beta.5

6 months ago

1.0.0-beta.1

7 months ago

1.0.0-beta.11

5 months ago

1.0.0-beta.10

6 months ago

1.0.0-beta.6

6 months ago

1.0.0-beta.7

6 months ago

1.0.0-beta.8

6 months ago

1.0.0-beta.9

6 months ago

1.0.0-alpha.49

7 months ago

1.0.0-alpha.48

7 months ago

1.0.0-alpha.44

7 months ago

1.0.0-alpha.47

7 months ago

1.0.0-alpha.46

7 months ago

0.0.4

11 months ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago