shikijs/twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples

TypeScript

1,142

371 commits

updated Feb 19, 2024

See the code

README

[!NOTE] Twoslash has been moved to the new repository twoslashes/twoslash with some refactoring and improvements. The Shiki v1.0 integration is now in Shiki's monorepo as a transformer, which means Twoslash will now work everywhere Shiki is supported. We will make Shiki supports more high-level tools so Twoslash could later inherit that.

This repository is for Shiki v0.x integration with Twoslash. As we port more integrations to the new format, this repo will fade out gradually.

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible statically generated code samples.

See the user-facing docs at: https://shikijs.github.io/twoslash/

This Repo

The majority of this repo uses pnpm, the rest yarn. There are four main areas of interest:

  • packages, the shiki meets twoslash plugins for markdown renderers and static site generators
  • site, the docs micro-site
  • examples, example static site generator projects which use the plugins
  • extensions, right now, just the vscode extension for twoslash code samples

Packages

The site extensions and examples are excluded from the workspace. To work on those, cd to their folders and read instructions.

Otherwise:

git clone https://github.com/shikijs/twoslash
cd twoslash

pnpm i
pnpm bootstrap
pnpm test

Then see the contributing for advice and the vision file for the long-term perspective.

Plugins

Markdown Renderers

Root Abstractions

Deploys

Run: pnpm deploy.

docusaurus
javascript
markdown-it
markdown-it-plugin
remark
remark-plugin
shiki
shiki-twoslash
typescript

shikijs/twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples

TypeScript

1,142

371 commits

updated Feb 19, 2024

See the code

README

[!NOTE] Twoslash has been moved to the new repository twoslashes/twoslash with some refactoring and improvements. The Shiki v1.0 integration is now in Shiki's monorepo as a transformer, which means Twoslash will now work everywhere Shiki is supported. We will make Shiki supports more high-level tools so Twoslash could later inherit that.

This repository is for Shiki v0.x integration with Twoslash. As we port more integrations to the new format, this repo will fade out gradually.

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible statically generated code samples.

See the user-facing docs at: https://shikijs.github.io/twoslash/

This Repo

The majority of this repo uses pnpm, the rest yarn. There are four main areas of interest:

  • packages, the shiki meets twoslash plugins for markdown renderers and static site generators
  • site, the docs micro-site
  • examples, example static site generator projects which use the plugins
  • extensions, right now, just the vscode extension for twoslash code samples

Packages

The site extensions and examples are excluded from the workspace. To work on those, cd to their folders and read instructions.

Otherwise:

git clone https://github.com/shikijs/twoslash
cd twoslash

pnpm i
pnpm bootstrap
pnpm test

Then see the contributing for advice and the vision file for the long-term perspective.

Plugins

Markdown Renderers

Root Abstractions

Deploys

Run: pnpm deploy.

docusaurus
javascript
markdown-it
markdown-it-plugin
remark
remark-plugin
shiki
shiki-twoslash
typescript

Project health

Overall

3.3/10

Maintained

0/10

Code review

2/10
OpenSSF Scorecard

Latest release

3.1.2 · Apr 28, 2023

Releases this year

0

Significant stargazers

(top 24 of 47)

Gregor Martynus

1,818 followers · starred Aug 2021

Linus Unnebäck

1,062 followers · starred Apr 2023

btea

309 followers · starred Mar 2024

Alexandre ZANNI

2,406 followers · starred Sep 2024