Skip to content

Commit 8c41de4

Browse files
authored
Merge pull request #573 from Strokkur424/feat/adventure
feat: Add Adventure docs
2 parents 6258ab1 + dedcc4e commit 8c41de4

Some content is hidden

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

81 files changed

+3895
-52
lines changed

CONTRIBUTING.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ To ensure a smooth and collaborative contribution process, please follow the gui
1212
5. [Version tags](#version-tags)
1313
6. [Automatic constant replacement](#automatic-constant-replacement)
1414
7. [Linking to Javadocs](#linking-to-javadocs)
15-
8. [Code of Conduct](#code-of-conduct)
15+
8. [Referencing a build system dependency](#referencing-a-build-system-dependency)
16+
9. [Code of Conduct](#code-of-conduct)
1617

1718
## Introduction
1819

@@ -181,6 +182,45 @@ For that, you can use the `jd:project_name[:module_name][:class_or_member_refere
181182
[java.sql's Connection](jd:java:java.sql:java.sql.Connection)
182183
```
183184

185+
## Referencing a build system dependency
186+
187+
If you wish to reference a build system (i.e. Gradle or Maven) dependency, you can use the `Dependency` component.
188+
189+
```mdxjs
190+
import { LATEST_ADVENTURE_API_RELEASE } from "/src/utils/versions";
191+
192+
{/* uses the "default" template */}
193+
<Dependency group="net.kyori" name="adventure-api" version={LATEST_ADVENTURE_API_RELEASE} />
194+
```
195+
196+
The `default` template is fit for use with a simple `implementation`/`compile`-scope dependency from Maven Central,
197+
however you can also make your own template.
198+
199+
If you need to declare the dependency in a unique way and/or need to add other configuration in the build script, simply use
200+
the `Tabs` component with the corresponding code blocks - **do not make a template unless you plan to use it more than once**.
201+
202+
```mdxjs
203+
import { Tabs, TabItem } from "@astrojs/starlight/components";
204+
205+
<Tabs syncKey="build-system">
206+
<TabItem label="Gradle (Kotlin)">
207+
```kotlin title="build.gradle.kts"
208+
// my awesome build script in Kotlin
209+
```
210+
</TabItem>
211+
<TabItem label="Gradle (Groovy)">
212+
```groovy title="build.gradle"
213+
// my awesome build script in Groovy
214+
```
215+
</TabItem>
216+
<TabItem label="Maven">
217+
```xml title="pom.xml"
218+
<!-- my awesome build script in XML -->
219+
```
220+
</TabItem>
221+
</Tabs>
222+
```
223+
184224
## Code of Conduct
185225

186226
Contributors are expected to follow the [Community Guidelines](https://papermc.io/community/guidelines) of the PaperMC organization in all

_redirects

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@
1919
/paper/dev/commands /paper/dev/command-api/basics/introduction
2020
/paper/dev/command-api/commands /paper/dev/command-api/basics/introduction
2121
/paper/dev/command-api/arguments /paper/dev/command-api/basics/arguments-and-literals
22+
/adventure/contributing https://github.com/PaperMC/docs/blob/main/CONTRIBUTING.md
23+
/adventure/version-history/adventure-platform-fabric /adventure/version-history/adventure-platform-mod

astro.config.ts

Lines changed: 104 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import starlight from "@astrojs/starlight";
22
import svelte from "@astrojs/svelte";
3-
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";
4-
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
53
import d2 from "astro-d2";
64
import { defineConfig } from "astro/config";
75
import starlightLinksValidator from "starlight-links-validator";
86
import starlightSidebarTopics from "starlight-sidebar-topics";
97
import codeConstantsPlugin from "./src/utils/remark/code_const";
108
import javadocPlugin from "./src/utils/remark/javadoc";
119
import {
10+
LATEST_ADVENTURE_API_RELEASE,
11+
LATEST_ADVENTURE_PLATFORM_MOD_RELEASE,
12+
LATEST_ADVENTURE_PLATFORM_RELEASE,
13+
LATEST_ADVENTURE_SUPPORTED_MC,
14+
LATEST_ADVENTURE_SUPPORTED_MC_RANGE,
15+
LATEST_ANSI_RELEASE,
1216
LATEST_FOLIA_RELEASE,
1317
LATEST_MC_RELEASE,
1418
LATEST_PAPER_RELEASE,
@@ -53,6 +57,9 @@ export default defineConfig({
5357
href: `https://jd.papermc.io/folia/${LATEST_FOLIA_RELEASE.split(".").slice(0, 2).join(".")}`,
5458
},
5559

60+
{ icon: "github", label: "adventure:GitHub", href: "https://github.com/KyoriPowered/adventure" },
61+
{ icon: "seti:java", label: "adventure:Javadoc", href: "https://jd.advntr.dev" },
62+
5663
{ icon: "github", label: "waterfall:GitHub", href: "https://github.com/PaperMC/Waterfall" },
5764
{
5865
icon: "seti:java",
@@ -91,6 +98,9 @@ export default defineConfig({
9198
},
9299
plugins: [
93100
starlightLinksValidator({
101+
exclude: [
102+
"/adventure/version-history/*", // custom pages
103+
],
94104
errorOnInvalidHashes: false, // enable if you want to check hashes - it doesn't work with config diagrams
95105
}),
96106
starlightSidebarTopics(
@@ -358,19 +368,98 @@ export default defineConfig({
358368
},
359369
],
360370
},
371+
{
372+
id: "adventure",
373+
label: "Adventure",
374+
link: "/adventure/",
375+
icon: "adventure",
376+
items: [
377+
"adventure/getting-started",
378+
"adventure/community-libraries",
379+
"adventure/faq",
380+
"adventure/audiences",
381+
"adventure/text",
382+
{
383+
label: "Text serializers",
384+
items: [
385+
"adventure/serializer",
386+
"adventure/serializer/json",
387+
"adventure/serializer/gson",
388+
"adventure/serializer/legacy",
389+
"adventure/serializer/plain",
390+
{
391+
label: "MiniMessage",
392+
items: [
393+
"adventure/minimessage",
394+
"adventure/minimessage/format",
395+
"adventure/minimessage/api",
396+
"adventure/minimessage/dynamic-replacements",
397+
"adventure/minimessage/translator",
398+
],
399+
},
400+
"adventure/serializer/ansi",
401+
],
402+
},
403+
"adventure/bossbar",
404+
"adventure/sound",
405+
"adventure/titles",
406+
"adventure/book",
407+
"adventure/tablist",
408+
"adventure/resource-pack",
409+
{
410+
label: "MiniMessage",
411+
items: [
412+
"adventure/minimessage",
413+
"adventure/minimessage/format",
414+
"adventure/minimessage/api",
415+
"adventure/minimessage/dynamic-replacements",
416+
"adventure/minimessage/translator",
417+
],
418+
},
419+
"adventure/localization",
420+
{
421+
label: "Platforms",
422+
items: [
423+
"adventure/platform",
424+
"adventure/platform/native",
425+
"adventure/platform/bukkit",
426+
"adventure/platform/bungeecord",
427+
"adventure/platform/spongeapi",
428+
"adventure/platform/modded",
429+
"adventure/platform/fabric",
430+
"adventure/platform/neoforge",
431+
"adventure/platform/viaversion",
432+
"adventure/platform/implementing",
433+
],
434+
},
435+
{
436+
label: "Version history",
437+
items: [
438+
{ label: "adventure", link: "/adventure/version-history/adventure" },
439+
{ label: "adventure-platform", link: "/adventure/version-history/adventure-platform" },
440+
{
441+
label: "adventure-platform-mod",
442+
link: "/adventure/version-history/adventure-platform-mod",
443+
},
444+
],
445+
},
446+
{
447+
label: "Migrating to Adventure from other APIs",
448+
items: [
449+
"adventure/migration",
450+
"adventure/migration/bungeecord-chat-api",
451+
"adventure/migration/text-3.x",
452+
],
453+
},
454+
],
455+
},
361456
{
362457
id: "waterfall",
363458
label: "Waterfall",
364459
link: "/waterfall/",
365460
icon: "waterfall",
366461
items: ["waterfall/getting-started", "waterfall/configuration"],
367462
},
368-
{
369-
id: "adventure",
370-
label: "Adventure",
371-
link: "https://docs.advntr.dev/",
372-
icon: "adventure",
373-
},
374463
{
375464
id: "misc",
376465
label: "Miscellaneous",
@@ -429,23 +518,13 @@ export default defineConfig({
429518
"/velocity/dev/api",
430519
],
431520
folia: ["/folia/admin", "/folia/admin/reference"],
521+
adventure: ["/adventure/version-history"],
432522
waterfall: ["/waterfall"],
433523
misc: ["/misc", "/misc/tools"],
434524
},
435525
}
436526
),
437527
],
438-
expressiveCode: {
439-
plugins: [pluginLineNumbers(), pluginCollapsibleSections()],
440-
defaultProps: {
441-
showLineNumbers: false,
442-
collapseStyle: "collapsible-start",
443-
},
444-
frames: {
445-
extractFileNameFromCode: false,
446-
},
447-
emitExternalStylesheet: false,
448-
},
449528
}),
450529
svelte(),
451530
d2({
@@ -482,6 +561,12 @@ export default defineConfig({
482561
LATEST_FOLIA_RELEASE,
483562
LATEST_WATERFALL_RELEASE,
484563
LATEST_USERDEV_RELEASE,
564+
LATEST_ADVENTURE_SUPPORTED_MC,
565+
LATEST_ADVENTURE_SUPPORTED_MC_RANGE,
566+
LATEST_ADVENTURE_API_RELEASE,
567+
LATEST_ADVENTURE_PLATFORM_RELEASE,
568+
LATEST_ADVENTURE_PLATFORM_MOD_RELEASE,
569+
LATEST_ANSI_RELEASE,
485570
},
486571
},
487572
],

ec.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";
2+
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
3+
import miniMessageHighlight from "./src/utils/shiki/mm.tmLanguage.json" with { type: "json" };
4+
5+
/** @type {import('@astrojs/starlight/expressive-code').StarlightExpressiveCodeOptions} */
6+
export default {
7+
plugins: [pluginLineNumbers(), pluginCollapsibleSections()],
8+
defaultProps: {
9+
showLineNumbers: false,
10+
collapseStyle: "collapsible-start",
11+
},
12+
frames: {
13+
extractFileNameFromCode: false,
14+
},
15+
emitExternalStylesheet: false,
16+
shiki: {
17+
langs: [miniMessageHighlight],
18+
},
19+
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@fontsource/jetbrains-mono": "^5.2.8",
2121
"@fontsource/poppins": "^5.2.7",
2222
"astro": "^5.13.9",
23+
"@ascorbic/feed-loader": "^1.0.4",
2324
"astro-d2": "^0.8.0",
2425
"sharp": "^0.34.4",
2526
"starlight-contributor-list": "^0.3.0",

0 commit comments

Comments
 (0)