Developer Notes
Hello WorldImport
txt
<<< @../../../src/kvm/utils/inject_ssh_keys.sh {bash} [inject_ssh_keys.sh]
<< #tmp/src/ssh/ssh-docs.sh //: # ( //route) @ means docs/src
- without touching package.json
txt
[//]: # (<<< @/ssh/ssh-docs.sh)
js
base /vite-press-docs/
vue
base {{withBase('/')}}
Import
.vitepress
- Use build to find the path.
js
// within src
import helloWorld from "#docs/src/components/hello-world.vue"
import helloWorld from "c:/Users/Public/Projects/ssh-config-cloud/docs/src/components/hello-world.vue"
import helloWorld from "#docs/src/components/hello-world.vue"
js
import helloWorld from "$HOME/Projects/ssh-config-cloud/docs/src/components/hello-world.vue"
import helloWorld from "%HOME%/VSCodeProjects/ssh-config-cloud/docs/src/components/hello-world.vue"
import helloWorld from "$Env:HOME/VSCodeProjects/ssh-config-cloud/docs/src/components/hello-world.vue"
// <<< @withBase("/ssh/index/")
// <<< {{ $frontmatter.tmp}}
raw
import Wraps in a
Templates
- readme_vitepress.md
- readme_vitepress_path.md
configs.js
js
import { defineConfig } from 'vitepress'
//append to generated:
export default defineConfig({
base:"/ssh-config-cloud/",
srcDir: './src',//relative to the package.json vitepress dev <dir>
lang: 'en-ca',
//section inside
themeConfig: {
//add better search. https://vitepress.dev/reference/default-theme-search#local-search
search: {
provider: 'local'
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/codeforwings/material-design-3-import-export-ext' }
],
markdown:{
//https://vitepress.dev/reference/site-config#markdown
lineNumbers: true,
space_size: 2,//not sure if this works
}
}
})
js
import { fileURLToPath } from 'url';
const vite = {
define: { 'process.env ': {HOME:'c:/Users/Jason'} },
resolve: {
alias: {
// https://vitejs.dev/config/shared-options.html#resolve-alias
//https://nodejs.dev/en/api/v18/packages/#subpath-imports
'##': fileURLToPath(new URL('../..', import.meta.url)),//.vitepress
'#src': fileURLToPath(new URL('./src', import.meta.url)),//vitesrc... not needed?
'#docs': fileURLToPath(new URL('../', import.meta.url)),
//'../..' = path.relative('docs/.vitepress',process.cwd());import {relative} from "node:path/posix";
},
}
};
js
import { fileURLToPath } from 'url';
const vite = {
define: { 'process.env ': {} },
resolve: {
alias: {
// https://vitejs.dev/config/shared-options.html#resolve-alias
//https://nodejs.dev/en/api/v18/packages/#subpath-imports
'##': fileURLToPath(new URL('./.', import.meta.url)),//CWD
'#src': fileURLToPath(new URL('./src', import.meta.url)),
'#docs': fileURLToPath(new URL('./docs', import.meta.url)),
},
}
};
js
const package = { /* package.json node sub paths */
"imports": {
"##/*": {
"default": "./*"
},
"#src/*": {
"default": "./src/*"
},
"#docs/*": {
"default": "./docs/*"
}
}
}
Folder Tree
txt
docs
├── lib
│ └── gh-pages-push
│ └── ghPagesDeploy.mjs
├── src
│ ├── public
│ └── ssh
│ └── index.md
└── .vitepress
├── cache
│ └── deps
├── dist
├── theme
│ ├── index.js
│ └── style.css
└── config.js
bash
tree docs -a -L 3 --filelimit 8 --dirsfirst
Webstorm / VSCode shorcuts
- todo
- nuxt3-win32-posix-path.git
Vue Utils
- todo
- img-anchor
Details
vue
<script setup>
</script>
<template>
<span>Hello World</span>
</template>
<style scoped>
</style>
js
import helloWorld from "@/components/hello-world.vue"
Markdown-it
- todo... thjis is dev page...
frontmatter
yaml
outline: deep