Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shikijs/twoslash
You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://github.com/shikijs/twoslash
docusaurus javascript markdown-it markdown-it-plugin remark remark-plugin shiki shiki-twoslash typescript
Last synced: 2 days ago
JSON representation
You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
- Host: GitHub
- URL: https://github.com/shikijs/twoslash
- Owner: shikijs
- License: mit
- Created: 2021-05-26T07:27:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-19T12:13:47.000Z (11 months ago)
- Last Synced: 2025-01-17T03:04:33.530Z (9 days ago)
- Topics: docusaurus, javascript, markdown-it, markdown-it-plugin, remark, remark-plugin, shiki, shiki-twoslash, typescript
- Language: TypeScript
- Homepage: https://shikijs.github.io/twoslash/
- Size: 5.86 MB
- Stars: 1,100
- Watchers: 6
- Forks: 54
- Open Issues: 65
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - twoslash
README
> [!NOTE]
> Twoslash has been moved to the new repository [twoslashes/twoslash](https://github.com/twoslashes/twoslash) with some refactoring and improvements. The Shiki v1.0 integration is now [in Shiki's monorepo](https://shiki.style/packages/twoslash) 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
### PackagesThe `site` `extensions` and `examples` are excluded from the workspace. To work on those, `cd` to their folders and read instructions.
Otherwise:
```sh
git clone https://github.com/shikijs/twoslash
cd twoslashpnpm i
pnpm bootstrap
pnpm test
```Then see the contributing [for advice](./CONTRIBUTING.md) and the vision file for the [long-term perspective](./VISION.md).
#### Plugins
- [`docusaurus-preset-shiki-twoslash`](packages/docusaurus-preset-shiki-twoslash) - for Docusaurus
- [`eleventy-plugin-shiki-twoslash`](packages/eleventy-plugin-shiki-twoslash) - For 11ty
- [`gatsby-remark-shiki-twoslash`](packages/gatsby-remark-shiki-twoslash) - For Gatsby
- [`hexo-shiki-twoslash`](packages/hexo-shiki-twoslash) - For Hexo
- [`vuepress-plugin-shiki-twoslash`](packages/vuepress-plugin-shiki-twoslash) - For VuePress#### Markdown Renderers
- [`markdown-it-shiki-twoslash`](packages/markdown-it-shiki-twoslash) - For Markdown-It
- [`remark-shiki-twoslash`](packages/remark-shiki-twoslash) - For Remark#### Root Abstractions
- [`shiki-twoslash`](packages/shiki-twoslash) - Provides all the building blocks for above
- [`twoslash-cli`](packages/twoslash-cli) - A CLI for converting md/ts/tsx/js/jsx files to HTML###### Deploys
Run: `pnpm deploy`.