Skip to content

Commit e278512

Browse files
committed
Merge branch 'master' into dev/dev
2 parents e28728d + 334d68e commit e278512

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

docs/.vitepress/config.mts

+9
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ const vitepressOptions: UserConfig = {
121121
exampleAutoAnchorPreprocessor(md);
122122
titleAnchorPreprocessor(md);
123123
mathjaxContainerPreprocessor(md);
124+
125+
// Replace "kt" in the top right of code blocks with "kotlin"
126+
const render = md.renderer.rules.fence!;
127+
md.renderer.rules.fence = (tokens, idx, options, env, self) => {
128+
if (tokens[idx].info.startsWith("kt[")) {
129+
tokens[idx].info = tokens[idx].info.replace("kt[", "kotlin[");
130+
}
131+
return render(tokens, idx, options, env, self);
132+
};
124133
}
125134
}
126135
}

docs/.vitepress/theme/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ function injectIndexPageIcons() {
7777
a.classList.add("index-download-button");
7878
} else if (href.includes("/intro")) {
7979
a.classList.add("index-docs-button");
80+
} else if (href.includes("javadocs")) {
81+
a.classList.add("index-javadocs-button")
8082
}
8183
})
8284
}

docs/.vitepress/theme/style/global.css

+17
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ kbd:not(.DocSearch-Button-Key) {
9191
content: url(/images/index/docs-light.svg);
9292
}
9393

94+
.index-javadocs-button:before {
95+
display: block;
96+
float: left;
97+
width: 18px;
98+
height: 18px;
99+
padding-top: 5px;
100+
margin-left: -4px;
101+
margin-right: 6px;
102+
/*noinspection CssUnknownTarget*/
103+
content: url(/images/index/javadocs-light.svg);
104+
}
105+
94106
.dark {
95107
.tip.custom-block > .danger.custom-block {
96108
background-color: #3e2129;
@@ -105,4 +117,9 @@ kbd:not(.DocSearch-Button-Key) {
105117
/*noinspection CssUnknownTarget*/
106118
content: url(/images/index/docs-dark.svg);
107119
}
120+
121+
.index-javadocs-button:before {
122+
/*noinspection CssUnknownTarget*/
123+
content: url(/images/index/javadocs-dark.svg);
124+
}
108125
}

docs/en/index.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ hero:
99
- theme: brand
1010
text: Documentation
1111
link: /intro
12+
- theme: alt
13+
text: Javadocs
14+
link: https://javadocs.commandapi.dev/
1215
- theme: alt
1316
text: Latest Release
1417
link: https://github.com/CommandAPI/CommandAPI/releases/latest
Loading
Loading

0 commit comments

Comments
 (0)