Skip to content

Commit

Permalink
fix syntax highlighting and improve theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Jan 29, 2025
1 parent 6e9be18 commit b453570
Show file tree
Hide file tree
Showing 2 changed files with 1,070 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class Jule implements ILanguageRegistration {
this.scopeName = "source.jule";
this.displayName = "jule";
this.path = "";
this.grammar = JSON.parse(readFileSync("jule/jule.tmLanguage.json"));
this.grammar = JSON.parse(readFileSync("jule/jule.tmLanguage.json").toString());
}
}

const jule = new Jule();
(async () => {
const highlighter = await getHighlighter({});
await highlighter.loadLanguage(jule);
})();
const highlighter = await getHighlighter({
theme: JSON.parse(readFileSync("jule/draculaTheme.json").toString()),
});
await highlighter.loadLanguage(jule);

export default defineConfig({
srcDir: 'src',
Expand All @@ -36,6 +36,9 @@ export default defineConfig({
markdown: {
lineNumbers: true,
languages: [jule],
highlight(str, lang, attrs) {
return highlighter.codeToHtml(str, { lang: lang });
},
theme: "dracula-soft",
},

Expand Down
Loading

0 comments on commit b453570

Please sign in to comment.