Skip to content

Commit 9547695

Browse files
Flatten the development hierarchy
This makes the content more immediately accessible and easier to browse through. Styling has also been adjusted as necessary to accomodate a flatter hierarchy of items; presenting content as a list with headers instead of a grid of cards.
1 parent 825ccb1 commit 9547695

File tree

11 files changed

+190
-126
lines changed

11 files changed

+190
-126
lines changed

config/sidebar.paper.ts

+47-56
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const paper: SidebarsConfig = {
66
{
77
type: "category",
88
label: "Administration",
9+
description: "Create, configure, and maintain a Paper server.",
910
collapsed: true,
1011
link: {
1112
type: "doc",
@@ -82,87 +83,77 @@ const paper: SidebarsConfig = {
8283
{
8384
type: "category",
8485
label: "Development",
86+
description:
87+
"Create plugins with the Paper API in order to extend Minecraft with custom and modified behavior.",
8588
collapsed: true,
8689
link: {
8790
type: "doc",
8891
id: "dev/README",
8992
},
9093
items: [
9194
{
92-
type: "category",
93-
label: "Getting started",
94-
collapsed: true,
95-
link: {
96-
type: "doc",
97-
id: "dev/getting-started/README",
98-
},
99-
items: [
100-
"dev/getting-started/project-setup",
101-
"dev/getting-started/plugin-yml",
102-
"dev/getting-started/how-do-plugins-work",
103-
"dev/getting-started/paper-plugins",
104-
"dev/getting-started/userdev",
105-
],
95+
type: "html",
96+
value: "Getting Started",
97+
className: "sidebarTitle",
98+
defaultStyle: true,
99+
},
100+
"dev/getting-started/project-setup",
101+
"dev/getting-started/plugin-yml",
102+
"dev/getting-started/how-do-plugins-work",
103+
"dev/getting-started/paper-plugins",
104+
"dev/getting-started/userdev",
105+
{
106+
type: "html",
107+
value: "Plugin API",
108+
className: "sidebarTitle",
109+
defaultStyle: true,
106110
},
107111
{
108112
type: "category",
109-
label: "API",
113+
label: "Event API",
114+
description: "Respond to and modify in-game actions",
110115
collapsed: true,
111-
link: {
112-
type: "doc",
113-
id: "dev/api/README",
114-
},
115116
items: [
116-
{
117-
type: "category",
118-
label: "Event API",
119-
collapsed: true,
120-
items: [
121-
"dev/api/event-api/event-listeners",
122-
"dev/api/event-api/custom-events",
123-
"dev/api/event-api/handler-lists",
124-
"dev/api/event-api/chat-event",
125-
],
126-
},
127-
{
128-
type: "category",
129-
label: "Component API (Adventure)",
130-
collapsed: true,
131-
items: [
132-
"dev/api/component-api/intro",
133-
"dev/api/component-api/i18n",
134-
"dev/api/component-api/audiences",
135-
],
136-
},
137-
"dev/api/pdc",
138-
"dev/api/custom-inventory-holder",
139-
"dev/api/scheduler",
140-
"dev/api/plugin-messaging",
141-
"dev/api/plugin-configs",
142-
"dev/api/folia-support",
143-
"dev/api/roadmap",
117+
"dev/api/event-api/event-listeners",
118+
"dev/api/event-api/custom-events",
119+
"dev/api/event-api/handler-lists",
120+
"dev/api/event-api/chat-event",
144121
],
145122
},
146123
{
147124
type: "category",
148-
label: "Miscellaneous",
125+
label: "Component API (Adventure)",
126+
description: "Work with Minecraft's chat components",
149127
collapsed: true,
150-
link: {
151-
type: "doc",
152-
id: "dev/misc/README",
153-
},
154128
items: [
155-
"dev/misc/reading-stacktraces",
156-
"dev/misc/debugging",
157-
"dev/misc/databases",
158-
"dev/misc/internal-code",
129+
"dev/api/component-api/intro",
130+
"dev/api/component-api/i18n",
131+
"dev/api/component-api/audiences",
159132
],
160133
},
134+
"dev/api/pdc",
135+
"dev/api/custom-inventory-holder",
136+
"dev/api/scheduler",
137+
"dev/api/plugin-messaging",
138+
"dev/api/plugin-configs",
139+
"dev/api/folia-support",
140+
"dev/api/roadmap",
141+
{
142+
type: "html",
143+
value: "Miscellaneous",
144+
className: "sidebarTitle",
145+
defaultStyle: true,
146+
},
147+
"dev/misc/reading-stacktraces",
148+
"dev/misc/debugging",
149+
"dev/misc/databases",
150+
"dev/misc/internal-code",
161151
],
162152
},
163153
{
164154
type: "category",
165155
label: "Contributing",
156+
description: "Contribute code changes to the Paper server.",
166157
collapsed: true,
167158
link: {
168159
type: "doc",

docs/paper/README.mdx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import DocCardList from "@theme/DocCardList";
22

3-
# Welcome to the Paper Docs
3+
# Paper
44

55
Paper is a high performance fork of Spigot that aims to fix gameplay and
66
mechanic inconsistencies as well as to improve performance. Paper contains numerous features, bug
@@ -14,17 +14,20 @@ fixes, exploit preventions and major performance improvements not found in Spigo
1414
"label": "Administration",
1515
"href": "/paper/admin",
1616
"customEmoji": "mdi:account-cog",
17+
"description": "Create, configure, and maintain a Paper server.",
1718
},
1819
{
1920
"type": "link",
2021
"label": "Development",
2122
"href": "/paper/dev",
2223
"customEmoji": "mdi:code-braces",
24+
"description": "Create plugins with the Paper API in order to extend Minecraft with custom and modified behavior.",
2325
},
2426
{
2527
"type": "link",
2628
"label": "Contributing",
2729
"href": "/paper/contributing",
2830
"customEmoji": "mdi:comment-edit",
31+
"description": "Contribute code changes to the Paper server.",
2932
},
3033
]}/>

docs/paper/dev/README.mdx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import DocCardList from "@theme/DocCardList";
22
import { useCurrentSidebarCategory } from "@docusaurus/theme-common";
33

4-
# Development Guide
4+
# Paper Development
55

6-
Welcome to the Paper development guide! This guide includes information and tutorials for developers
7-
on how to create and expand on Paper plugins.
6+
Create plugins with the Paper API in order to extend Minecraft with custom and modified behavior.
87

98
---
109

docs/paper/dev/api/README.mdx

-11
This file was deleted.

docs/paper/dev/getting-started/README.mdx

-11
This file was deleted.

docs/paper/dev/misc/README.mdx

-10
This file was deleted.

src/css/custom.css

+34
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,35 @@ html[data-theme="dark"] {
4040
--eol-message-background-color: rgb(92, 15, 18);
4141
}
4242

43+
.theme-doc-sidebar-item-link > a::before,
44+
.theme-doc-sidebar-item-category > div > a::before {
45+
margin-right: 0.3rem;
46+
height: 24px;
47+
width: 24px;
48+
}
49+
50+
.theme-doc-sidebar-item-link > a::before {
51+
content: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iYmxhY2siIGQ9Ik0xNCAySDZhMiAyIDAgMCAwLTIgMnYxNmEyIDIgMCAwIDAgMiAyaDEyYTIgMiAwIDAgMCAyLTJWOHptNCAxOEg2VjRoN3Y1aDV6Ii8+PC9zdmc+);
52+
}
53+
54+
.theme-doc-sidebar-item-category > div > a::before {
55+
content: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iYmxhY2siIGQ9Ik03IDVoMTR2Mkg3em0wIDh2LTJoMTR2MnpNNCA0LjVBMS41IDEuNSAwIDAgMSA1LjUgNkExLjUgMS41IDAgMCAxIDQgNy41QTEuNSAxLjUgMCAwIDEgMi41IDZBMS41IDEuNSAwIDAgMSA0IDQuNW0wIDZBMS41IDEuNSAwIDAgMSA1LjUgMTJBMS41IDEuNSAwIDAgMSA0IDEzLjVBMS41IDEuNSAwIDAgMSAyLjUgMTJBMS41IDEuNSAwIDAgMSA0IDEwLjVNNyAxOXYtMmgxNHYyem0tMy0yLjVBMS41IDEuNSAwIDAgMSA1LjUgMThBMS41IDEuNSAwIDAgMSA0IDE5LjVBMS41IDEuNSAwIDAgMSAyLjUgMThBMS41IDEuNSAwIDAgMSA0IDE2LjUiLz48L3N2Zz4=);
56+
}
57+
58+
@media (prefers-color-scheme: dark) {
59+
.theme-doc-sidebar-item-link > a::before {
60+
content: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0xNCAySDZhMiAyIDAgMCAwLTIgMnYxNmEyIDIgMCAwIDAgMiAyaDEyYTIgMiAwIDAgMCAyLTJWOHptNCAxOEg2VjRoN3Y1aDV6Ii8+PC9zdmc+);
61+
}
62+
63+
.theme-doc-sidebar-item-category > div > a::before {
64+
content: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik03IDVoMTR2Mkg3em0wIDh2LTJoMTR2MnpNNCA0LjVBMS41IDEuNSAwIDAgMSA1LjUgNkExLjUgMS41IDAgMCAxIDQgNy41QTEuNSAxLjUgMCAwIDEgMi41IDZBMS41IDEuNSAwIDAgMSA0IDQuNW0wIDZBMS41IDEuNSAwIDAgMSA1LjUgMTJBMS41IDEuNSAwIDAgMSA0IDEzLjVBMS41IDEuNSAwIDAgMSAyLjUgMTJBMS41IDEuNSAwIDAgMSA0IDEwLjVNNyAxOXYtMmgxNHYyem0tMy0yLjVBMS41IDEuNSAwIDAgMSA1LjUgMThBMS41IDEuNSAwIDAgMSA0IDE5LjVBMS41IDEuNSAwIDAgMSAyLjUgMThBMS41IDEuNSAwIDAgMSA0IDE2LjUiLz48L3N2Zz4=);
65+
}
66+
}
67+
68+
.theme-doc-sidebar-menu > li:first-child > a::before {
69+
display: none;
70+
}
71+
4372
.eol-message {
4473
width: 100%;
4574
min-height: 5rem;
@@ -58,6 +87,11 @@ html[data-theme="dark"] {
5887
margin: 0;
5988
}
6089

90+
.sidebarTitle {
91+
font-size: 0.8rem;
92+
font-weight: bold;
93+
}
94+
6195
.button.button--secondary {
6296
color: #f6f7f8;
6397
}

src/theme/DocCard/index.tsx

+50-23
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@ import { translate } from "@docusaurus/Translate";
77

88
import type { Props } from "@theme/DocCard";
99
import Heading from "@theme/Heading";
10-
import type { PropSidebarItemCategory, PropSidebarItemLink } from "@docusaurus/plugin-content-docs";
10+
import type {
11+
PropSidebarItemCategory,
12+
PropSidebarItemHtml,
13+
PropSidebarItemLink,
14+
} from "@docusaurus/plugin-content-docs";
1115

1216
import styles from "./styles.module.css";
1317
import { Icon } from "@iconify/react";
1418

15-
function CardContainer({ href, children }: { href: string; children: ReactNode }): JSX.Element {
16-
return (
17-
<Link href={href} className={clsx("card padding--lg", styles.cardContainer)}>
18-
{children}
19-
</Link>
20-
);
21-
}
22-
2319
function CardLayout({
2420
href,
2521
icon,
@@ -32,16 +28,23 @@ function CardLayout({
3228
description?: string;
3329
}): JSX.Element {
3430
return (
35-
<CardContainer href={href}>
36-
<Heading as="h2" className={clsx("text--truncate", styles.cardTitle)} title={title}>
37-
{icon} {title}
38-
</Heading>
39-
{description && (
40-
<p className={clsx("text--truncate", styles.cardDescription)} title={description}>
41-
{description}
42-
</p>
43-
)}
44-
</CardContainer>
31+
<Link href={href} className={clsx("padding-horiz--md", styles.cardContainer)}>
32+
{icon}
33+
<div className={clsx("padding-left--md")}>
34+
<Heading
35+
as="h2"
36+
className={clsx("margin-bottom--sm", styles.linkBlue, styles.cardTitle)}
37+
title={title}
38+
>
39+
{title}
40+
</Heading>
41+
{description && (
42+
<p className={clsx(styles.cardDescription)} title={description}>
43+
{description}
44+
</p>
45+
)}
46+
</div>
47+
</Link>
4548
);
4649
}
4750

@@ -56,7 +59,13 @@ function CardCategory({ item }: { item: PropSidebarItemCategory }): JSX.Element
5659
return (
5760
<CardLayout
5861
href={href}
59-
icon="🗃️"
62+
icon={
63+
<Icon
64+
className={clsx("margin-right--sm", styles.cardIcon)}
65+
icon="mdi:format-list-bulleted"
66+
width={24}
67+
/>
68+
}
6069
title={item.label}
6170
description={
6271
item.description ??
@@ -80,11 +89,23 @@ type EmojiPropsSidebarItemLink = PropSidebarItemLink & {
8089

8190
function CardLink({ item }: { item: EmojiPropsSidebarItemLink }): JSX.Element {
8291
const icon = item.customEmoji ? (
83-
<Icon className={"margin-right--sm"} icon={item.customEmoji} height={25} />
92+
<Icon
93+
className={clsx("margin-right--sm", styles.cardIcon)}
94+
icon={item.customEmoji}
95+
width={24}
96+
/>
8497
) : isInternalUrl(item.href) ? (
85-
"📄️"
98+
<Icon
99+
className={clsx("margin-right--sm", styles.cardIcon)}
100+
icon="mdi:paper-outline"
101+
width={24}
102+
/>
86103
) : (
87-
"🔗"
104+
<Icon
105+
className={clsx("margin-right--sm", styles.cardIcon)}
106+
icon="mdi:format-list-bulleted"
107+
width={24}
108+
/>
88109
);
89110
const doc = useDocById(item.docId ?? undefined);
90111
return (
@@ -97,12 +118,18 @@ function CardLink({ item }: { item: EmojiPropsSidebarItemLink }): JSX.Element {
97118
);
98119
}
99120

121+
function Header({ item }: { item: PropSidebarItemHtml }): JSX.Element {
122+
return <h2>{item.value}</h2>;
123+
}
124+
100125
export default function DocCard({ item }: Props): JSX.Element {
101126
switch (item.type) {
102127
case "link":
103128
return <CardLink item={item} />;
104129
case "category":
105130
return <CardCategory item={item} />;
131+
case "html":
132+
return <Header item={item} />;
106133
default:
107134
throw new Error(`unknown item type ${JSON.stringify(item)}`);
108135
}

0 commit comments

Comments
 (0)