Skip to content

Commit 882d27c

Browse files
committed
docs: setup vitepress project correctly
1 parent f37d8e7 commit 882d27c

File tree

19 files changed

+326
-374
lines changed

19 files changed

+326
-374
lines changed

.devcontainer/devcontainer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@
8181
"evenBetterToml.schema.associations": {
8282
"^(.*(/|\\\\)\\.?robot\\.toml|\\.?robot\\.toml)$": "http://localhost:8000/etc/robot.toml.json"
8383
},
84-
"yaml.schemas": {
85-
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
86-
},
8784
"mypy-type-checker.importStrategy": "fromEnvironment",
8885
"debugpy.debugJustMyCode": false,
8986
"black-formatter.importStrategy": "fromEnvironment",

.vscode/tasks.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@
2020
"type": "shell",
2121
"command": "hatch run build:bump",
2222
"problemMatcher": []
23-
},
24-
{
25-
"label": "robotcode: mkdocs serve",
26-
"type": "shell",
27-
"command": "hatch run pages:mkdocs serve",
28-
"problemMatcher": []
2923
}
30-
3124
]
3225
}

.vscodeignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ playground
4646
coverage.xml
4747
.python-version
4848

49-
# mkdocs
49+
# docs
5050
docs
51-
overrides
52-
site
5351

5452
# others
5553
scripts

docs/.vitepress/config.mts

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { defineConfig } from "vitepress";
22
import { generateSidebar } from "vitepress-sidebar";
3+
import taskLists from "markdown-it-task-lists";
4+
import { tabsMarkdownPlugin } from "vitepress-plugin-tabs";
35
import robotframework from "../../syntaxes/robotframework.tmLanguage.json";
46
import { readFileSync } from "fs";
5-
6-
const python_svg = readFileSync("docs/images/python.svg", "utf-8");
7-
const vscode_svg = readFileSync("docs/images/vscode.svg", "utf-8");
8-
const opencollective_svg = readFileSync("docs/images/opencollective.svg", "utf-8");
7+
import pkg from "../../package.json";
8+
//import python_svg from "../images/python.svg?raw";
9+
const python_svg = readFileSync("images/python.svg", "utf-8");
10+
const vscode_svg = readFileSync("images/vscode.svg", "utf-8");
11+
const opencollective_svg = readFileSync("images/opencollective.svg", "utf-8");
912

1013
// https://vitepress.dev/reference/site-config
1114
export default defineConfig({
@@ -15,7 +18,20 @@ export default defineConfig({
1518
lastUpdated: true,
1619
cleanUrls: true,
1720
metaChunk: true,
18-
21+
sitemap: {
22+
hostname: "https://robotcode.io",
23+
},
24+
head: [
25+
["link", { rel: "icon", type: "image/svg+xml", href: "/robotcode-logo.svg" }],
26+
["link", { rel: "icon", type: "image/png", href: "/robotcode-logo-mini.png" }],
27+
["meta", { name: "theme-color", content: "#5f67ee" }],
28+
["meta", { property: "og:type", content: "website" }],
29+
["meta", { property: "og:locale", content: "en" }],
30+
["meta", { property: "og:title", content: "RobotCode | Robot Framework for Visual Studio Code and more" }],
31+
["meta", { property: "og:site_name", content: "RobotCode" }],
32+
["meta", { property: "og:image", content: "https://robotcode.io/robotcode-logo.jpg" }],
33+
["meta", { property: "og:url", content: "https://robotcode.io/" }],
34+
],
1935
themeConfig: {
2036
// https://vitepress.dev/reference/default-theme-config
2137
logo: { src: "/robotcode-logo.svg", alt: "RobotCode Logo" },
@@ -33,6 +49,19 @@ export default defineConfig({
3349
{ text: "Documentation", link: "/01_about" },
3450
{ text: "Contribute", link: "https://github.com/robotcodedev" },
3551
{ text: "Q&A", link: "https://github.com/robotcodedev/robotcode/discussions/categories/q-a" },
52+
{
53+
text: pkg.version,
54+
items: [
55+
{
56+
text: "Changelog",
57+
link: "https://github.com/robotcodedev/robotcode/blob/main/CHANGELOG.md",
58+
},
59+
{
60+
text: "Contributing",
61+
link: "https://github.com/robotcodedev/robotcode/blob/main/CONTRIBUTING.md",
62+
},
63+
],
64+
},
3665
],
3766
search: {
3867
provider: "local",
@@ -50,7 +79,7 @@ export default defineConfig({
5079
// }
5180
// ],
5281
sidebar: generateSidebar({
53-
documentRootPath: "docs",
82+
documentRootPath: ".",
5483
collapsed: true,
5584
useTitleFromFileHeading: true,
5685
useTitleFromFrontmatter: true,
@@ -65,8 +94,15 @@ export default defineConfig({
6594
],
6695
},
6796
markdown: {
97+
config(md: any) {
98+
md.use(taskLists);
99+
md.use(tabsMarkdownPlugin);
100+
},
101+
attrs: {
102+
disable: false,
103+
},
68104
image: {
69-
lazyLoading: true
105+
lazyLoading: true,
70106
},
71107
lineNumbers: true,
72108
theme: { light: "material-theme-lighter", dark: "material-theme-darker" },

docs/.vitepress/theme/index.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
// https://vitepress.dev/guide/custom-theme
2-
import { h } from 'vue'
3-
import type { Theme } from 'vitepress'
4-
import DefaultTheme from 'vitepress/theme'
5-
import './style.css'
2+
import { h } from "vue";
3+
import type { Theme } from "vitepress";
4+
import DefaultTheme from "vitepress/theme";
5+
import { enhanceAppWithTabs } from "vitepress-plugin-tabs/client";
6+
import "./style.css";
67

78
export default {
89
extends: DefaultTheme,
910
Layout: () => {
1011
return h(DefaultTheme.Layout, null, {
1112
// https://vitepress.dev/guide/extending-default-theme#layout-slots
12-
})
13+
});
1314
},
1415
enhanceApp({ app, router, siteData }) {
1516
// ...
16-
}
17-
} satisfies Theme
17+
enhanceAppWithTabs(app);
18+
},
19+
} satisfies Theme;

docs/.vitepress/theme/style.css

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* in custom container, badges, etc.
4444
* -------------------------------------------------------------------------- */
4545

46-
:root {
46+
:root {
4747
--vp-c-default-1: var(--vp-c-gray-1);
4848
--vp-c-default-2: var(--vp-c-gray-2);
4949
--vp-c-default-3: var(--vp-c-gray-3);
@@ -92,17 +92,13 @@
9292

9393
:root {
9494
--vp-home-hero-name-color: transparent;
95-
--vp-home-hero-name-background: -webkit-linear-gradient(
96-
90deg,
97-
#234a34 10%,
98-
#e9e9e2
99-
);
100-
101-
--vp-home-hero-image-background-image: linear-gradient(
102-
-45deg,
103-
#242f29 50%,
104-
#2e4e31 50%
105-
);
95+
--vp-home-hero-name-background: -webkit-linear-gradient(90deg,
96+
#234a34 10%,
97+
#e9e9e2);
98+
99+
--vp-home-hero-image-background-image: linear-gradient(-45deg,
100+
#242f29 50%,
101+
#2e4e31 50%);
106102
--vp-home-hero-image-filter: blur(44px);
107103
}
108104

@@ -141,7 +137,7 @@
141137
* Typography
142138
* -------------------------------------------------------------------------- */
143139

144-
:root {
140+
:root {
145141
--vp-font-family-base: 'Inter', ui-sans-serif, system-ui, sans-serif,
146142
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
147143
--vp-font-family-mono: ui-monospace, 'Menlo', 'Monaco', 'Consolas',
@@ -158,4 +154,8 @@
158154

159155
.VPHero .name {
160156
font-family: "Courier New", system-ui;
157+
}
158+
159+
img[src*="shields.io"] {
160+
display: inline;
161161
}

docs/99_features.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,29 @@
66
*** Test Cases ***
77
Test
88
Log Hello, world!
9-
9+
IF $a + "asdasd" + 1
10+
END
1011
```
1112

1213
## some more tests
1314

14-
```robot[1-3]
15+
```robot
1516
*** Test Cases ***
1617
Test
1718
Log Hello, world!
1819
19-
```
20+
```
21+
22+
:::tabs
23+
== tab a
24+
a content
25+
== tab b
26+
b content
27+
:::
28+
29+
:::tabs
30+
== tab a
31+
a content 2
32+
== tab b
33+
b content 2
34+
:::

docs/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ features:
4040
- title: Feature C
4141
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit---
4242
---
43+
44+
45+
46+
4347
[![Visual Studio Marketplace](https://img.shields.io/visual-studio-marketplace/v/d-biehl.robotcode?style=flat&label=VS%20Marketplace&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode)
4448
[![Installs](https://img.shields.io/visual-studio-marketplace/i/d-biehl.robotcode?style=flat)](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode)
4549
[![Build Status](https://img.shields.io/github/actions/workflow/status/robotcodedev/robotcode/build-test-package-publish.yml?branch=main&style=flat&logo=github)](https://github.com/robotcodedev/robotcode/actions?query=workflow:build_test_package_publish)
46-
[![License](https://img.shields.io/github/license/robotcodedev/robotcode?style=flat&logo=apache)](https://github.com/robotcodedev/robotcode/blob/master/LICENSE)
4750
[![PyPI - Version](https://img.shields.io/pypi/v/robotcode.svg?style=flat)](https://pypi.org/project/robotcode)
4851
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/robotcode.svg?style=flat)](https://pypi.org/project/robotcode)
4952
[![PyPI - Downloads](https://img.shields.io/pypi/dm/robotcode.svg?style=flat&label=downloads)](https://pypi.org/project/robotcode/)
53+
{align="center"}

docs/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "docs",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"dev": "vitepress dev",
7+
"build": "vitepress build",
8+
"preview": "vitepress preview"
9+
},
10+
"devDependencies": {
11+
"markdown-it-mathjax3": "^4.3.2",
12+
"markdown-it-task-lists": "^2.1.1",
13+
"typescript": "^5.4.5",
14+
"typescript-eslint": "^7.9.0",
15+
"vitepress": "^1.2.0",
16+
"vitepress-plugin-tabs": "^0.5.0",
17+
"vitepress-sidebar": "^1.23.2"
18+
}
19+
}
File renamed without changes.

0 commit comments

Comments
 (0)