Skip to content

Commit 47356b2

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents b36c7b9 + 6ef9717 commit 47356b2

File tree

357 files changed

+3611
-24208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+3611
-24208
lines changed

.github/workflows/docs.yml

+46-7
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,26 @@ on:
77
push:
88
branches:
99
- master
10+
- vitepress
1011
paths:
12+
- 'builddefs/docsgen/**'
1113
- 'tmk_core/**'
1214
- 'quantum/**'
1315
- 'platforms/**'
1416
- 'docs/**'
1517
- '.github/workflows/docs.yml'
1618

19+
defaults:
20+
run:
21+
shell: bash
22+
1723
jobs:
1824
generate:
1925
runs-on: ubuntu-latest
2026
container: ghcr.io/qmk/qmk_cli
2127

2228
# protect against those who develop with their fork on master
23-
if: github.repository == 'qmk/qmk_firmware'
29+
if: github.repository == 'qmk/qmk_firmware' || (github.repository == 'tzarc/qmk_firmware' && github.ref == 'refs/heads/vitepress')
2430

2531
steps:
2632
- uses: actions/checkout@v4
@@ -29,18 +35,51 @@ jobs:
2935

3036
- name: Install dependencies
3137
run: |
32-
apt-get update && apt-get install -y rsync nodejs npm doxygen
38+
apt-get update && apt-get install -y rsync doxygen curl
39+
# install nvm
40+
touch $HOME/.bashrc
41+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
42+
43+
- name: Install node
44+
run: |
45+
source $HOME/.bashrc
46+
nvm install 20
47+
nvm use 20
48+
corepack enable
3349
npm install -g moxygen
3450
3551
- name: Build docs
3652
run: |
53+
source $HOME/.bashrc
54+
nvm use 20
3755
qmk --verbose generate-docs
56+
touch '.build/docs/.nojekyll'
57+
58+
- name: Set CNAME
59+
if: github.repository == 'qmk/qmk_firmware'
60+
run: |
61+
# Override target CNAME
62+
echo 'docs.qmk.fm' > .build/docs/CNAME
63+
64+
- name: Override CNAME
65+
if: github.repository == 'tzarc/qmk_firmware'
66+
run: |
67+
# Temporarily override target CNAME during development
68+
echo 'vitepress.qmk.fm' > .build/docs/CNAME
69+
70+
- name: Deploy
71+
if: github.repository == 'qmk/qmk_firmware'
72+
uses: JamesIves/github-pages-deploy-action@v4.6.1
73+
with:
74+
token: ${{ secrets.GITHUB_TOKEN }}
75+
branch: gh-pages
76+
folder: .build/docs
77+
git-config-name: QMK Bot
78+
git-config-email: hello@qmk.fm
3879

3980
- name: Deploy
81+
if: github.repository == 'tzarc/qmk_firmware'
4082
uses: JamesIves/github-pages-deploy-action@v4.6.1
4183
with:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
BASE_BRANCH: master
44-
BRANCH: gh-pages
45-
FOLDER: .build/docs
46-
GIT_CONFIG_EMAIL: hello@qmk.fm
84+
branch: gh-pages
85+
folder: .build/docs

Doxyfile

+35-35
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DOXYFILE_ENCODING = UTF-8
2121
PROJECT_NAME = "QMK Firmware"
2222
PROJECT_NUMBER = https://github.com/qmk/qmk_firmware
2323
PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families"
24-
OUTPUT_DIRECTORY = .build/doxygen
24+
OUTPUT_DIRECTORY = .build/docs/static/doxygen
2525
ALLOW_UNICODE_NAMES = NO
2626
OUTPUT_LANGUAGE = English
2727
BRIEF_MEMBER_DESC = YES
@@ -40,22 +40,22 @@ ABBREVIATE_BRIEF = "The $name class" \
4040
ALWAYS_DETAILED_SEC = NO
4141
INLINE_INHERITED_MEMB = NO
4242
FULL_PATH_NAMES = YES
43-
STRIP_FROM_PATH =
44-
STRIP_FROM_INC_PATH =
43+
STRIP_FROM_PATH =
44+
STRIP_FROM_INC_PATH =
4545
SHORT_NAMES = NO
4646
JAVADOC_AUTOBRIEF = NO
4747
QT_AUTOBRIEF = NO
4848
MULTILINE_CPP_IS_BRIEF = NO
4949
INHERIT_DOCS = YES
5050
SEPARATE_MEMBER_PAGES = NO
5151
TAB_SIZE = 4
52-
ALIASES =
53-
TCL_SUBST =
52+
ALIASES =
53+
TCL_SUBST =
5454
OPTIMIZE_OUTPUT_FOR_C = YES
5555
OPTIMIZE_OUTPUT_JAVA = NO
5656
OPTIMIZE_FOR_FORTRAN = NO
5757
OPTIMIZE_OUTPUT_VHDL = NO
58-
EXTENSION_MAPPING =
58+
EXTENSION_MAPPING =
5959
MARKDOWN_SUPPORT = YES
6060
TOC_INCLUDE_HEADINGS = 2
6161
AUTOLINK_SUPPORT = YES
@@ -104,14 +104,14 @@ GENERATE_TODOLIST = YES
104104
GENERATE_TESTLIST = YES
105105
GENERATE_BUGLIST = YES
106106
GENERATE_DEPRECATEDLIST= YES
107-
ENABLED_SECTIONS =
107+
ENABLED_SECTIONS =
108108
MAX_INITIALIZER_LINES = 30
109109
SHOW_USED_FILES = YES
110110
SHOW_FILES = YES
111111
SHOW_NAMESPACES = YES
112-
FILE_VERSION_FILTER =
113-
LAYOUT_FILE =
114-
CITE_BIB_FILES =
112+
FILE_VERSION_FILTER =
113+
LAYOUT_FILE =
114+
CITE_BIB_FILES =
115115

116116
#---------------------------------------------------------------------------
117117
# Configuration options related to warning and progress messages
@@ -124,7 +124,7 @@ WARN_IF_DOC_ERROR = YES
124124
WARN_NO_PARAMDOC = NO
125125
WARN_AS_ERROR = NO
126126
WARN_FORMAT = "$file:$line: $text"
127-
WARN_LOGFILE =
127+
WARN_LOGFILE =
128128

129129
#---------------------------------------------------------------------------
130130
# Configuration options related to the input files
@@ -143,19 +143,19 @@ FILE_PATTERNS = *.c \
143143
*.hpp \
144144
*.h++
145145
RECURSIVE = YES
146-
EXCLUDE =
146+
EXCLUDE =
147147
EXCLUDE_SYMLINKS = NO
148148
EXCLUDE_PATTERNS = */protocol/arm_atsam/*
149-
EXCLUDE_SYMBOLS =
150-
EXAMPLE_PATH =
149+
EXCLUDE_SYMBOLS =
150+
EXAMPLE_PATH =
151151
EXAMPLE_PATTERNS = *
152152
EXAMPLE_RECURSIVE = NO
153-
IMAGE_PATH =
154-
INPUT_FILTER =
155-
FILTER_PATTERNS =
153+
IMAGE_PATH =
154+
INPUT_FILTER =
155+
FILTER_PATTERNS =
156156
FILTER_SOURCE_FILES = NO
157-
FILTER_SOURCE_PATTERNS =
158-
USE_MDFILE_AS_MAINPAGE =
157+
FILTER_SOURCE_PATTERNS =
158+
USE_MDFILE_AS_MAINPAGE =
159159

160160
#---------------------------------------------------------------------------
161161
# Configuration options related to source browsing
@@ -177,7 +177,7 @@ VERBATIM_HEADERS = YES
177177

178178
ALPHABETICAL_INDEX = YES
179179
COLS_IN_ALPHA_INDEX = 5
180-
IGNORE_PREFIX =
180+
IGNORE_PREFIX =
181181

182182
#---------------------------------------------------------------------------
183183
# Configuration options related to disabled outputs
@@ -207,18 +207,18 @@ ENABLE_PREPROCESSING = YES
207207
MACRO_EXPANSION = NO
208208
EXPAND_ONLY_PREDEF = NO
209209
SEARCH_INCLUDES = YES
210-
INCLUDE_PATH =
211-
INCLUDE_FILE_PATTERNS =
210+
INCLUDE_PATH =
211+
INCLUDE_FILE_PATTERNS =
212212
PREDEFINED = __DOXYGEN__ PROGMEM
213-
EXPAND_AS_DEFINED =
213+
EXPAND_AS_DEFINED =
214214
SKIP_FUNCTION_MACROS = YES
215215

216216
#---------------------------------------------------------------------------
217217
# Configuration options related to external references
218218
#---------------------------------------------------------------------------
219219

220-
TAGFILES =
221-
GENERATE_TAGFILE =
220+
TAGFILES =
221+
GENERATE_TAGFILE =
222222
ALLEXTERNALS = NO
223223
EXTERNAL_GROUPS = YES
224224
EXTERNAL_PAGES = YES
@@ -229,14 +229,14 @@ PERL_PATH = /usr/bin/perl
229229
#---------------------------------------------------------------------------
230230

231231
CLASS_DIAGRAMS = YES
232-
MSCGEN_PATH =
233-
DIA_PATH =
232+
MSCGEN_PATH =
233+
DIA_PATH =
234234
HIDE_UNDOC_RELATIONS = YES
235235
HAVE_DOT = NO
236236
DOT_NUM_THREADS = 0
237237
DOT_FONTNAME = Helvetica
238238
DOT_FONTSIZE = 10
239-
DOT_FONTPATH =
239+
DOT_FONTPATH =
240240
CLASS_GRAPH = YES
241241
COLLABORATION_GRAPH = YES
242242
GROUP_GRAPHS = YES
@@ -251,13 +251,13 @@ GRAPHICAL_HIERARCHY = YES
251251
DIRECTORY_GRAPH = YES
252252
DOT_IMAGE_FORMAT = png
253253
INTERACTIVE_SVG = NO
254-
DOT_PATH =
255-
DOTFILE_DIRS =
256-
MSCFILE_DIRS =
257-
DIAFILE_DIRS =
258-
PLANTUML_JAR_PATH =
259-
PLANTUML_CFG_FILE =
260-
PLANTUML_INCLUDE_PATH =
254+
DOT_PATH =
255+
DOTFILE_DIRS =
256+
MSCFILE_DIRS =
257+
DIAFILE_DIRS =
258+
PLANTUML_JAR_PATH =
259+
PLANTUML_CFG_FILE =
260+
PLANTUML_INCLUDE_PATH =
261261
DOT_GRAPH_MAX_NODES = 50
262262
MAX_DOT_GRAPH_DEPTH = 0
263263
DOT_TRANSPARENT = NO

builddefs/docsgen/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.vitepress/cache
3+
.vitepress/.temp
4+
.vitepress/dist
5+
docs
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { defineConfig } from "vitepress";
2+
import { tabsMarkdownPlugin } from "vitepress-plugin-tabs";
3+
import sidebar from "../../../docs/_sidebar.json";
4+
5+
// https://vitepress.dev/reference/site-config
6+
export default defineConfig(({ mode }) => {
7+
const prod = mode === "production";
8+
return {
9+
title: "QMK Firmware",
10+
description: "Documentation for QMK Firmware",
11+
12+
srcDir: prod ? "docs" : "../../docs",
13+
outDir: "../../.build/docs",
14+
cleanUrls: true,
15+
16+
markdown: {
17+
config(md) {
18+
md.use(tabsMarkdownPlugin);
19+
},
20+
},
21+
22+
vite: {
23+
resolve: {
24+
preserveSymlinks: true,
25+
},
26+
},
27+
28+
themeConfig: {
29+
// https://vitepress.dev/reference/default-theme-config
30+
logo: {
31+
light: "/badge-community-light.svg",
32+
dark: "/badge-community-dark.svg",
33+
},
34+
siteTitle: false,
35+
36+
nav: [{ text: "Home", link: "./" }],
37+
38+
search: {
39+
provider: "local",
40+
},
41+
42+
sidebar: sidebar,
43+
44+
socialLinks: [
45+
{ icon: { svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="50px" height="50px"><path d="M 29 3 C 28.0625 3 27.164063 3.382813 26.5 4 C 25.835938 4.617188 25.363281 5.433594 25 6.40625 C 24.355469 8.140625 24.085938 10.394531 24.03125 13.03125 C 19.234375 13.179688 14.820313 14.421875 11.28125 16.46875 C 10.214844 15.46875 8.855469 14.96875 7.5 14.96875 C 6.089844 14.96875 4.675781 15.511719 3.59375 16.59375 C 1.425781 18.761719 1.425781 22.238281 3.59375 24.40625 L 3.84375 24.65625 C 3.3125 26.035156 3 27.488281 3 29 C 3 33.527344 5.566406 37.585938 9.5625 40.4375 C 13.558594 43.289063 19.007813 45 25 45 C 30.992188 45 36.441406 43.289063 40.4375 40.4375 C 44.433594 37.585938 47 33.527344 47 29 C 47 27.488281 46.6875 26.035156 46.15625 24.65625 L 46.40625 24.40625 C 48.574219 22.238281 48.574219 18.761719 46.40625 16.59375 C 45.324219 15.511719 43.910156 14.96875 42.5 14.96875 C 41.144531 14.96875 39.785156 15.46875 38.71875 16.46875 C 35.195313 14.433594 30.800781 13.191406 26.03125 13.03125 C 26.09375 10.546875 26.363281 8.46875 26.875 7.09375 C 27.164063 6.316406 27.527344 5.757813 27.875 5.4375 C 28.222656 5.117188 28.539063 5 29 5 C 29.460938 5 29.683594 5.125 30.03125 5.40625 C 30.378906 5.6875 30.785156 6.148438 31.3125 6.6875 C 32.253906 7.652344 33.695313 8.714844 36.09375 8.9375 C 36.539063 11.238281 38.574219 13 41 13 C 43.75 13 46 10.75 46 8 C 46 5.25 43.75 3 41 3 C 38.605469 3 36.574219 4.710938 36.09375 6.96875 C 34.3125 6.796875 33.527344 6.109375 32.75 5.3125 C 32.300781 4.851563 31.886719 4.3125 31.3125 3.84375 C 30.738281 3.375 29.9375 3 29 3 Z M 41 5 C 42.667969 5 44 6.332031 44 8 C 44 9.667969 42.667969 11 41 11 C 39.332031 11 38 9.667969 38 8 C 38 6.332031 39.332031 5 41 5 Z M 25 15 C 30.609375 15 35.675781 16.613281 39.28125 19.1875 C 42.886719 21.761719 45 25.226563 45 29 C 45 32.773438 42.886719 36.238281 39.28125 38.8125 C 35.675781 41.386719 30.609375 43 25 43 C 19.390625 43 14.324219 41.386719 10.71875 38.8125 C 7.113281 36.238281 5 32.773438 5 29 C 5 25.226563 7.113281 21.761719 10.71875 19.1875 C 14.324219 16.613281 19.390625 15 25 15 Z M 7.5 16.9375 C 8.203125 16.9375 8.914063 17.148438 9.53125 17.59375 C 7.527344 19.03125 5.886719 20.769531 4.75 22.71875 C 3.582031 21.296875 3.660156 19.339844 5 18 C 5.714844 17.285156 6.609375 16.9375 7.5 16.9375 Z M 42.5 16.9375 C 43.390625 16.9375 44.285156 17.285156 45 18 C 46.339844 19.339844 46.417969 21.296875 45.25 22.71875 C 44.113281 20.769531 42.472656 19.03125 40.46875 17.59375 C 41.085938 17.148438 41.796875 16.9375 42.5 16.9375 Z M 17 22 C 14.800781 22 13 23.800781 13 26 C 13 28.199219 14.800781 30 17 30 C 19.199219 30 21 28.199219 21 26 C 21 23.800781 19.199219 22 17 22 Z M 33 22 C 30.800781 22 29 23.800781 29 26 C 29 28.199219 30.800781 30 33 30 C 35.199219 30 37 28.199219 37 26 C 37 23.800781 35.199219 22 33 22 Z M 17 24 C 18.117188 24 19 24.882813 19 26 C 19 27.117188 18.117188 28 17 28 C 15.882813 28 15 27.117188 15 26 C 15 24.882813 15.882813 24 17 24 Z M 33 24 C 34.117188 24 35 24.882813 35 26 C 35 27.117188 34.117188 28 33 28 C 31.882813 28 31 27.117188 31 26 C 31 24.882813 31.882813 24 33 24 Z M 34.15625 33.84375 C 34.101563 33.851563 34.050781 33.859375 34 33.875 C 33.683594 33.9375 33.417969 34.144531 33.28125 34.4375 C 33.28125 34.4375 32.757813 35.164063 31.4375 36 C 30.117188 36.835938 28.058594 37.6875 25 37.6875 C 21.941406 37.6875 19.882813 36.835938 18.5625 36 C 17.242188 35.164063 16.71875 34.4375 16.71875 34.4375 C 16.492188 34.082031 16.066406 33.90625 15.65625 34 C 15.332031 34.082031 15.070313 34.316406 14.957031 34.632813 C 14.84375 34.945313 14.894531 35.292969 15.09375 35.5625 C 15.09375 35.5625 15.863281 36.671875 17.46875 37.6875 C 19.074219 38.703125 21.558594 39.6875 25 39.6875 C 28.441406 39.6875 30.925781 38.703125 32.53125 37.6875 C 34.136719 36.671875 34.90625 35.5625 34.90625 35.5625 C 35.207031 35.273438 35.296875 34.824219 35.128906 34.441406 C 34.960938 34.058594 34.574219 33.820313 34.15625 33.84375 Z"/></svg>' }, link: "https://reddit.com/r/olkb" },
46+
{ icon: "discord", link: "https://discord.gg/qmk" },
47+
{ icon: "github", link: "https://github.com/qmk/qmk_firmware" },
48+
],
49+
}
50+
};
51+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script setup>
2+
import DefaultTheme from 'vitepress/theme'
3+
import { useRouter } from 'vitepress'
4+
import { onBeforeMount } from 'vue';
5+
6+
const router = useRouter()
7+
onBeforeMount(async () => {
8+
if (window.location.href.includes('/#/')) {
9+
const newUrl = window.location.href.replace(/\/#\//, '/').replace(/\?id=/, '#');
10+
window.history.replaceState({}, '', newUrl);
11+
await router.go(newUrl);
12+
}
13+
});
14+
</script>
15+
16+
<template>
17+
<DefaultTheme.Layout/>
18+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Override <kbd> as vitepress doesn't put them with borders */
2+
kbd {
3+
border: 1px solid var(--vp-c-text-1);
4+
border-radius: 0.6em;
5+
margin: 0.2em;
6+
padding: 0.2em;
7+
}
8+
9+
:root {
10+
--vp-nav-logo-height: 100%;
11+
}
12+
13+
.logo {
14+
padding-bottom: 0.2em;
15+
}
16+
17+
.VPNavBarTitle.has-sidebar .title {
18+
border-bottom: 0;
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { Theme } from 'vitepress'
2+
import DefaultTheme from 'vitepress/theme'
3+
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
4+
import QMKLayout from './QMKLayout.vue'
5+
import './custom.css'
6+
7+
export default {
8+
extends: DefaultTheme,
9+
Layout: QMKLayout,
10+
enhanceApp({ app }) {
11+
enhanceAppWithTabs(app)
12+
}
13+
} satisfies Theme

builddefs/docsgen/build-docs.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
4+
yarn install
5+
[[ -e docs ]] || ln -sf ../../docs docs
6+
DEBUG='vitepress:*,vite:*' yarn run docs:build

builddefs/docsgen/package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"license": "GPL-2.0-or-later",
3+
"devDependencies": {
4+
"vite": "^5.2.10",
5+
"vitepress": "^1.1.0",
6+
"vitepress-plugin-tabs": "^0.5.0",
7+
"vue": "^3.4.24"
8+
},
9+
"scripts": {
10+
"docs:dev": "vitepress dev --host 0.0.0.0",
11+
"docs:build": "vitepress build",
12+
"docs:preview": "vitepress preview --host 0.0.0.0"
13+
}
14+
}

builddefs/docsgen/start-docs.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
4+
yarn install
5+
DEBUG='vitepress:*,vite:*' yarn run docs:dev

0 commit comments

Comments
 (0)