Socket
Book a DemoInstallSign in
Socket

@jonny/docusaurus-preset-shiki-twoslash

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jonny/docusaurus-preset-shiki-twoslash

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

latest
Source
npmnpm
Version
1.1.36
Version published
Weekly downloads
17
-26.09%
Maintainers
1
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 16 Oct 2021

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