Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom shiki highlighting #98

Merged
merged 2 commits into from
Nov 16, 2023
Merged
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ bin/
repos/
external/

# shiki
src/public/shiki

# embeddings
src/frontends/
src/frontends
Expand Down
28 changes: 25 additions & 3 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CssCleanup, baseCleanup } from "../node_modules/@shopware-docs/vitepres
import Inspect from "vite-plugin-inspect";
import liveReload from 'vite-plugin-live-reload'
import { withMermaid } from "vitepress-plugin-mermaid";
import topLevelAwait from "vite-plugin-top-level-await";

import {copyAdditionalAssets, createSitemap, storeRedirects} from "../node_modules/@shopware-docs/vitepress/src/helpers";
import {generateMarkdownFromStoplight, getStoplightUrls} from "./helpers/stoplight";
Expand Down Expand Up @@ -421,7 +422,13 @@ export default withMermaid(defineConfigWithTheme<ThemeConfig>({
'../node_modules/@shopware-docs/**/*.*',
'../node_modules/vitepress-shopware-docs/**/*.*',
]),
topLevelAwait(),
],
worker: {
plugins: [
topLevelAwait()
]
},
/*optimizeDeps: {
//disabled: true,
include: [
Expand All @@ -432,8 +439,8 @@ export default withMermaid(defineConfigWithTheme<ThemeConfig>({
],
exclude: [
'instantsearch.js',
]
}*/
],
},*/
build: {
rollupOptions: {
external: [
Expand Down Expand Up @@ -481,6 +488,21 @@ export default withMermaid(defineConfigWithTheme<ThemeConfig>({
* Copy additional assets not present in the assets or public dir.
*/
await copyAdditionalAssets([
{
src: '../node_modules/shiki/languages',
dst: 'shiki/languages',
},
{
src: '../node_modules/shiki/themes',
dst: 'shiki/themes',
},
{
src: '../node_modules/shiki/dist',
dst: 'shiki/dist',
ext: [
'.wasm'
],
},
{
src: './resources/meteor-icon-kit/public/icons/regular',
dst: 'icons/regular',
Expand All @@ -494,7 +516,7 @@ export default withMermaid(defineConfigWithTheme<ThemeConfig>({
dst: 'docs/products/extensions/b2b-suite/guides/example-plugins',
ext: [
'.zip'
]
],
}
]);

Expand Down
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"devDependencies": {
"@docsearch/css": "^3.5.2",
"@docsearch/js": "^3.5.2",
"@mdit-vue/plugin-component": "^1.0.0",
"@mdit-vue/plugin-frontmatter": "^1.0.0",
"@mdit-vue/plugin-headers": "^1.0.0",
"@mdit-vue/shared": "^1.0.0",
"@mermaid-js/mermaid-mindmap": "^9.3.0",
"@originjs/vite-plugin-require-context": "^1.0.9",
"@playwright/test": "1.39.0",
Expand Down Expand Up @@ -69,6 +73,10 @@
"jest-expect-message": "^1.1.3",
"jest-image-snapshot": "^6.2.0",
"lorem-ipsum": "^2.0.8",
"markdown-it": "^13.0.2",
"markdown-it-anchor": "^8.6.7",
"markdown-it-attrs": "^4.1.6",
"markdown-it-emoji": "^2.0.2",
"mermaid": "^10.5.1",
"oas-normalize": "^11.0.1",
"openapi-types": "^12.1.3",
Expand All @@ -79,6 +87,8 @@
"sass": "^1.69.4",
"seedrandom": "^3.0.5",
"shell-escape": "^0.2.0",
"shiki": "^0.14.5",
"shiki-processor": "^0.1.3",
"sitemap": "^7.1.1",
"slugify": "^1.6.6",
"storybook": "^7.5.1",
Expand All @@ -89,6 +99,8 @@
"uuid": "^9.0.1",
"vite-plugin-inspect": "^0.7.40",
"vite-plugin-live-reload": "^3.0.2",
"vite-plugin-top-level-await": "^1.3.1",
"vite-plugin-wasm": "^3.2.2",
"vitepress-plugin-mermaid": "^2.0.15",
"vitest": "^0.34.6",
"vue-instantsearch": "^4.11.0"
Expand Down
Loading
Loading