
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@kitbook/mdsvex-shiki-twoslash
Advanced tools
A plugin for MDSvex that highlights code blocks using shiki-twoslash
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
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.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.
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.
FAQs
A plugin for MDSvex that highlights code blocks using shiki-twoslash
The npm package @kitbook/mdsvex-shiki-twoslash receives a total of 573 weekly downloads. As such, @kitbook/mdsvex-shiki-twoslash popularity was classified as not popular.
We found that @kitbook/mdsvex-shiki-twoslash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.