-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a47beb
commit ce6066e
Showing
25 changed files
with
3,677 additions
and
238 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
/* eslint-env node */ | ||
|
||
import { getHighlighter, BUNDLED_LANGUAGES } from 'shiki' | ||
import Nextra from 'nextra' | ||
import { join, dirname } from 'path' | ||
import { fileURLToPath } from 'url' | ||
import rehypeHighlightCodeBlock from '@mapbox/rehype-highlight-code-block' | ||
import { fromLezer } from 'hast-util-from-lezer' | ||
import { parser as rimuParser } from 'rimu-lezer' | ||
import { toHtml } from 'hast-util-to-html' | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)) | ||
const lezerParsers = { | ||
rimu: rimuParser, | ||
} | ||
|
||
const withNextra = Nextra({ | ||
theme: 'nextra-theme-docs', | ||
themeConfig: './theme.config.js', | ||
unstable_staticImage: true, | ||
codeHighlight: false, | ||
mdxOptions: { | ||
rehypePrettyCodeOptions: { | ||
getHighlighter: (options) => | ||
getHighlighter({ | ||
...options, | ||
langs: [ | ||
...BUNDLED_LANGUAGES, | ||
{ | ||
id: 'rimu', | ||
scopeName: 'source.rimu', | ||
aliases: [], | ||
path: join(__dirname, '../syntax/textmate/rimu.tmLanguage.json'), | ||
}, | ||
], | ||
}), | ||
}, | ||
rehypePlugins: [ | ||
[ | ||
rehypeHighlightCodeBlock, | ||
{ | ||
highlight, | ||
}, | ||
], | ||
], | ||
}, | ||
}) | ||
|
||
const config = withNextra() | ||
|
||
export default config | ||
|
||
function highlight(code, lang) { | ||
const parser = lezerParsers[lang] | ||
if (parser == null) return code | ||
const tree = parser.parse(code) | ||
const element = fromLezer(code, tree) | ||
return toHtml(element) | ||
} |
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,5 @@ | ||
import '../styles.css' | ||
|
||
export default function MyApp({ Component, pageProps }) { | ||
return <Component {...pageProps} /> | ||
} |
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
Oops, something went wrong.
ce6066e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rimu-docs – ./docs
rimu-docs-git-main-ahdinosaur.vercel.app
rimu-docs-ahdinosaur.vercel.app
rimu-docs.vercel.app
www.rimu.dev
rimu.dev