Socket
Book a DemoInstallSign in
Socket

docusaurus-preset-shiki-twoslash

Package Overview
Dependencies
Maintainers
3
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docusaurus-preset-shiki-twoslash

A Docusaurus plugin which adds shiki with optional twoslash-powered code samples

latest
Source
npmnpm
Version
1.1.41
Version published
Weekly downloads
1.9K
9.77%
Maintainers
3
Weekly downloads
 
Created
Source

Docusaurus Preset Shiki Twoslash

Sets up markdown code blocks to run through shiki which means it gets the VS Code quality syntax highlighting mixed with the twoslash JavaScript tooling from the TypeScript website.

Setup

  • Install the dependency: yarn add docusaurus-preset-shiki-twoslash

  • Include "docusaurus-preset-shiki-twoslash" in the presets section of docusaurus.config.js

      presets: [
     [
       '@docusaurus/preset-classic',
       {
         // ...
       },
     ],
    + [
    +     'docusaurus-preset-shiki-twoslash',
    +     {
    +       themes: ["min-light", "nord"],
    +     },
    + ],
    ],
    
  • Set up light/dark mode CSS in src/css/custom.css:

[data-theme="light"] .shiki.nord {
   display: none;
}

[data-theme="dark"] .shiki.min-light {
   display: none;
}

FAQs

Package last updated on 28 Apr 2023

Did you know?

Socket

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.

Install

Related posts