Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mermaid #910

Draft
wants to merge 2 commits into
base: wiki
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 50 additions & 47 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfigWithTheme } from "vitepress";
import { withMermaid } from "vitepress-plugin-mermaid";
import taskListsPlugin from "markdown-it-task-lists";

import { ThemeConfig } from "./theme";
Expand All @@ -25,60 +26,62 @@ if (isFastBuild) {
);
}

export default defineConfigWithTheme<ThemeConfig>({
title: "Bedrock Wiki",
description: "A knowledge-sharing website for technical features of Minecraft Bedrock.",
export default withMermaid(
defineConfigWithTheme<ThemeConfig>({
title: "Bedrock Wiki",
description: "A knowledge-sharing website for technical features of Minecraft Bedrock.",

head,
transformHead,
head,
transformHead,

srcExclude: isFastBuild ? largePages : undefined,
srcExclude: isFastBuild ? largePages : undefined,

themeConfig: {
url: "https://wiki.bedrock.dev",
repository: "https://github.com/Bedrock-OSS/bedrock-wiki",
themeConfig: {
url: "https://wiki.bedrock.dev",
repository: "https://github.com/Bedrock-OSS/bedrock-wiki",

algolia: {
appId: "N9ZHAYJQII",
apiKey: "a664f5a5da631810a08e1a48554fe523",
indexName: "wiki-bedrock",
placeholder: "Search Bedrock Wiki...",
algolia: {
appId: "N9ZHAYJQII",
apiKey: "a664f5a5da631810a08e1a48554fe523",
indexName: "wiki-bedrock",
placeholder: "Search Bedrock Wiki...",
},

navigation: [
{
text: "Discord",
link: "/discord",
},
{
text: "Contribute",
link: "/contribute",
},
{
text: "bedrock.dev",
link: "https://bedrock.dev",
},
{
text: "MS Learn",
link: "https://learn.microsoft.com/minecraft/creator/",
},
],

redirects,
sidebar,
tags,
},

navigation: [
{
text: "Discord",
link: "/discord",
},
{
text: "Contribute",
link: "/contribute",
markdown: {
anchor: {
level: [2, 3, 4, 5, 6],
},
{
text: "bedrock.dev",
link: "https://bedrock.dev",
headers: {
level: [2, 3, 4, 5, 6],
},
{
text: "MS Learn",
link: "https://learn.microsoft.com/minecraft/creator/",
lineNumbers: true,
config(md) {
md.use(taskListsPlugin, { label: true });
},
],

redirects,
sidebar,
tags,
},

markdown: {
anchor: {
level: [2, 3, 4, 5, 6],
},
headers: {
level: [2, 3, 4, 5, 6],
},
lineNumbers: true,
config(md) {
md.use(taskListsPlugin, { label: true });
},
},
});
})
);
41 changes: 35 additions & 6 deletions docs/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ Indentation works like `code`:
}
```

<CodeHeader>
func
</CodeHeader>
<CodeHeader>func</CodeHeader>

```mcfunction
scoreboard players add @a joined 0
Expand All @@ -83,9 +81,7 @@ execute if score initialised world matches 0 run say New world created!
scoreboard players set initialised world 1
```

<CodeHeader>
func
</CodeHeader>
<CodeHeader>func</CodeHeader>

```yaml
scoreboard players add @a joined 0
Expand Down Expand Up @@ -216,3 +212,36 @@ Some text...
`somelongsinglecodeline:rjseut;lwkporiv;jr;oiU;OIRJB;OUBSOIU;LJ;OIJLj;fgdhokfdxhlpjklfjoijselvjlisue;vltjvzsa\dfhgz\dfgiuszehgiushezdgiuhsdghiksdaghkdsgaghkjsdhksdauhugkysdiuhiui`

</Spoiler>

```mermaid
stateDiagram-v2
noAnimation: play no animaton
flyAnimation: play fly animaton
explodeAnimation: play explode animaton

state Ground {
noAnimation
}

state Air {
flyAnimation
}

state Explode {
explodeAnimation
}

direction TB
Ground --> Air : Is in Air
Air --> Ground: Is on ground
Ground --> Explode: Is dead
Air --> Explode: Is dead

```

```mermaid
pie title SPets adopted by volunteers
"Dogs" : 386
"Cats" : 85
"Rats" : 15
```
Loading
Loading