-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new documentation to site to include plugins
- Loading branch information
Showing
63 changed files
with
4,502 additions
and
3,175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,9 @@ _ | |
.svelte-kit | ||
.wrangler | ||
build/ | ||
cache | ||
**/.vitepress/cache/ | ||
.vitepress/dist | ||
*.timestamp-* | ||
site | ||
.zed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"default": true, | ||
"MD013": false, | ||
"MD033": false, | ||
"MD036": false, | ||
"MD041": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# build output | ||
dist/ | ||
# generated types | ||
.astro/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
|
||
# environment variables | ||
.env | ||
.env.production | ||
|
||
# macOS-specific files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Rehype Pretty Code Documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import { | ||
transformerNotationDiff, | ||
transformerNotationFocus, | ||
transformerMetaHighlight, | ||
transformerRenderWhitespace, | ||
transformerNotationHighlight, | ||
transformerMetaWordHighlight, | ||
transformerNotationErrorLevel, | ||
transformerCompactLineOptions, | ||
transformerNotationWordHighlight, | ||
} from '@shikijs/transformers'; | ||
import remarkToc from 'remark-toc'; | ||
import rehypeSlug from 'rehype-slug'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import starlight from '@astrojs/starlight'; | ||
import { defineConfig } from 'astro/config'; | ||
import remarkSmartypants from 'remark-smartypants'; | ||
import { rehypePrettyCode } from 'rehype-pretty-code'; | ||
import { rehypeHeadingIds } from '@astrojs/markdown-remark'; | ||
import rehypeAutolinkHeadings from 'rehype-autolink-headings'; | ||
import { transformerCopyButton } from '@rehype-pretty/transformers'; | ||
import { transformerTwoslash, rendererRich } from '@shikijs/twoslash'; | ||
import moonlightTheme from './public/theme/moonlight-ii.json' with { | ||
type: 'json', | ||
}; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
markdown: { | ||
syntaxHighlight: false, | ||
shikiConfig: { | ||
transformers: [ | ||
transformerTwoslash({ renderer: rendererRich() }), | ||
transformerNotationDiff(), | ||
transformerNotationFocus(), | ||
transformerMetaHighlight(), | ||
transformerRenderWhitespace(), | ||
transformerNotationHighlight(), | ||
transformerMetaWordHighlight(), | ||
transformerNotationErrorLevel(), | ||
transformerCompactLineOptions(), | ||
transformerNotationWordHighlight(), | ||
], | ||
}, | ||
remarkPlugins: [ | ||
// @ts-expect-error | ||
remarkSmartypants, | ||
[remarkToc, { heading: 'contents', prefix: 'toc-' }], | ||
], | ||
rehypePlugins: [ | ||
rehypeHeadingIds, | ||
rehypeSlug, | ||
[rehypeAutolinkHeadings, { behavior: 'wrap' }], | ||
[ | ||
rehypePrettyCode, | ||
{ | ||
keepBackground: true, | ||
theme: moonlightTheme, | ||
transformers: [ | ||
transformerCopyButton({ | ||
visibility: 'always', | ||
feedbackDuration: 2_500, | ||
}), | ||
], | ||
}, | ||
], | ||
rehypeSlug, | ||
], | ||
}, | ||
integrations: [ | ||
starlight({ | ||
expressiveCode: false, | ||
title: 'Rehype Pretty', | ||
favicon: '/favicon.ico', | ||
social: { | ||
github: 'https://github.com/rehype-pretty/rehype-pretty-code', | ||
}, | ||
lastUpdated: true, | ||
customCss: [ | ||
'./src/styles/index.css', | ||
'./src/styles/tailwind.css', | ||
'@shikijs/twoslash/style-rich.css', | ||
], | ||
plugins: [], | ||
head: [ | ||
{ | ||
tag: 'script', | ||
attrs: { src: '/scripts/anchor-targets.js' }, | ||
}, | ||
], | ||
sidebar: [ | ||
{ | ||
label: 'Rehype Pretty Code', | ||
link: '/', | ||
}, | ||
{ | ||
label: 'Plugins', | ||
autogenerate: { | ||
directory: 'plugins', | ||
collapsed: false, | ||
}, | ||
}, | ||
{ | ||
label: 'Examples', | ||
link: '/examples', | ||
}, | ||
], | ||
}), | ||
tailwind({ applyBaseStyles: false }), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "docs", | ||
"type": "module", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"dev": "NODE_NO_WARNINGS=1 astro dev", | ||
"start": "astro dev", | ||
"build": "astro check && astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/mdx": "^3.1.2", | ||
"@astrojs/starlight": "^0.24.4", | ||
"@astrojs/starlight-tailwind": "^2.0.3", | ||
"@astrojs/tailwind": "^5.1.0", | ||
"@rehype-pretty/transformers": "workspace:*", | ||
"astro": "^4.11.1", | ||
"rehype-autolink-headings": "^7.1.0", | ||
"rehype-pretty-code": "workspace:*", | ||
"rehype-slug": "^6.0.0", | ||
"rehype-stringify": "^10.0.0", | ||
"remark-toc": "^9.0.0", | ||
"sharp": "^0.33.4", | ||
"shiki": "^1.9.1", | ||
"tailwindcss": "^3.4.4" | ||
}, | ||
"devDependencies": { | ||
"@astrojs/check": "^0.7.0", | ||
"@shikijs/transformers": "^1.9.1", | ||
"@shikijs/twoslash": "^1.9.1", | ||
"@total-typescript/ts-reset": "^0.5.1", | ||
"@types/node": "^20.14.9", | ||
"typescript": "^5.5.2" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Add target="_blank" to all external links | ||
*/ | ||
|
||
window.addEventListener('DOMContentLoaded', () => { | ||
const externalLinks = document.querySelectorAll('a[href^="http"]'); | ||
try { | ||
for (const link of externalLinks) { | ||
link.setAttribute('target', '_blank'); | ||
link.setAttribute('rel', 'noopener noreferrer'); | ||
} | ||
} catch { | ||
/* empty */ | ||
} | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* https://github.com/total-typescript/ts-reset */ | ||
import '@total-typescript/ts-reset/dom'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineCollection } from 'astro:content'; | ||
import { docsSchema } from '@astrojs/starlight/schema'; | ||
|
||
export const collections = { | ||
docs: defineCollection({ schema: docsSchema() }), | ||
}; |
Oops, something went wrong.