Skip to content

Commit ace4c38

Browse files
committed
fix: fix search box style, enhance anchor
1 parent 6fd4960 commit ace4c38

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

docs/.vitepress/theme/anchor/exampleAutoAnchorPreprocessor.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ export const exampleAutoAnchorPreprocessor = (md: MarkdownIt) => {
77
const processedLines = lines.map((line) => {
88
if (line.startsWith(":::") && (line.includes(":::tip Example") || line.includes("::: tip Example"))) {
99
const title = line.split(/tip (.+)/)[1]
10-
const processedTitle = slugify(title.replace(" – ", ""));
10+
const processedTitle = slugify(title
11+
.replace(" – ", "-")
12+
.replace(":", "-")
13+
.replace("\"", "")
14+
.replace("'", "")
15+
.replace("<", "")
16+
.replace(">", "")
17+
);
1118
return `
1219
<div style="height: 0; color: rgba(0,0,0,0%);position: relative;top: 32px">
1320
<h3 id="${processedTitle}">${title}
14-
<a class="header-anchor" href="#${processedTitle}" aria-label="Permalink to &quot;${title}&quot;">​</a>
21+
<a class="header-anchor" href="#${processedTitle}">​</a>
1522
</h3>
1623
</div>
1724

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

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,38 @@
1515
overflow: hidden;
1616
}
1717

18-
.DocSearch-Button .DocSearch-Button-Key {
19-
border: none;
18+
.mermaid {
19+
display: flex;
20+
justify-content: center;
21+
align-items: center;
2022
}
2123

24+
.DocSearch-Button-Key {
25+
color: var(--docsearch-muted-color) !important;
26+
}
2227

23-
.DocSearch-Button .DocSearch-Button-Key + .DocSearch-Button-Key {
24-
border: none;
28+
.DocSearch-Button:hover .DocSearch-Button-Keys {
29+
border: none !important;
2530
}
2631

27-
.mermaid {
28-
display: flex;
29-
justify-content: center;
30-
align-items: center;
32+
.DocSearch-Button .DocSearch-Button-Keys {
33+
border: none !important;
34+
gap: 0 !important;
35+
padding: 0 !important;
36+
}
37+
38+
kbd:not(.DocSearch-Button-Key) {
39+
background-color: #eee !important;
40+
border-radius: 3px;
41+
border: 1px solid #b4b4b4;
42+
box-shadow:
43+
0 1px 1px rgba(0, 0, 0, 0.2),
44+
0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
45+
color: #333;
46+
display: inline-block;
47+
font-size: 0.85em;
48+
font-weight: 700;
49+
line-height: 1;
50+
padding: 5px;
51+
white-space: nowrap;
3152
}

docs/en/create-commands/functions-and-tags/function-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The `FunctionArgument` class is used to represent a function or a tag in Minecra
1414

1515
Therefore, if a user supplies a single function, the `FunctionWrapper[]` will be of size 1, and if the user supplies a tag which can consist of multiple functions, the `FunctionWrapper[]` will consist of the array of functions as declared by that tag.
1616

17-
::::tip Example – Minecraft's /function command
17+
::::tip Example – Minecraft's `/function` command
1818

1919
Since it's a little difficult to demonstrate a custom use for the `FunctionArgument`, we will show how you can implement Vanilla Minecraft's `/function` command. In this example, we want a command that uses the following syntax:
2020

0 commit comments

Comments
 (0)