-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hojas
committed
May 6, 2024
1 parent
f198903
commit 5ab732e
Showing
27 changed files
with
10,332 additions
and
2,843 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.nuxt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Nuxt 3 Minimal Starter | ||
|
||
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
|
||
```bash | ||
# npm | ||
npm install | ||
|
||
# pnpm | ||
pnpm install | ||
|
||
# yarn | ||
yarn install | ||
|
||
# bun | ||
bun install | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on `http://localhost:3000`: | ||
|
||
```bash | ||
# npm | ||
npm run dev | ||
|
||
# pnpm | ||
pnpm run dev | ||
|
||
# yarn | ||
yarn dev | ||
|
||
# bun | ||
bun run dev | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
|
||
```bash | ||
# npm | ||
npm run build | ||
|
||
# pnpm | ||
pnpm run build | ||
|
||
# yarn | ||
yarn build | ||
|
||
# bun | ||
bun run build | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
```bash | ||
# npm | ||
npm run preview | ||
|
||
# pnpm | ||
pnpm run preview | ||
|
||
# yarn | ||
yarn preview | ||
|
||
# bun | ||
bun run preview | ||
``` | ||
|
||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<script setup lang="ts"> | ||
import 'github-markdown-css/github-markdown-dark.css' | ||
import 'highlight.js/styles/night-owl.css' | ||
import 'katex/dist/katex.css' | ||
import { onMounted, getCurrentInstance } from 'vue' | ||
import remarkGfm from 'remark-gfm' | ||
import remarkToc from 'remark-toc' | ||
import remarkMath from 'remark-math' | ||
import rehypeRaw from 'rehype-raw' | ||
import rehypeHighlight from 'rehype-highlight' | ||
import rehypeKatex from 'rehype-katex' | ||
import { VueMarkdownRender } from 'vue-markdown-viewer' | ||
import MermaidRender from './components/MermaidRender.vue' | ||
import NormalCode from './components/NormalCode.vue' | ||
import content from './demo.md?raw' | ||
function code(properties: any) { | ||
if (properties.className?.includes('language-mermaid')) { | ||
return MermaidRender | ||
} | ||
return NormalCode | ||
} | ||
const instance = getCurrentInstance() | ||
onMounted(() => { | ||
instance?.proxy?.$forceUpdate() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<VueMarkdownRender | ||
class="markdown-body" | ||
:content="content" | ||
:components="{ code }" | ||
:remark-plugins="[remarkGfm, remarkToc, remarkMath]" | ||
:rehype-plugins="[ | ||
rehypeRaw, | ||
[ | ||
rehypeHighlight, | ||
{ | ||
plainText: ['mermaid'], | ||
}, | ||
], | ||
[ | ||
rehypeKatex, | ||
{ | ||
macros: { | ||
'\\f': '#1f(#2)', | ||
}, | ||
}, | ||
], | ||
]" | ||
/> | ||
</template> | ||
|
||
<style> | ||
html, | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
background: #000; | ||
scroll-behavior: smooth; | ||
} | ||
</style> | ||
|
||
<style scoped> | ||
.markdown-body { | ||
box-sizing: border-box; | ||
min-width: 200px; | ||
max-width: 980px; | ||
margin: 0 auto; | ||
padding: 45px; | ||
} | ||
@media (max-width: 767px) { | ||
.markdown-body { | ||
padding: 15px; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts" setup> | ||
import { ref, onMounted } from "vue" | ||
import mermaid from 'mermaid' | ||
const pre = ref() | ||
onMounted(async () => { | ||
mermaid.initialize({ startOnLoad: false }) | ||
await mermaid.run({ | ||
nodes: [pre.value], | ||
suppressErrors: true | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div ref="pre" class="mermaid"><slot /></div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<code><slot /></code> | ||
</template> |
Oops, something went wrong.