File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { defineConfig } from "vitepress";
33import { execSync } from "node:child_process" ;
44import { withMermaid } from "vitepress-plugin-mermaid" ;
55import llmstxt from "vitepress-plugin-llms" ;
6+ import { copyOrDownloadAsMarkdownButtons } from "vitepress-plugin-llms" ;
67
78const inProd = process . env . NODE_ENV === "production" ;
89
@@ -78,6 +79,11 @@ export default withMermaid(
7879 vite : {
7980 plugins : [ llmstxt ( ) ] ,
8081 } ,
82+ markdown : {
83+ config ( md ) {
84+ md . use ( copyOrDownloadAsMarkdownButtons ) ;
85+ } ,
86+ } ,
8187 mermaid : {
8288 securityLevel : "loose" , // Allows more flexibility
8389 theme : "base" , // Use base theme to allow CSS variables to take effect
Original file line number Diff line number Diff line change 1+ import { defineClientComponent , useData } from "vitepress" ;
2+ import { computed , defineComponent } from "vue" ;
3+
4+ const ClientCopyOrDownloadAsMarkdownButtons = defineClientComponent ( ( ) => {
5+ return import ( "vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue" ) ;
6+ } ) ;
7+
8+ export default defineComponent ( {
9+ name : "CopyOrDownloadAsMarkdownButtons" ,
10+ setup ( ) {
11+ const { page } = useData ( ) ;
12+
13+ const shouldShow = computed ( ( ) => {
14+ // Hide component if path starts with /zh
15+ return ! page . value . relativePath . startsWith ( "zh" ) ;
16+ } ) ;
17+
18+ return ( ) => {
19+ if ( ! shouldShow . value ) return null ;
20+
21+ return < ClientCopyOrDownloadAsMarkdownButtons /> ;
22+ } ;
23+ } ,
24+ } ) ;
Original file line number Diff line number Diff line change 11import DefaultTheme from "vitepress/theme" ;
2+ import CopyOrDownloadAsMarkdownButtons from "vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue" ;
3+
24import "./vaporwave.css" ;
35
46export default {
57 extends : DefaultTheme ,
8+ enhanceApp ( { app } ) {
9+ app . component (
10+ "CopyOrDownloadAsMarkdownButtons" ,
11+ CopyOrDownloadAsMarkdownButtons ,
12+ ) ;
13+ } ,
614} ;
Original file line number Diff line number Diff line change 77 --vw-blue : # 118dc3 ;
88 --vw-yellow : # eea825 ;
99
10- .VPMenu {
10+ .VPMenu ,
11+ .dropdown-menu {
1112 background-color : var (--vp-c-bg ) !important ;
1213 }
1314
You can’t perform that action at this time.
0 commit comments