Skip to content

Commit

Permalink
fix(vitepress): module exports
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed Mar 8, 2024
1 parent f8a1756 commit 7773e36
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 10 deletions.
2 changes: 2 additions & 0 deletions packages/genji-docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { defineConfig } from "vitepress";
import config from "genji-theme-vitepress/config";

// https://vitepress.dev/reference/site-config
export default defineConfig({
extends: config,
title: "Genji",
description: "The Interactive Markdown extension",
themeConfig: {
Expand Down
7 changes: 6 additions & 1 deletion packages/genji-docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import DefaultTheme from "vitepress/theme";
import { enhanceTheme } from "genji-theme-vitepress";
import "./custom.css";

export default DefaultTheme;
const Theme = enhanceTheme(DefaultTheme, {});

export default {
extends: Theme,
};
10 changes: 10 additions & 0 deletions packages/genji-docs/markdown-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This page demonstrates some of the built-in markdown extensions provided by VitePress.

```js eval {0,4}
display(() => {
const div = document.createElement("div");
div.style.width = "100px";
div.style.height = "100px";
div.style.background = "red";
return div;
});
```

## Syntax Highlighting

VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
Expand Down
9 changes: 7 additions & 2 deletions packages/genji-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"author": "https://github.com/pearmini",
"license": "MIT",
"devDependencies": {
"genji-theme-vitepress": "^0.0.2",
"vitepress": "^1.0.0-rc.44"
},
"repository": "git@github.com:pearmini/genji-notebook.git"
}
"repository": {
"type": "git",
"url": "https://github.com/pearmini/genji.git",
"directory": "packages/genji-docs"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vitepress";
import { config } from "../../src/config";
import config from "../../src/node/config.mjs";

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DefaultTheme from "vitepress/theme";
import { enhanceTheme } from "../../../src";
import { enhanceTheme } from "../../../src/client";

const Theme = enhanceTheme(DefaultTheme, {
global: {
Expand Down
8 changes: 5 additions & 3 deletions packages/genji-theme-vitepress/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "genji-theme-vitepress",
"version": "0.0.2",
"version": "0.0.3",
"type": "module",
"description": "A VitePress theme to enable Genji interactive Markdown extension.",
"main": "src/index.js",
"main": "src/client/index.js",
"exports": {
"config": "./src/config.js"
".": "src/client/index.js",
"./config": "./src/node/config.mjs"
},
"files": [
"src"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "vitepress";
import { attrs } from "./attrs";
import { attrs } from "./attrs.mjs";

export const config = defineConfig({
export default defineConfig({
markdown: {
config: (md) => {
md.use(attrs);
Expand Down

0 comments on commit 7773e36

Please sign in to comment.