From 629a74d28bfb3f6d923af422b19d322309a0f9af Mon Sep 17 00:00:00 2001 From: toreis-up Date: Mon, 24 Nov 2025 15:43:47 +0900 Subject: [PATCH 01/14] sync: docs --- .gitignore | 1 + .npmrc | 1 + .vitepress/addons.ts | 217 + .vitepress/config.js | 284 - .vitepress/config.ts | 161 + .vitepress/customizations.ts | 66 + .vitepress/pages.ts | 107 + .vitepress/scripts/prepare.js | 8 - .vitepress/showcases.ts | 270 +- .vitepress/sidebar-gen.ts | 137 + .vitepress/theme/Layout.vue | 168 - .vitepress/theme/NotFound.vue | 20 - .vitepress/theme/components/AddonGallery.vue | 18 + .vitepress/theme/components/AddonInfo.vue | 57 + .../theme/components/AlgoliaSearchBox.vue | 173 - .../theme/components/BooleanDisplay.vue | 27 - .../theme/components/DarkModeSwitch.vue | 13 - .../theme/components/{demo => }/Demo.vue | 79 +- .vitepress/theme/components/DemoContainer.vue | 18 - .vitepress/theme/components/DemoEditor.vue | 39 + .../theme/components/{demo => }/DemoSlide.vue | 13 +- .vitepress/theme/components/EditLink.vue | 39 - .vitepress/theme/components/Environment.vue | 25 +- .vitepress/theme/components/FeatureTag.vue | 79 + .../theme/components/FeaturesAnimation.vue | 13 + .../components/FeaturesAnimationInner.vue | 38 + .../theme/components/FeaturesOverview.vue | 48 + .vitepress/theme/components/Home.vue | 23 - .vitepress/theme/components/HomeFeatures.vue | 137 - .vitepress/theme/components/HomeFooter.vue | 40 - .vitepress/theme/components/HomeHero.vue | 174 - .vitepress/theme/components/LandingPage.vue | 24 + .vitepress/theme/components/LastUpdated.vue | 69 - .vitepress/theme/components/Layout.vue | 58 + .vitepress/theme/components/LinkCard.vue | 61 + .vitepress/theme/components/LinkInline.vue | 46 + .vitepress/theme/components/NavBar.vue | 111 - .vitepress/theme/components/NavBarTitle.vue | 43 - .../theme/components/NavDropdownLink.vue | 131 - .../theme/components/NavDropdownLinkItem.vue | 76 - .vitepress/theme/components/NavLink.vue | 61 - .vitepress/theme/components/NavLinks.vue | 48 - .../theme/components/NextAndPrevLinks.vue | 87 - .vitepress/theme/components/Note.vue | 5 - .vitepress/theme/components/Page.vue | 48 - .vitepress/theme/components/PageFooter.vue | 42 - .vitepress/theme/components/SeeAlso.vue | 12 + .vitepress/theme/components/ShowCaseInfo.vue | 34 +- .vitepress/theme/components/ShowCases.vue | 2 +- .vitepress/theme/components/SideBar.vue | 57 - .vitepress/theme/components/SideBarLink.ts | 96 - .vitepress/theme/components/SideBarLinks.vue | 12 - .../theme/components/SlideContainer.vue | 47 + .../components/{Tweet.vue => TheTweet.vue} | 29 +- .vitepress/theme/components/ThemeGallery.vue | 6 +- .vitepress/theme/components/ThemeInfo.vue | 28 +- .../theme/components/ToggleSideBarButton.vue | 46 - .../theme/components/WorkingInProgress.vue | 35 - .../theme/components/demo/DemoEditor.vue | 30 - .../theme/components/icons/ArrowLeft.vue | 5 - .../theme/components/icons/ArrowRight.vue | 5 - .vitepress/theme/components/icons/Moon.vue | 8 - .../theme/components/icons/OutboundLink.vue | 31 - .vitepress/theme/components/icons/README.md | 1 - .vitepress/theme/components/icons/Sun.vue | 28 - .../theme/composables/activeSidebarLink.ts | 131 - .vitepress/theme/composables/editLink.ts | 90 - .vitepress/theme/composables/nav.ts | 59 - .vitepress/theme/composables/navLink.ts | 58 - .../theme/composables/nextAndPrevLinks.ts | 47 - .vitepress/theme/composables/repo.ts | 47 - .vitepress/theme/composables/sideBar.ts | 72 - .vitepress/theme/composables/url.ts | 15 - .vitepress/theme/composables/versions.ts | 1 - .vitepress/theme/config.ts | 129 - .vitepress/theme/index.ts | 27 +- .vitepress/theme/styles/code.css | 120 - .vitepress/theme/styles/custom-blocks.css | 67 - .vitepress/theme/styles/custom.css | 23 + .vitepress/theme/styles/demo.css | 170 + .vitepress/theme/styles/layout.css | 312 - .vitepress/theme/styles/sidebar-links.css | 102 - .vitepress/theme/styles/vars.css | 230 +- .vitepress/theme/support/sideBar.ts | 67 - .vitepress/theme/utils.ts | 77 - .vitepress/themes.ts | 285 +- .vitepress/utils.ts | 51 + README.md | 21 +- TRANSLATIONS.md | 94 - builtin/cli.md | 96 + builtin/components.md | 356 +- builtin/layouts.md | 154 +- components.d.ts | 256 + custom/config-code-runners.md | 78 + custom/config-context-menu.md | 40 + custom/config-fonts.md | 105 + custom/config-highlighter.md | 72 + custom/config-katex.md | 9 +- custom/config-mermaid.md | 38 +- custom/config-monaco.md | 120 +- custom/config-parser.md | 232 + custom/config-routes.md | 28 + custom/config-shortcuts.md | 24 +- custom/config-transformers.md | 43 + custom/config-unocss.md | 46 + custom/config-vite.md | 72 +- custom/config-vue.md | 18 +- custom/config-windicss.md | 49 - custom/directory-structure.md | 140 +- custom/fonts.md | 105 - custom/global-layers.md | 62 - custom/highlighters.md | 68 - custom/index.md | 215 +- custom/vue-context.md | 78 - features/block-frontmatter.md | 39 + features/build-with-pdf.md | 42 + features/bundle-remote-assets.md | 29 + features/canvas-size.md | 32 + features/click-marker.md | 31 + features/code-block-line-numbers.md | 32 + features/code-block-max-height.md | 32 + features/code-groups.md | 156 + features/direction-variant.md | 31 + features/draggable.md | 82 + features/drawing.md | 74 + features/eject-theme.md | 27 + features/frontmatter-merging.md | 49 + features/global-layers.md | 99 + features/icons.md | 62 + features/import-snippet.md | 48 + features/importing-slides.md | 69 + features/index.data.ts | 61 + features/index.md | 93 + features/latex.md | 80 + features/line-highlighting.md | 57 + features/mdc.md | 31 + features/mermaid.md | 37 + features/monaco-editor.md | 49 + features/monaco-run.md | 44 + features/monaco-write.md | 22 + features/notes-auto-ruby.md | 30 + features/og-image.md | 41 + features/plantuml.md | 26 + features/prettier-plugin.md | 59 + features/recording.md | 28 + features/remote-access.md | 79 + features/rough-marker.md | 46 + features/seo-meta.md | 36 + features/shiki-magic-move.md | 53 + features/side-editor.md | 17 + features/slide-hook.md | 33 + features/slide-scope-style.md | 44 + features/slot-sugar.md | 83 + features/timer.md | 23 + features/transform-component.md | 29 + features/twoslash.md | 37 + features/vscode-extension.md | 80 + features/zoom-slide.md | 33 + guide/animations.md | 423 +- guide/component.md | 36 + guide/drawing.md | 68 - guide/editors.md | 43 - guide/exporting.md | 234 +- guide/faq.md | 173 +- guide/global-context.md | 165 + guide/hosting.md | 227 +- guide/index.md | 201 +- guide/install.md | 67 - guide/layout.md | 32 + guide/navigation.md | 33 - guide/presenter-mode.md | 5 - guide/recording.md | 17 - guide/syntax.md | 493 +- guide/theme-addon.md | 62 + guide/ui.md | 86 + guide/why.md | 117 +- guide/write-addon.md | 48 + guide/write-layout.md | 43 + guide/write-theme.md | 113 + index.md | 13 +- netlify.toml | 51 +- package.json | 60 +- pnpm-lock.yaml | 6572 ++++++++++++----- public/assets/code-groups-demo.png | Bin 0 -> 221097 bytes public/logo.svg | 2 +- resources/addon-gallery.md | 32 + resources/covers.md | 12 +- resources/learning.md | 13 +- resources/showcases.md | 10 + resources/theme-gallery.md | 32 + showcases.md | 10 - themes/gallery.md | 24 - themes/use.md | 57 - themes/write-a-theme.md | 149 - tsconfig.json | 25 +- uno.config.ts | 28 + vite.config.ts | 75 +- vite.config.ts.timestamp-1763953769211.js | 495 ++ windi.config.ts | 34 - 199 files changed, 13427 insertions(+), 7852 deletions(-) create mode 100644 .vitepress/addons.ts delete mode 100644 .vitepress/config.js create mode 100644 .vitepress/config.ts create mode 100644 .vitepress/customizations.ts create mode 100644 .vitepress/pages.ts delete mode 100644 .vitepress/scripts/prepare.js create mode 100644 .vitepress/sidebar-gen.ts delete mode 100644 .vitepress/theme/Layout.vue delete mode 100644 .vitepress/theme/NotFound.vue create mode 100644 .vitepress/theme/components/AddonGallery.vue create mode 100644 .vitepress/theme/components/AddonInfo.vue delete mode 100644 .vitepress/theme/components/AlgoliaSearchBox.vue delete mode 100644 .vitepress/theme/components/BooleanDisplay.vue delete mode 100644 .vitepress/theme/components/DarkModeSwitch.vue rename .vitepress/theme/components/{demo => }/Demo.vue (64%) delete mode 100644 .vitepress/theme/components/DemoContainer.vue create mode 100644 .vitepress/theme/components/DemoEditor.vue rename .vitepress/theme/components/{demo => }/DemoSlide.vue (59%) delete mode 100644 .vitepress/theme/components/EditLink.vue create mode 100644 .vitepress/theme/components/FeatureTag.vue create mode 100644 .vitepress/theme/components/FeaturesAnimation.vue create mode 100644 .vitepress/theme/components/FeaturesAnimationInner.vue create mode 100644 .vitepress/theme/components/FeaturesOverview.vue delete mode 100644 .vitepress/theme/components/Home.vue delete mode 100644 .vitepress/theme/components/HomeFeatures.vue delete mode 100644 .vitepress/theme/components/HomeFooter.vue delete mode 100644 .vitepress/theme/components/HomeHero.vue create mode 100644 .vitepress/theme/components/LandingPage.vue delete mode 100644 .vitepress/theme/components/LastUpdated.vue create mode 100644 .vitepress/theme/components/Layout.vue create mode 100644 .vitepress/theme/components/LinkCard.vue create mode 100644 .vitepress/theme/components/LinkInline.vue delete mode 100644 .vitepress/theme/components/NavBar.vue delete mode 100644 .vitepress/theme/components/NavBarTitle.vue delete mode 100644 .vitepress/theme/components/NavDropdownLink.vue delete mode 100644 .vitepress/theme/components/NavDropdownLinkItem.vue delete mode 100644 .vitepress/theme/components/NavLink.vue delete mode 100644 .vitepress/theme/components/NavLinks.vue delete mode 100644 .vitepress/theme/components/NextAndPrevLinks.vue delete mode 100644 .vitepress/theme/components/Note.vue delete mode 100644 .vitepress/theme/components/Page.vue delete mode 100644 .vitepress/theme/components/PageFooter.vue create mode 100644 .vitepress/theme/components/SeeAlso.vue delete mode 100644 .vitepress/theme/components/SideBar.vue delete mode 100644 .vitepress/theme/components/SideBarLink.ts delete mode 100644 .vitepress/theme/components/SideBarLinks.vue create mode 100644 .vitepress/theme/components/SlideContainer.vue rename .vitepress/theme/components/{Tweet.vue => TheTweet.vue} (56%) delete mode 100644 .vitepress/theme/components/ToggleSideBarButton.vue delete mode 100644 .vitepress/theme/components/WorkingInProgress.vue delete mode 100644 .vitepress/theme/components/demo/DemoEditor.vue delete mode 100644 .vitepress/theme/components/icons/ArrowLeft.vue delete mode 100644 .vitepress/theme/components/icons/ArrowRight.vue delete mode 100644 .vitepress/theme/components/icons/Moon.vue delete mode 100644 .vitepress/theme/components/icons/OutboundLink.vue delete mode 100644 .vitepress/theme/components/icons/README.md delete mode 100644 .vitepress/theme/components/icons/Sun.vue delete mode 100644 .vitepress/theme/composables/activeSidebarLink.ts delete mode 100644 .vitepress/theme/composables/editLink.ts delete mode 100644 .vitepress/theme/composables/nav.ts delete mode 100644 .vitepress/theme/composables/navLink.ts delete mode 100644 .vitepress/theme/composables/nextAndPrevLinks.ts delete mode 100644 .vitepress/theme/composables/repo.ts delete mode 100644 .vitepress/theme/composables/sideBar.ts delete mode 100644 .vitepress/theme/composables/url.ts delete mode 100644 .vitepress/theme/composables/versions.ts delete mode 100644 .vitepress/theme/config.ts delete mode 100644 .vitepress/theme/styles/code.css delete mode 100644 .vitepress/theme/styles/custom-blocks.css create mode 100644 .vitepress/theme/styles/custom.css create mode 100644 .vitepress/theme/styles/demo.css delete mode 100644 .vitepress/theme/styles/layout.css delete mode 100644 .vitepress/theme/styles/sidebar-links.css delete mode 100644 .vitepress/theme/support/sideBar.ts delete mode 100644 .vitepress/theme/utils.ts create mode 100644 .vitepress/utils.ts delete mode 100644 TRANSLATIONS.md create mode 100644 builtin/cli.md create mode 100644 components.d.ts create mode 100644 custom/config-code-runners.md create mode 100644 custom/config-context-menu.md create mode 100644 custom/config-fonts.md create mode 100644 custom/config-highlighter.md create mode 100644 custom/config-parser.md create mode 100644 custom/config-routes.md create mode 100644 custom/config-transformers.md create mode 100644 custom/config-unocss.md delete mode 100644 custom/config-windicss.md delete mode 100644 custom/fonts.md delete mode 100644 custom/global-layers.md delete mode 100644 custom/highlighters.md delete mode 100644 custom/vue-context.md create mode 100644 features/block-frontmatter.md create mode 100644 features/build-with-pdf.md create mode 100644 features/bundle-remote-assets.md create mode 100644 features/canvas-size.md create mode 100644 features/click-marker.md create mode 100644 features/code-block-line-numbers.md create mode 100644 features/code-block-max-height.md create mode 100644 features/code-groups.md create mode 100644 features/direction-variant.md create mode 100644 features/draggable.md create mode 100644 features/drawing.md create mode 100644 features/eject-theme.md create mode 100644 features/frontmatter-merging.md create mode 100644 features/global-layers.md create mode 100644 features/icons.md create mode 100644 features/import-snippet.md create mode 100644 features/importing-slides.md create mode 100644 features/index.data.ts create mode 100644 features/index.md create mode 100644 features/latex.md create mode 100644 features/line-highlighting.md create mode 100644 features/mdc.md create mode 100644 features/mermaid.md create mode 100644 features/monaco-editor.md create mode 100644 features/monaco-run.md create mode 100644 features/monaco-write.md create mode 100644 features/notes-auto-ruby.md create mode 100644 features/og-image.md create mode 100644 features/plantuml.md create mode 100644 features/prettier-plugin.md create mode 100644 features/recording.md create mode 100644 features/remote-access.md create mode 100644 features/rough-marker.md create mode 100644 features/seo-meta.md create mode 100644 features/shiki-magic-move.md create mode 100644 features/side-editor.md create mode 100644 features/slide-hook.md create mode 100644 features/slide-scope-style.md create mode 100644 features/slot-sugar.md create mode 100644 features/timer.md create mode 100644 features/transform-component.md create mode 100644 features/twoslash.md create mode 100644 features/vscode-extension.md create mode 100644 features/zoom-slide.md create mode 100644 guide/component.md delete mode 100644 guide/drawing.md delete mode 100644 guide/editors.md create mode 100644 guide/global-context.md delete mode 100644 guide/install.md create mode 100644 guide/layout.md delete mode 100644 guide/navigation.md delete mode 100644 guide/presenter-mode.md delete mode 100644 guide/recording.md create mode 100644 guide/theme-addon.md create mode 100644 guide/ui.md create mode 100644 guide/write-addon.md create mode 100644 guide/write-layout.md create mode 100644 guide/write-theme.md create mode 100644 public/assets/code-groups-demo.png create mode 100644 resources/addon-gallery.md create mode 100644 resources/showcases.md create mode 100644 resources/theme-gallery.md delete mode 100644 showcases.md delete mode 100644 themes/gallery.md delete mode 100644 themes/use.md delete mode 100644 themes/write-a-theme.md create mode 100644 uno.config.ts create mode 100644 vite.config.ts.timestamp-1763953769211.js delete mode 100644 windi.config.ts diff --git a/.gitignore b/.gitignore index b186e943..c62e6a42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist .vitepress/@slidev +.vitepress/cache diff --git a/.npmrc b/.npmrc index bf2e7648..cf040424 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ shamefully-hoist=true +strict-peer-dependencies=false diff --git a/.vitepress/addons.ts b/.vitepress/addons.ts new file mode 100644 index 00000000..1cf7009d --- /dev/null +++ b/.vitepress/addons.ts @@ -0,0 +1,217 @@ +import type { ThemeInfo } from './themes' + +export type AddonInfo = Omit + +export const official: AddonInfo[] = [ + { + id: '', + link: '#', + name: 'Work in Progress', + description: '', + tags: [], + author: { + name: '', + }, + }, +] + +export const community: AddonInfo[] = [ + { + id: 'slidev-addon-python-runner', + name: 'Python Runner', + description: 'Run actual Python code in your slides', + tags: ['Code runner'], + author: { + name: '_Kerman', + link: 'https://github.com/KermanX', + }, + repo: 'https://github.com/KermanX/slidev-addon-python-runner', + }, + { + id: 'slidev-addon-tldraw', + name: 'tldraw', + description: 'Embed tldraw diagrams directly in Slidev, with in-slide editing support', + tags: ['Integration', 'Diagram'], + author: { + name: 'Albert Brand', + link: 'https://github.com/AlbertBrand', + }, + repo: 'https://github.com/AlbertBrand/slidev-addon-tldraw', + }, + { + id: 'slidev-addon-typst', + name: 'Typst', + description: 'Typst addon for Slidev', + tags: ['Integration', 'Diagram'], + author: { + name: 'Shigma', + link: 'https://github.com/shigma', + }, + repo: 'https://github.com/shigma/slidev-addon-typst', + }, + { + id: 'slidev-addon-fancy-arrow', + name: 'Fancy Arrow', + description: 'Hand drawn arrows with various styling and positioning options', + tags: ['Component'], + author: { + name: 'whitphx', + link: 'https://github.com/whitphx', + }, + repo: 'https://github.com/whitphx/slidev-addon-fancy-arrow', + }, + { + id: 'slidev-addon-sync', + name: 'Remote Sync', + description: 'Sync component for Slidev static build that uses a SSE or WS server', + tags: ['Remote control', 'Navigation'], + author: { + name: 'Tony Cabaye', + link: 'https://github.com/tonai', + }, + repo: 'https://github.com/Smile-SA/slidev-addon-sync', + }, + { + id: 'slidev-addon-tikzjax', + name: 'tikzjax', + description: 'Compile TikZ/Chemfig/... to SVG and display them in Slidev', + tags: ['Integration', 'Diagram'], + author: { + name: 'Ethan Goh', + link: 'https://github.com/7086cmd', + }, + repo: 'https://github.com/7086cmd/slidev-addon-tikzjax', + }, + { + id: 'slidev-component-pager', + name: 'Pager', + description: 'Show current page and total page number', + tags: ['Component', 'Navigation'], + author: { + name: 'Tony Cabaye', + link: 'https://github.com/tonai', + }, + repo: 'https://github.com/Smile-SA/slidev-component-pager', + }, + { + id: 'slidev-component-poll', + name: 'Poll and Quiz', + description: 'Poll and Quiz components for Slidev', + tags: ['Component'], + author: { + name: 'Tony Cabaye', + link: 'https://github.com/tonai', + }, + repo: 'https://github.com/Smile-SA/slidev-component-poll', + }, + { + id: 'slidev-component-progress', + name: 'Progress', + description: 'Show interactive progress bar for Slidev', + tags: ['Tool', 'Navigation'], + author: { + name: 'Tony Cabaye', + link: 'https://github.com/tonai', + }, + repo: 'https://github.com/Smile-SA/slidev-component-progress', + }, + { + id: 'slidev-component-scroll', + name: 'Mouse Scroll', + description: 'Use mouse wheel for navigating', + tags: ['Navigation'], + author: { + name: 'Tony Cabaye', + link: 'https://github.com/tonai', + }, + repo: 'https://github.com/Smile-SA/slidev-component-scroll', + }, + { + id: 'slidev-component-spotlight', + name: 'Spotlight', + description: 'Activate a spotlight to highlight a specific region by holding a key', + tags: ['Tool'], + author: { + name: 'Tony Cabaye', + link: 'https://github.com/tonai', + }, + repo: 'https://github.com/Smile-SA/slidev-component-spotlight', + }, + { + id: 'slidev-component-zoom', + name: 'Zooming', + description: 'Allow zooming inside the slides', + tags: ['Tool'], + author: { + name: 'Tony Cabaye', + link: 'https://github.com/tonai', + }, + repo: 'https://github.com/Smile-SA/slidev-component-zoom', + }, + { + id: 'slidev-addon-rabbit', + name: 'Rabbit', + description: 'Presentation time management for Slidev inspired by Rabbit', + tags: ['Tool', 'Navigation'], + author: { + name: 'kaakaa', + link: 'https://github.com/kaakaa', + }, + repo: 'https://github.com/kaakaa/slidev-addon-rabbit', + }, + { + id: 'slidev-addon-stem', + name: 'STEM', + description: 'Slidev addon for scientific presentation', + tags: ['Component', 'Layout'], + author: { + name: 'yutaka-shoji', + link: 'https://github.com/yutaka-shoji', + }, + repo: 'https://github.com/yutaka-shoji/slidev-addon-stem', + }, + { + id: 'slidev-addon-naive', + name: 'Naive UI', + description: 'Brings Naive UI components into Slidev', + tags: ['Component'], + author: { + name: 'Samuel Huang', + link: 'https://sghuang.com', + }, + repo: 'https://github.com/sghuang19/slidev-addon-naive', + }, + { + id: 'slidev-addon-hls-player', + name: 'HLS player', + description: 'Add a basic hls.js powered video player on your slides to show HTTP Live Streaming videos', + tags: ['hls', 'video'], + author: { + name: 'Albert Brand', + link: 'https://github.com/AlbertBrand', + }, + repo: 'https://github.com/AlbertBrand/slidev-addon-hls-player', + }, + { + id: 'slidev-addon-window-mockup', + name: 'Window Mockup', + description: 'Styled window frames', + tags: ['Component'], + author: { + name: 'whitphx', + link: 'https://github.com/whitphx', + }, + repo: 'https://github.com/whitphx/slidev-addon-window-mockup', + }, + // Add yours here! + { + id: '', + link: 'https://github.com/slidevjs/slidev/edit/main/docs/.vitepress/addons.ts', + name: 'Yours?', + description: 'Click here to submit your addon :)', + tags: [], + author: { + name: '', + }, + }, +] diff --git a/.vitepress/config.js b/.vitepress/config.js deleted file mode 100644 index 5c3c014a..00000000 --- a/.vitepress/config.js +++ /dev/null @@ -1,284 +0,0 @@ -// @ts-check - -const Guide = [ - { - text: 'なぜSlidev?', - link: '/guide/why', - }, - { - text: 'はじめに', - link: '/guide/', - }, - { - text: 'インストール', - link: '/guide/install', - }, - { - text: 'Markdownシンタックス', - link: '/guide/syntax', - }, - { - text: 'ナビゲーション', - link: '/guide/navigation', - }, - { - text: 'アニメーション', - link: '/guide/animations', - }, - { - text: 'エクスポート', - link: '/guide/exporting', - }, - { - text: '静的ホスティング', - link: '/guide/hosting', - }, - { - text: 'レコーディング', - link: '/guide/recording', - }, - { - text: 'プレゼンターモード', - link: '/guide/presenter-mode', - }, - { - text: '描画と注釈', - link: '/guide/drawing', - }, - { - text: 'エディタサポート', - link: '/guide/editors', - }, - { - text: 'FAQ', - link: '/guide/faq', - }, -] - -const Theme = [ - { - text: 'テーマを使用する', - link: '/themes/use', - }, - { - text: 'テーマギャラリー', - link: '/themes/gallery', - }, - { - text: 'テーマを作成する', - link: '/themes/write-a-theme', - }, -] - -const Translations = [ - { - text: '日本語', - }, - { - text: 'English', - link: 'https://sli.dev{{pathname}}', - }, - { - text: '简体中文', - link: 'https://cn.sli.dev{{pathname}}', - }, - { - text: 'Français', - link: 'https://fr.sli.dev{{pathname}}', - }, - { - text: 'Español', - link: 'https://es.sli.dev{{pathname}}', - }, - { - text: 'Русский', - link: 'https://ru.sli.dev{{pathname}}', - }, - { - text: 'Việt Nam', - link: 'https://vn.sli.dev{{pathname}}', - }, - { - text: 'Deutsch', - link: 'https://de.sli.dev{{pathname}}', - }, - { - text: 'Português (BR)', - link: 'https://br.sli.dev{{pathname}}', - }, - { - text: 'Ελληνικά', - link: 'https://el.sli.dev{{pathname}}', - }, - { - text: '日本語', - link: 'https://ja.sli.dev{{pathname}}', - }, -] - -const Customizations = [ - { - text: 'カスタマイズ', - link: '/custom/', - }, - { - text: 'ディレクトリ構造', - link: '/custom/directory-structure', - }, - { - text: 'フォント', - link: '/custom/fonts', - }, - { - text: 'シンタックスハイライト', - link: '/custom/highlighters', - }, - { - text: 'Vueの設定', - link: '/custom/config-vue', - }, - { - text: 'Viteの設定', - link: '/custom/config-vite', - }, - { - text: 'Windi CSSの設定', - link: '/custom/config-windicss', - }, - { - text: 'Monacoの設定', - link: '/custom/config-monaco', - }, - { - text: 'KaTeXの設定', - link: '/custom/config-katex', - }, - { - text: 'Mermaidの設定', - link: '/custom/config-mermaid', - }, - { - text: 'ショートカットの設定', - link: '/custom/config-shortcuts', - }, - { - text: 'Vueグローバルコンテキスト', - link: '/custom/vue-context', - }, - { - text: 'グローバルレイヤー', - link: '/custom/global-layers', - } -] - -const Resources = [ - { - text: 'ショーケース', - link: '/showcases', - }, - { - text: '学習リソース', - link: '/resources/learning', - }, - { - text: 'キュレーションカバー', - link: '/resources/covers', - }, -] - -const slidebars = [ - { - text: 'ガイド', - children: Guide, - }, - { - text: 'テーマ', - children: Theme, - }, - { - text: 'カスタマイズ', - children: Customizations, - }, - { - text: 'ビルトイン', - children: [ - { - text: 'コンポーネント', - link: '/builtin/components', - }, - { - text: 'レイアウト', - link: '/builtin/layouts', - }, - ], - }, -] - -/** - * @type {import('vitepress').UserConfig} - */ -module.exports = { - title: 'Slidev', - description: '開発者のためのプレゼンテーションスライド', - head: [ - ['link', { rel: 'icon', type: 'image/png', href: '/favicon.png' }], - ['meta', { name: 'author', content: 'Anthony Fu' }], - ['meta', { property: 'og:title', content: 'Slidev' }], - ['meta', { property: 'og:image', content: 'https://sli.dev/og-image.png' }], - ['meta', { property: 'og:description', content: 'Presentation slides for developers' }], - ['meta', { name: 'twitter:card', content: 'summary_large_image' }], - ['meta', { name: 'twitter:creator', content: '@slidevjs' }], - ['meta', { name: 'twitter:image', content: 'https://sli.dev/og-image.png' }], - ['link', { rel: 'dns-prefetch', href: 'https://fonts.gstatic.com' }], - ['link', { rel: 'preconnect', crossorigin: 'anonymous', href: 'https://fonts.gstatic.com' }], - ['link', { href: 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@200;400;500&family=Inter:wght@200;400;500;600', rel: 'stylesheet' }], - ], - themeConfig: { - repo: 'slidevjs/docs-ja', - logo: '/logo.svg', - docsBranch: 'main', - editLinks: true, - editLinkText: 'このページの編集を提案する', - - algolia: { - apiKey: '1a5c5a504139c58f428974c78c55291d', - indexName: 'slidev', - searchParameters: { - // for translations maintainers: change the filter to your locale code (subdomain name) - facetFilters: ['language:ja'] - } - }, - - nav: [ - { - text: 'ガイド', - items: Guide, - }, - { - text: 'テーマ', - items: Theme, - }, - { - text: 'カスタマイズ', - items: Customizations, - }, - { - text: 'リソース', - items: Resources, - }, - { - text: '日本語', - items: Translations, - }, - ], - - sidebar: { - '/guide/': slidebars, - '/themes/': slidebars, - '/custom/': slidebars, - '/builtin/': slidebars, - '/resources/': slidebars, - '/': slidebars, - }, - }, -} diff --git a/.vitepress/config.ts b/.vitepress/config.ts new file mode 100644 index 00000000..05e6aad8 --- /dev/null +++ b/.vitepress/config.ts @@ -0,0 +1,161 @@ +import type { DefaultTheme } from 'vitepress' +import { fileURLToPath } from 'node:url' +import { transformerTwoslash } from '@shikijs/vitepress-twoslash' +import { defineConfig } from 'vitepress' +import { groupIconMdPlugin } from 'vitepress-plugin-group-icons' +import { version } from '../package.json' +import Customizations from './customizations' +import { Advanced, BuiltIn, Guides, Resources } from './pages' +import { getSidebarObject } from './sidebar-gen' + +export const slidebars: DefaultTheme.SidebarItem[] = [ + { + text: 'Guide', + items: Guides, + }, + { + text: 'Advanced', + items: Advanced, + }, + { + text: 'Customizations', + items: Customizations, + }, + { + text: 'Built-in', + items: BuiltIn, + }, + { + text: 'Resources', + items: Resources, + }, +] + +export default defineConfig({ + title: 'Slidev', + description: 'Presentation slides for developers', + head: [ + ['link', { rel: 'icon', type: 'image/png', href: '/favicon.png' }], + ['meta', { name: 'author', content: 'Anthony Fu' }], + ['meta', { property: 'og:title', content: 'Slidev' }], + ['meta', { property: 'og:image', content: 'https://sli.dev/og-image.png' }], + ['meta', { property: 'og:description', content: 'Presentation slides for developers' }], + ['meta', { name: 'twitter:card', content: 'summary_large_image' }], + ['meta', { name: 'twitter:creator', content: '@slidevjs' }], + ['meta', { name: 'twitter:image', content: 'https://sli.dev/og-image.png' }], + ['link', { rel: 'dns-prefetch', href: 'https://fonts.gstatic.com' }], + ['link', { rel: 'preconnect', crossorigin: 'anonymous', href: 'https://fonts.gstatic.com' }], + ['link', { href: 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@200;400;500&family=Inter:wght@200;400;500;600', rel: 'stylesheet' }], + ], + markdown: { + theme: { + light: 'vitesse-light', + dark: 'vitesse-dark', + }, + async shikiSetup(shiki) { + await shiki.loadLanguage( + 'html', + 'xml', + 'vue', + 'markdown', + 'mermaid', + 'latex', + ) + }, + codeTransformers: [ + transformerTwoslash({ + twoslashOptions: { + // The @slidev/* installed in docs package are very old and should only be used in the homepage demo + vfsRoot: fileURLToPath(import.meta.url), + compilerOptions: { + resolveJsonModule: true, + moduleResolution: /* Bundler */ 100, + }, + }, + }), + ], + config(md) { + md.use(groupIconMdPlugin) + }, + }, + cleanUrls: true, + themeConfig: { + logo: '/logo.svg', + editLink: { + pattern: 'https://github.com/slidevjs/slidev/edit/main/docs/:path', + text: 'Suggest changes to this page', + }, + + search: { + provider: 'local', + }, + + nav: [ + { + text: '📖 Guide', + items: [ + ...Guides, + { + text: 'Advanced', + items: Advanced, + }, + ], + }, + { + text: '✨ Features', + link: '/features/', + }, + { + text: 'Reference', + items: [ + { + text: 'Built-in', + items: BuiltIn, + }, + { + text: 'Customize', + items: Customizations, + }, + ], + }, + { + text: 'Resources', + items: Resources, + }, + ], + + socialLinks: [ + { icon: 'github', link: 'https://github.com/slidevjs/slidev' }, + { icon: 'twitter', link: 'https://twitter.com/slidevjs' }, + { icon: 'discord', link: 'https://chat.sli.dev' }, + ], + + sidebar: { + '/guide/': slidebars, + '/themes/': slidebars, + '/addons/': slidebars, + '/custom/': slidebars, + '/builtin/': slidebars, + '/resources/': slidebars, + // eslint-disable-next-line antfu/no-top-level-await + ...await getSidebarObject(), + '/features/': [], + '/': slidebars, + }, + + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2020-2025 Anthony Fu.', + }, + }, + + locales: { + root: { + label: `English (v${version})`, + }, + zh: { + label: '简体中文', + link: 'https://cn.sli.dev/', + }, + }, +}) diff --git a/.vitepress/customizations.ts b/.vitepress/customizations.ts new file mode 100644 index 00000000..722a2594 --- /dev/null +++ b/.vitepress/customizations.ts @@ -0,0 +1,66 @@ +export default [ + { + text: 'Configurations', + link: '/custom/', + }, + { + text: 'Directory Structure', + link: '/custom/directory-structure', + }, + { + text: 'Configure Highlighter', + link: '/custom/config-highlighter', + }, + { + text: 'Configure Vite and Plugins', + link: '/custom/config-vite', + }, + { + text: 'Configure Vue App', + link: '/custom/config-vue', + }, + { + text: 'Configure UnoCSS', + link: '/custom/config-unocss', + }, + { + text: 'Configure Code Runners', + link: '/custom/config-code-runners', + }, + { + text: 'Configure Transformers', + link: '/custom/config-transformers', + }, + { + text: 'Configure Monaco', + link: '/custom/config-monaco', + }, + { + text: 'Configure KaTeX', + link: '/custom/config-katex', + }, + { + text: 'Configure Mermaid', + link: '/custom/config-mermaid', + }, + { + text: 'Configure Routes', + link: '/custom/config-routes', + }, + { + text: 'Configure Shortcuts', + link: '/custom/config-shortcuts', + }, + { + text: 'Configure Context Menu', + link: '/custom/config-context-menu', + }, + { + text: 'Configure Fonts', + link: '/custom/config-fonts', + }, + { + text: 'Configure Pre-Parser', + link: '/custom/config-parser', + }, +] diff --git a/.vitepress/pages.ts b/.vitepress/pages.ts new file mode 100644 index 00000000..e0f990d3 --- /dev/null +++ b/.vitepress/pages.ts @@ -0,0 +1,107 @@ +export const Guides = [ + { + text: 'Why Slidev', + link: '/guide/why', + }, + { + text: 'Getting Started', + link: '/guide/', + }, + { + text: 'Syntax Guide', + link: '/guide/syntax', + }, + { + text: 'User Interface', + link: '/guide/ui', + }, + { + text: 'Animations', + link: '/guide/animations', + }, + { + text: 'Theme & Addons', + link: '/guide/theme-addon', + }, + { + text: 'Components', + link: '/guide/component', + }, + { + text: 'Layouts', + link: '/guide/layout', + }, + { + text: 'Exporting', + link: '/guide/exporting', + }, + { + text: 'Hosting', + link: '/guide/hosting', + }, + { + text: 'FAQ', + link: '/guide/faq', + }, +] + +export const BuiltIn = [ + { + text: 'CLI', + link: '/builtin/cli', + }, + { + text: 'Components', + link: '/builtin/components', + }, + { + text: 'Layouts', + link: '/builtin/layouts', + }, +] + +export const Advanced = [ + { + text: 'Global Context', + link: '/guide/global-context', + }, + { + text: 'Writing Layouts', + link: '/guide/write-layout', + }, + { + text: 'Writing Themes', + link: '/guide/write-theme', + }, + { + text: 'Writing Addons', + link: '/guide/write-addon', + }, +] + +export const Resources = [ + { + text: 'Showcases', + link: '/resources/showcases', + }, + { + text: 'Theme Gallery', + link: '/resources/theme-gallery', + }, + { + text: 'Addon Gallery', + link: '/resources/addon-gallery', + }, + { + text: 'Learning Resources', + link: '/resources/learning', + }, + { + text: 'Curated Covers', + link: '/resources/covers', + }, + { + text: 'Release Notes', + link: 'https://github.com/slidevjs/slidev/releases', + }, +] diff --git a/.vitepress/scripts/prepare.js b/.vitepress/scripts/prepare.js deleted file mode 100644 index c0e13b3f..00000000 --- a/.vitepress/scripts/prepare.js +++ /dev/null @@ -1,8 +0,0 @@ -const fs = require('fs-extra') - -async function main(){ - await fs.remove('.vitepress/@slidev') - await fs.copy('node_modules/@slidev', '.vitepress/@slidev', { dereference: true }) -} - -main() diff --git a/.vitepress/showcases.ts b/.vitepress/showcases.ts index dd7136b5..4e46ef59 100644 --- a/.vitepress/showcases.ts +++ b/.vitepress/showcases.ts @@ -20,8 +20,8 @@ export const showcases: ShowCaseInfo[] = [ name: 'Anthony Fu', link: 'https://github.com/antfu', }, - slidesLink: 'https://sli.dev/demo/composable-vue', - sourceLink: 'https://github.com/antfu/talks/tree/master/2021-04-29', + slidesLink: 'https://talks.antfu.me/2021/composable-vue/', + sourceLink: 'https://github.com/antfu/talks/tree/main/2021-04-29', at: 'VueDay 2021', datetime: '2021-04-29', }, @@ -49,29 +49,29 @@ export const showcases: ShowCaseInfo[] = [ at: 'Enter.js Vue Day', datetime: '2021-06-15', }, - { - title: 'Simply Publish Your Package to npm', - author: { - name: 'Lucky Dewa Satria', - link: 'https://github.com/lucky401', - }, - at: 'Weekly sharing', - slidesLink: 'https://masukin.link/talks/simply-publish-your-package-to-npm', - cover: 'https://masukin.link/talks-cover-npm.png', - datetime: '2021-06-12', - }, - { - title: 'Create Icon Package With Vue and Rollup', - author: { - name: 'Lucky Dewa Satria', - link: 'https://github.com/lucky401', - }, - at: 'Weekly Sharing', - slidesLink: 'https://masukin.link/talks/create-icon-package-with-vue-and-rollup', - sourceLink: 'https://github.com/lucky401/Create-Icon-Package-With-Vue-and-Rollup', - cover: 'https://masukin.link/talks-cover-create-icon-package-with-vue-and-rollup.png', - datetime: '2021-06-19', - }, + // { + // title: 'Simply Publish Your Package to npm', + // author: { + // name: 'Lucky Dewa Satria', + // link: 'https://github.com/lucky401', + // }, + // at: 'Weekly sharing', + // slidesLink: 'https://masukin.link/talks/simply-publish-your-package-to-npm', + // cover: 'https://masukin.link/talks-cover-npm.png', + // datetime: '2021-06-12', + // }, + // { + // title: 'Create Icon Package With Vue and Rollup', + // author: { + // name: 'Lucky Dewa Satria', + // link: 'https://github.com/lucky401', + // }, + // at: 'Weekly Sharing', + // slidesLink: 'https://masukin.link/talks/create-icon-package-with-vue-and-rollup', + // sourceLink: 'https://github.com/lucky401/Create-Icon-Package-With-Vue-and-Rollup', + // cover: 'https://masukin.link/talks-cover-create-icon-package-with-vue-and-rollup.png', + // datetime: '2021-06-19', + // }, { title: 'BeAPT', author: { @@ -108,6 +108,220 @@ export const showcases: ShowCaseInfo[] = [ at: 'Thoughtworks Internal Lunch & Learn', datetime: '2021-11-12', }, + { + title: 'Git\'s Most Wanted', + cover: 'https://cdn.jsdelivr.net/gh/alexanderdavide/git-most-wanted@assets/slides-export/01.png', + author: { + name: 'Alexander Eble', + link: 'https://github.com/alexanderdavide', + }, + slidesLink: 'https://alexeble.de/talks/git-most-wanted/', + sourceLink: 'https://github.com/alexanderdavide/git-most-wanted', + at: 'Internal Tech Talk', + datetime: '2022-03-11', + }, + { + title: 'OpenFunction 202', + cover: 'https://s2.loli.net/2022/05/22/4zsCnkQRFoAU1E5.png', + author: { + name: 'Haili Zhang', + link: 'https://github.com/webup', + }, + slidesLink: 'https://openfunction-talks.netlify.app/2022/202-node-async/', + sourceLink: 'https://github.com/webup/openfunction-talks/tree/main/202-node-async', + at: 'OpenFunction Tutorial Sharing', + datetime: '2022-05-08', + }, + { + title: 'Is it Okay to Pursue Functional Programming on Frontend?', + author: { + name: 'Minsu Kim , Changhui Lee', + }, + at: '2022 JSConf Korea', + slidesLink: 'https://moonlit-nougat-422445.netlify.app/1', + sourceLink: 'https://github.com/alstn2468/2022-jsconf-presentation', + cover: 'https://raw.githubusercontent.com/alstn2468/2022-jsconf-presentation/main/public/images/og.png', + datetime: '2022-09-16', + }, + { + title: 'Blazing slidev ppt template with naive-ui', + author: { + name: 'godkun', + }, + at: 'personal sharing', + slidesLink: 'https://ppt.godkun.top', + sourceLink: 'https://github.com/godkun/ppt-template', + cover: 'https://github.com/godkun/ppt-template/raw/main/public/show.gif', + datetime: '2022-10-24', + }, + { + title: 'Building a Polite Popup with Nuxt 3', + author: { + name: 'Michael Hoffmann', + link: 'https://github.com/mokkapps', + }, + at: 'Vue.js Nation 2023', + slidesLink: 'https://vuejsnation-2023-talk-polite-popup.netlify.app', + sourceLink: 'https://github.com/Mokkapps/vuejsnation-2023-lightning-talk-polite-popup-nuxt-3-slides', + cover: 'https://raw.githubusercontent.com/Mokkapps/vuejsnation-2023-lightning-talk-polite-popup-nuxt-3-slides/main/screenshots/001.png', + datetime: '2023-01-25', + }, + { + title: 'Dev Environment as Code', + cover: 'https://cdn.jsdelivr.net/gh/alexanderdavide/dev-environment-as-code@assets/slides-export/001.png', + author: { + name: 'Alexander Eble', + link: 'https://github.com/alexanderdavide', + }, + slidesLink: 'https://alexeble.de/talks/dev-environment-as-code/', + sourceLink: 'https://github.com/alexanderdavide/dev-environment-as-code', + at: 'Internal Tech Talk', + datetime: '2022-12-01', + }, + { + title: 'Exploring Social Engineering', + cover: 'https://raw.githubusercontent.com/zyf722/exploring-social-engineering-slides/main/assets/Screenshot_Cover.png', + author: { + name: 'zyf722', + link: 'https://github.com/zyf722', + }, + slidesLink: 'https://zyf722.github.io/exploring-social-engineering-slides/', + sourceLink: 'https://github.com/zyf722/exploring-social-engineering-slides', + at: 'Presentation on Social Engineering in Computers in Society class', + datetime: '2023-10-20', + }, + { + title: 'Diablo Health Orb Shader', + author: { + name: 'SuneBear', + link: 'https://github.com/sunebear', + }, + at: 'rctAI Sessions', + slidesLink: 'https://rct-ai.github.io/frontend-slides/diablo-health-orb-shader/', + sourceLink: 'https://github.com/rct-ai/frontend-slides', + cover: 'https://github-production-user-asset-6210df.s3.amazonaws.com/7693264/284304324-db973b4c-a043-4644-932c-826169a1b4d8.gif', + datetime: '2022-09-01', + }, + { + title: 'Comparison of Packaging Tools in 2023', + author: { + name: 'Peacock (Yoichi Takai)', + link: 'https://p3ac0ck.net', + }, + at: 'PyCon APAC 2023', + slidesLink: 'https://slides.p3ac0ck.net/pyconapac2023/1', + sourceLink: 'https://github.com/peacock0803sz/slidev-slides/blob/7d41aa5e89ad8627cb68ae2cdbfe1681017b0408/talks/pyconapac2023/pyconapac2023.md', + cover: 'https://slides.p3ac0ck.net/pyconapac2023/cover.png', + datetime: '2023-10-28', + }, + { + title: 'How Rust error handling ease web development', + author: { + name: 'Nguyễn Hồng Quân', + link: 'https://quan.hoabinh.vn', + }, + at: 'FOSSASIA Summit 2024', + slidesLink: 'https://talk.quan.hoabinh.vn/rust-error-handling-ease-web-dev/', + sourceLink: 'https://hongquan@bitbucket.org/hongquan/rust-error-handling-ease-web-dev', + cover: 'https://i.imgur.com/2eBJofY.png', + datetime: '2024-04-10', + }, + { + title: 'Sit Back and Relax with Fault Awareness and Robust Instant Recovery for Large Scale AI Workloads', + author: { + name: 'Neko', + link: 'https://github.com/nekomeowww', + }, + at: 'KubeCon 2024 China', + slidesLink: 'https://talks.ayaka.io/nekoayaka/2024-08-21-kubecon-hk/', + sourceLink: 'https://github.com/nekomeowww/talks/tree/main/packages/2024-08-21-kubecon-hk', + cover: 'https://raw.githubusercontent.com/BaizeAI/talks/main/packages/2024-08-21-kubecon-hk/public/screenshot.png', + datetime: '2024-08-21', + }, + { + title: 'Hacker Numerology', + author: { + name: 'HD Moore', + link: 'https://hdm.io', + }, + at: 'LASCON 2024', + slidesLink: 'https://hdm.io/decks/2024-LASCON-Numerology/', + sourceLink: 'https://github.com/hdm/decks-2024-lascon-numerology.git', + cover: 'https://raw.githubusercontent.com/hdm/decks-2024-lascon-numerology/refs/heads/main/screenshot.png', + datetime: '2024-10-25', + }, + { + title: 'Python Zero To Hero - Episode 1', + author: { + name: 'Kareim Tarek', + link: 'https://kareimgazer.github.io/', + }, + at: 'Kareem Kreates YouTube Channel', + slidesLink: 'https://kareimgazer.github.io/py-intro/', + sourceLink: 'https://github.com/KareimGazer/py-intro', + cover: 'https://i.ytimg.com/vi/hVMaPBrWvAo/hqdefault.jpg', + datetime: '2025-01-12', + }, + { + title: 'Taming Dependency Chaos for LLM in K8s', + author: { + name: 'Neko', + link: 'https://github.com/nekomeowww', + }, + at: 'KubeCon 2025 China', + slidesLink: 'https://baizeai.github.io/talks/2025-06-11-kubecon-hk/', + sourceLink: 'https://github.com/BaizeAI/talks/tree/main/packages/2025-06-11-kubecon-hk', + cover: 'https://raw.githubusercontent.com/BaizeAI/talks/main/packages/2025-06-11-kubecon-hk/public/screenshot.png', + datetime: '2025-06-11', + }, + { + title: 'Single Image Super-Resolution Based on Capsule Neural Networks', + author: { + name: 'George Corrêa de Araújo', + link: 'https://george-gca.github.io/', + }, + at: 'Brazilian Conference on Intelligent Systems 2023', + slidesLink: 'https://george-gca.github.io/bracis_2023_srcaps/', + sourceLink: 'https://github.com/george-gca/bracis_2023_srcaps', + cover: 'https://raw.githubusercontent.com/george-gca/bracis_2023_srcaps/refs/heads/main/cover.png', + datetime: '2023-09-27', + }, + { + title: 'Threat Modeling', + author: { + name: 'guisso', + link: 'https://github.com/fguisso', + }, + at: 'OWASP Meetup', + slidesLink: 'https://guisso.dev/talks/threat-modeling', + sourceLink: 'https://github.com/fguisso/talks/tree/main/slides/threat-modeling', + cover: 'https://guisso.dev/posts/threat-modeling-intro/featured-threat-modeling_hu12396ec5bf9ecba1dda33f1443a5eb10_76776_600x0_resize_box_3.png', + datetime: '2023-09-22', + }, + { + title: 'A 14-year journey developing nCine, an open-source 2D game framework', + author: { + name: 'Angelo Theodorou', + link: 'https://encelo.github.io', + }, + at: '/dev/games/2025', + slidesLink: 'https://encelo.github.io/nCine_14Years_Presentation/', + sourceLink: 'https://github.com/encelo/nCine_14Years_Presentation', + cover: 'https://i.imgur.com/AbTdfhg.png', + datetime: '2025-06-05', + }, + { + title: 'Reverse Engineering Denuvo in Hogwarts Legacy', + author: { + name: 'Maurice Heumann', + link: 'https://momo5502.com', + }, + at: 'Navaja Negra 2025', + slidesLink: 'https://momo5502.com/slides/denuvo', + sourceLink: 'https://github.com/momo5502/denuvo-slides', + cover: 'https://raw.githubusercontent.com/momo5502/denuvo-slides/refs/heads/master/images/preview.png', + datetime: '2025-10-03', + }, // Add yours here! { title: 'Yours?', @@ -115,8 +329,8 @@ export const showcases: ShowCaseInfo[] = [ name: '', }, at: 'Submit your talk/presentation to be list here!', - slidesLink: 'https://github.com/slidevjs/docs/edit/main/.vitepress/showcases.ts', + slidesLink: 'https://github.com/slidevjs/slidev/edit/main/docs/.vitepress/showcases.ts', cover: `${import.meta.env.BASE_URL}theme-placeholder.png`, - datetime: '2021-04-29', + datetime: '2020-1-1', }, -] +].sort((a, b) => new Date(b.datetime).getTime() - new Date(a.datetime).getTime()) diff --git a/.vitepress/sidebar-gen.ts b/.vitepress/sidebar-gen.ts new file mode 100644 index 00000000..d85c462f --- /dev/null +++ b/.vitepress/sidebar-gen.ts @@ -0,0 +1,137 @@ +import type { DefaultTheme } from 'vitepress' +import { join } from 'node:path' +import { fileURLToPath } from 'node:url' +import fg from 'fast-glob' +import graymatter from 'gray-matter' + +const root = fileURLToPath(new URL('../../', import.meta.url)) + +interface ParsedFile { + filepath: string + path: string + matter: graymatter.GrayMatterFile + title: string +} + +function parseFile(file: string) { + const filepath = join(root, file) + const path = file.replace('docs/', '').replace('.md', '') + const matter = graymatter.read(filepath) + const title = matter.data.title || matter.content.match(/^#\s+(.*)/m)?.[1] || path + return { + filepath, + path, + matter, + title, + } +} + +export async function getSidebarObject() { + const map: Record = {} + + const parsedFeatures: ParsedFile[] = await fg([ + 'docs/features/*.md', + ], { + onlyFiles: true, + cwd: root, + }) + .then(files => files.map(parseFile)) + + const parsedGuides: ParsedFile[] = await fg([ + 'docs/guide/*.md', + ], { + onlyFiles: true, + cwd: root, + }) + .then(files => files.map(parseFile)) + + parsedFeatures.forEach(({ matter, path }) => { + const items: DefaultTheme.SidebarItem[] = [ + { + text: 'Back to', + items: [ + { + text: 'All Features', + link: '/features', + }, + ], + }, + ] + + function findParsed(related: string) { + related = related.replace(/#.*$/, '') + const feature = parsedFeatures.find(file => file.path === related) + if (feature) { + return { + type: 'features', + item: feature, + } + } + const guide = parsedGuides.find(file => file.path === related) + if (guide) { + return { + type: 'guide', + item: guide, + } + } + return undefined + } + + function frontmatterToSidebarItem(path: string | Record): DefaultTheme.SidebarItem[] { + if (typeof path === 'string') { + const match = findParsed(path) + if (match?.type === 'features') { + return [{ + text: `✨ ${match.item.title}`, + link: `/${match.item.path}`, + }] + } + if (match?.type === 'guide') { + return [{ + text: `📖 ${match.item.title}`, + link: `/${match.item.path}`, + }] + } + console.warn(`Dependent file not found: ${path}`) + return [{ + text: path, + link: `/${path}`, + }] + } + else { + return Object.entries(path).map(([text, link]) => ({ + text, + link, + })) + } + } + + if (matter.data.depends) { + items.push({ + text: 'Depends on', + items: matter.data.depends.flatMap(frontmatterToSidebarItem), + }) + } + + if (matter.data.relates) { + items.push({ + text: 'Related to', + items: matter.data.relates.flatMap(frontmatterToSidebarItem), + }) + } + + const derives = matter.data.derives + ?? parsedFeatures.filter(f => f.matter.data.depends?.includes(path)).map(f => f.path) + + if (derives.length) { + items.push({ + text: 'Derives', + items: derives.flatMap(frontmatterToSidebarItem), + }) + } + + map[`/${path}`] = items + }) + + return map +} diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue deleted file mode 100644 index b11f593d..00000000 --- a/.vitepress/theme/Layout.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - diff --git a/.vitepress/theme/NotFound.vue b/.vitepress/theme/NotFound.vue deleted file mode 100644 index 999af587..00000000 --- a/.vitepress/theme/NotFound.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/.vitepress/theme/components/AddonGallery.vue b/.vitepress/theme/components/AddonGallery.vue new file mode 100644 index 00000000..5b38da33 --- /dev/null +++ b/.vitepress/theme/components/AddonGallery.vue @@ -0,0 +1,18 @@ + + + diff --git a/.vitepress/theme/components/AddonInfo.vue b/.vitepress/theme/components/AddonInfo.vue new file mode 100644 index 00000000..17c11071 --- /dev/null +++ b/.vitepress/theme/components/AddonInfo.vue @@ -0,0 +1,57 @@ + + + diff --git a/.vitepress/theme/components/AlgoliaSearchBox.vue b/.vitepress/theme/components/AlgoliaSearchBox.vue deleted file mode 100644 index 3961a510..00000000 --- a/.vitepress/theme/components/AlgoliaSearchBox.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - diff --git a/.vitepress/theme/components/BooleanDisplay.vue b/.vitepress/theme/components/BooleanDisplay.vue deleted file mode 100644 index 3aa15b7e..00000000 --- a/.vitepress/theme/components/BooleanDisplay.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/.vitepress/theme/components/DarkModeSwitch.vue b/.vitepress/theme/components/DarkModeSwitch.vue deleted file mode 100644 index a3c39a0b..00000000 --- a/.vitepress/theme/components/DarkModeSwitch.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/.vitepress/theme/components/demo/Demo.vue b/.vitepress/theme/components/Demo.vue similarity index 64% rename from .vitepress/theme/components/demo/Demo.vue rename to .vitepress/theme/components/Demo.vue index d6106de1..c88b7ec7 100644 --- a/.vitepress/theme/components/demo/Demo.vue +++ b/.vitepress/theme/components/Demo.vue @@ -1,20 +1,22 @@