Skip to content

Commit e0bffcc

Browse files
committed
feat: add vitepress site generator
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent e45fae1 commit e0bffcc

32 files changed

+2751
-840
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
/build
1+
/.vitepress/cache
22
/.vscode/settings.json
3-
/cpm_modules
3+
/build
4+
/node_modules
45
/vcpkg_installed
56
/test/wasm/build*
67
.DS_Store

.vitepress/config.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "Component Model C++",
6+
description: " C++ ABI implementation of the WebAssembly Component Model",
7+
base: '/component-model-cpp/',
8+
srcExclude: ["build/**", "node_modules/**", "ref/**", "vcpkg/**", "vcpkg_overlays/**"],
9+
10+
themeConfig: {
11+
editLink: {
12+
pattern: 'https://github.com/GordonSmith/component-model-cpp/edit/main/docs/:path',
13+
text: 'Edit this page on GitHub'
14+
},
15+
16+
nav: [
17+
{ text: 'Home', link: '/' },
18+
{ text: 'Documentation', link: '/api-examples' },
19+
{ text: 'GitHub', link: 'https://github.com/GordonSmith/component-model-cpp' },
20+
{ text: 'Changelog', link: 'https://github.com/GordonSmith/component-model-cpp/blob/trunk/CHANGELOG.md' },
21+
],
22+
23+
sidebar: [
24+
25+
{
26+
text: 'Documentation',
27+
items: [
28+
{ text: 'Generated Files Structure', link: '/docs/generated-files-structure' },
29+
{ text: 'Generated WAMR Helpers', link: '/docs/generated-wamr-helpers' },
30+
{ text: 'Packaging', link: '/docs/PACKAGING' }
31+
]
32+
},
33+
{
34+
text: 'Examples & Guides',
35+
items: [
36+
{ text: 'Markdown Examples', link: '/markdown-examples' }
37+
]
38+
},
39+
{
40+
text: 'Additional Resources',
41+
items: [
42+
{ text: 'Samples', link: '/samples/README' },
43+
{ text: 'Testing', link: '/test/README' },
44+
{ text: 'Grammar', link: '/grammar/README' },
45+
{ text: 'WIT Code Generator', link: '/tools/wit-codegen/README' }
46+
]
47+
}
48+
],
49+
50+
socialLinks: [
51+
{ icon: 'github', link: 'https://github.com/GordonSmith/component-model-cpp' },
52+
{ icon: 'bluesky', link: 'https://bsky.app/profile/schmoo2k.bsky.social' },
53+
{ icon: 'linkedin', link: 'https://www.linkedin.com/in/gordon-smith-0b168a6/' },
54+
]
55+
}
56+
})

.vitepress/theme/custom.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Customize default theme styling by overriding CSS variables:
3+
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
4+
*/
5+
6+
/**
7+
* Colors - Orange Brand
8+
* -------------------------------------------------------------------------- */
9+
10+
:root {
11+
--vp-c-brand-1: #c26518;
12+
--vp-c-brand-2: #d97616;
13+
--vp-c-brand-3: #a54f12;
14+
}
15+
16+
.dark {
17+
--vp-c-brand-1: #d97616;
18+
--vp-c-brand-2: #c26518;
19+
--vp-c-brand-3: #a54f12;
20+
}

.vitepress/theme/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import './custom.css'
3+
4+
export default DefaultTheme

docs/api-examples.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Runtime API Examples
6+
7+
This page demonstrates usage of some of the runtime APIs provided by VitePress.
8+
9+
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10+
11+
```md
12+
<script setup>
13+
import { useData } from 'vitepress'
14+
15+
const { theme, page, frontmatter } = useData()
16+
</script>
17+
18+
## Results
19+
20+
### Theme Data
21+
<pre>{{ theme }}</pre>
22+
23+
### Page Data
24+
<pre>{{ page }}</pre>
25+
26+
### Page Frontmatter
27+
<pre>{{ frontmatter }}</pre>
28+
```
29+
30+
<script setup>
31+
import { useData } from 'vitepress'
32+
33+
const { site, theme, page, frontmatter } = useData()
34+
</script>
35+
36+
## Results
37+
38+
### Theme Data
39+
<pre>{{ theme }}</pre>
40+
41+
### Page Data
42+
<pre>{{ page }}</pre>
43+
44+
### Page Frontmatter
45+
<pre>{{ frontmatter }}</pre>
46+
47+
## More
48+
49+
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

docs/issue-backlog.md

Lines changed: 0 additions & 168 deletions
This file was deleted.

docs/markdown-examples.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Markdown Extension Examples
2+
3+
This page demonstrates some of the built-in markdown extensions provided by VitePress.
4+
5+
## Syntax Highlighting
6+
7+
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
8+
9+
**Input**
10+
11+
````md
12+
```js{4}
13+
export default {
14+
data () {
15+
return {
16+
msg: 'Highlighted!'
17+
}
18+
}
19+
}
20+
```
21+
````
22+
23+
**Output**
24+
25+
```js{4}
26+
export default {
27+
data () {
28+
return {
29+
msg: 'Highlighted!'
30+
}
31+
}
32+
}
33+
```
34+
35+
## Custom Containers
36+
37+
**Input**
38+
39+
```md
40+
::: info
41+
This is an info box.
42+
:::
43+
44+
::: tip
45+
This is a tip.
46+
:::
47+
48+
::: warning
49+
This is a warning.
50+
:::
51+
52+
::: danger
53+
This is a dangerous warning.
54+
:::
55+
56+
::: details
57+
This is a details block.
58+
:::
59+
```
60+
61+
**Output**
62+
63+
::: info
64+
This is an info box.
65+
:::
66+
67+
::: tip
68+
This is a tip.
69+
:::
70+
71+
::: warning
72+
This is a warning.
73+
:::
74+
75+
::: danger
76+
This is a dangerous warning.
77+
:::
78+
79+
::: details
80+
This is a details block.
81+
:::
82+
83+
## More
84+
85+
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

0 commit comments

Comments
 (0)