Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,8 +13,6 @@ jobs:

- run: npm ci

- run: cp -rf patches/shiki-twoslash/* node_modules/shiki-twoslash/dist/

- run: npm run build

- name: deploy
Expand Down
38 changes: 15 additions & 23 deletions docusaurus.config.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,8 +2,7 @@
// Note: type annotations allow type checking and IDEs autocompletion

const fs = require('node:fs');
const remarkShikiTwoSlash = require('remark-shiki-twoslash').default;
const rehypeRaw = require('rehype-raw').default;
const rehypeShiki = require('@shikijs/rehype').default;

const rehypeRawOptions ={
passThrough: ['mdxjsEsm', 'mdxJsxTextElement', 'mdxJsxFlowElement', 'mdxFlowExpression']
Expand DownExpand Up@@ -41,33 +40,26 @@ const config ={
docs:{
breadcrumbs: false,
sidebarPath: require.resolve('./sidebars.js'),
rehypePlugins: [[rehypeRaw, rehypeRawOptions]], // fix for MDX compilation courtesy of kamranayub: https://github.com/shikijs/twoslash/issues/125#issuecomment-2692325341
beforeDefaultRehypePlugins: [
[
rehypeShiki,
{
theme: require('./src/theme/monokai-patched.json'),
langs: [
'c',
'cpp',
'lua',
require('./src/theme/Pluto.tmLanguage.json'),
],
}
],
],
},
theme:{
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
[
'docusaurus-preset-shiki-twoslash',
{
theme: 'monokai-patched',
langs: [
'c',
'cpp',
'lua',
{
id: 'pluto',
name: 'pluto',
scopeName: 'source.pluto',
path: require.resolve('./src/theme/Pluto.tmLanguage.json'),
}
],
themes: [
require('./src/theme/monokai-patched.json'),
],
}
],
],

themeConfig:
Expand Down
Loading