Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
dda898c
feat: start rewriting with Starlight
zlataovce Apr 7, 2025
13845a1
feat: more pages, add a pretty footer
zlataovce Apr 8, 2025
f41dc6c
feat: Waterfall, destructive banner
zlataovce Apr 8, 2025
2af25cf
feat: Folia
zlataovce Apr 8, 2025
36adc71
feat: destructive link card
zlataovce Apr 8, 2025
a0d1cd5
feat: some pages from misc
zlataovce Apr 8, 2025
ad8dac1
feat: patch in project icons
zlataovce Apr 9, 2025
e09a5bd
feat: Javadoc remark plugin
zlataovce Apr 9, 2025
d7492d1
feat: more pages
zlataovce Apr 9, 2025
234e396
feat: Velocity API pages
zlataovce Apr 9, 2025
79cde43
chore: match accent colors with website
zlataovce Apr 9, 2025
d3bd4c9
chore: replace externally hosted images
kashike Apr 9, 2025
847a5ed
refactor: constant replacement for code blocks
zlataovce Apr 10, 2025
ac310d4
feat: some Paper dev pages
zlataovce Apr 10, 2025
0f7fb5c
fix: make content wider on large screens
zlataovce Apr 10, 2025
febbe9a
feat: page cards for index pages
zlataovce Apr 10, 2025
7133385
feat: index pages, permissions, rewrite CONTRIBUTING.md
zlataovce Apr 11, 2025
4590803
feat: replace mermaid with D2
zlataovce Apr 11, 2025
ae749ff
fix: don't spellcheck D2 output
zlataovce Apr 11, 2025
d9c50d5
feat: configuration pages
zlataovce Apr 11, 2025
8e404bc
fix: remove placeholders in config specs
zlataovce Apr 11, 2025
97fe17d
chore: color corrections
zlataovce Apr 11, 2025
861bc0b
fix(config): split array values correctly
zlataovce Apr 11, 2025
a02d9a7
feat: Paper API pages
zlataovce Apr 12, 2025
69f3994
fix: broken links
zlataovce Apr 12, 2025
d26e667
chore: re-enable tracking
zlataovce Apr 12, 2025
733ee1c
fix: oversights, re-add vanilla guide
zlataovce Apr 12, 2025
15d7b79
fix: remove background from diagrams, adjust image size
zlataovce Apr 12, 2025
1d3fe70
feat: start script generator
zlataovce Apr 12, 2025
eb79022
feat: new pages from rebase
zlataovce Apr 13, 2025
1dc52e4
feat: version tag, redirects, fix codeblock line highlights
zlataovce Apr 13, 2025
f54c73a
fix: version tag style changes
zlataovce Apr 13, 2025
1d77e24
fix: don't translate configuration keys+values
zlataovce Apr 13, 2025
0929766
fix: ugh Prettier
zlataovce Apr 13, 2025
ed27fed
feat: sticky project dropdown, fix main page paddings
zlataovce Apr 13, 2025
75e14b0
feat: change the homepage cards to be clickable (#564)
olijeffers0n Apr 13, 2025
fd4ce6c
feat: scroll to current page in sidebar, dropdown touch-ups
zlataovce Apr 13, 2025
834010d
feat: try out always inlining stylesheets
zlataovce Apr 13, 2025
40a8e8c
feat: try out inlining expressive-code stylesheet
zlataovce Apr 13, 2025
4961c6a
refactor: use assets CDN, preload logo
zlataovce Apr 14, 2025
f52c98c
feat: item command converter (#568)
Strokkur424 Apr 14, 2025
cd7dada
refactor: item command converter patch up
zlataovce Apr 14, 2025
0caa3e0
feat: Adventure links, bump dependencies
zlataovce Apr 15, 2025
5845058
fix: `client:only` -> `client:load`
zlataovce Apr 15, 2025
f1637f4
chore: bump dependencies
zlataovce Apr 16, 2025
7c1c339
chore: remove porting remnants, improve contributing guide
zlataovce Apr 16, 2025
1771a74
fix: reset orange for light mode
zlataovce Apr 17, 2025
7a33789
fix: scroll weirdness, make dropdown shadow less pronounced
zlataovce Apr 17, 2025
1dabe6f
fix: Safari fixes
zlataovce Apr 17, 2025
0150ae0
fix: too large images
zlataovce Apr 17, 2025
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
Prev Previous commit
Next Next commit
feat: version tag, redirects, fix codeblock line highlights
  • Loading branch information
zlataovce committed Apr 13, 2025
commit 1dc52e46ebbf3fda1b774627222c06161b8d7a88
29 changes: 25 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ To ensure a smooth and collaborative contribution process, please follow the gui
2. [How to add a page](#adding-a-page)
3. [Submitting contributions](#submitting-contributions)
4. [Style guidelines](#style-guidelines)
5. [Automatic constant replacement](#automatic-constant-replacement)
6. [Linking to Javadocs](#linking-to-javadocs)
7. [Code of Conduct](#code-of-conduct)
5. [Version tags](#version-tags)
6. [Automatic constant replacement](#automatic-constant-replacement)
7. [Linking to Javadocs](#linking-to-javadocs)
8. [Code of Conduct](#code-of-conduct)

## Introduction

Expand All @@ -20,7 +21,7 @@ information, instructions, and guidelines to our users, developers, and contribu
significant role in improving and maintaining the quality of our documentation.

We use [Starlight](https://starlight.astro.build/) to build and deploy the documentation website.
Docusaurus has [extensive documentation](https://starlight.astro.build/guides/authoring-content/) detailing what is possible with it.
Starlight has [extensive documentation](https://starlight.astro.build/guides/authoring-content/) detailing what is possible with it.

The bulk of Paper's documentation is written with Markdown, which is a simple markup language that is easy to learn.
Take a look at some of the existing documentation to get a feel for how it is written.
Expand Down Expand Up @@ -97,6 +98,26 @@ To maintain consistency and readability across the documentation, please adhere

11. **Capitalize Vanilla**: When referring to the base game, use "Vanilla" with a capital "V".

## Version tags

All of our documentation which is potentially relevant to a specific version of the software should be tagged with the
`version` front matter value. This allows the user to see which version of the software the documentation was written for.

It is important to keep this up to date, as it allows users to see if the documentation is still relevant to the version,
however it is not required for all documentation. For example, a page about the history of the project would not need a
`version` value.

```markdown
---
title: My awesome page
description: My awesome page about my awesome topic for 1.20.
slug: paper/my-awesome-page
version: "1.20"
---

.....
```

## Automatic constant replacement

There are quite a few constants you may want to use in your pages, such as the latest Paper/Velocity/Minecraft version.
Expand Down
6 changes: 6 additions & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/intro /
/java-install-update /misc/java-install
/papermc/* /misc/*
/paper/1.18 /paper
/paper/1.18/* /paper/*
/paper/1.19 /paper
/paper/1.19/* /paper/*
/paper/1.20 /paper
/paper/1.20/* /paper/*
/velocity/developers/* /velocity/dev/*
/velocity/dev/component-api/introduction /paper/dev/component-api/introduction
/velocity/dev/component-api/i18n /paper/dev/component-api/i18n
Expand Down
2 changes: 2 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default defineConfig({
Sidebar: "./src/components/overrides/Sidebar.astro",
Footer: "./src/components/overrides/Footer.astro",
Banner: "./src/components/overrides/Banner.astro",
TableOfContents: "./src/components/overrides/TableOfContents.astro",
MobileTableOfContents: "./src/components/overrides/MobileTableOfContents.astro",
},
plugins: [
starlightLinksValidator({
Expand Down
66 changes: 66 additions & 0 deletions src/components/Version.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
import { Icon } from "@astrojs/starlight/components";

interface Props {
version: string;
inline?: boolean;
}

const { version, inline } = Astro.props;
---

<div class:list={["notice", inline && "notice-inline"]}>
<Icon name="information" class="icon" />
<div class="notice-inner">
Written for version:
<span>{version}</span>
</div>
</div>

<style>
.icon {
font-size: var(--sl-text-3xl);
}

.notice {
display: flex;
flex-direction: row;
gap: 1rem;
align-items: center;
max-width: 14rem;
font-size: var(--sl-text-xs);
padding: 1rem;
border-radius: 0.5rem;
background-color: rgba(var(--sl-color-accent-raw), 0.125);
margin: 1rem 0;
}

.notice span {
font-weight: 600;
font-size: var(--sl-text-xl);
}

.notice .notice-inner {
display: flex;
flex-direction: column;
}

.notice-inline {
max-width: 100%;
margin: 0;
border-radius: 0;
font-size: var(--sl-text-sm);
}

.notice-inline span {
font-size: var(--sl-text-sm);
}

.notice-inline .icon {
font-size: var(--sl-text-lg);
}

.notice-inline .notice-inner {
display: block;
}
</style>
9 changes: 9 additions & 0 deletions src/components/overrides/MobileTableOfContents.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
import Default from "@astrojs/starlight/components/MobileTableOfContents.astro";
import Version from "../Version.astro";

const { version } = Astro.locals.starlightRoute.entry.data;
---

<Default><slot /></Default>
{version && <Version {version} inline />}
9 changes: 9 additions & 0 deletions src/components/overrides/TableOfContents.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
import Default from "@astrojs/starlight/components/TableOfContents.astro";
import Version from "../Version.astro";

const { version } = Astro.locals.starlightRoute.entry.data;
---

<Default><slot /></Default>
{version && <Version {version} />}
1 change: 1 addition & 0 deletions src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const collections = {
destructive: z.boolean().optional(),
})
.optional(),
version: z.string().optional(),
}),
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ To set a value for a specific world, edit `paper-world.yml` within the world fol
you wanted to enable `lootables.auto-replenish` for a world named `resource`, you would edit
`paper-world.yml` within the `resource` folder like so:

```yaml title=resource/paper-world.yml
```yaml title=resource/paper-world.yml {3-4}
_version: 28

# highlight-start
lootables:
auto-replenish: true
# highlight-end
```

Nothing but `_version` is set in `paper-world.yml` configuration files by default. In order to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ which is relevant, if the command was ran via `/execute as <entity> run <our_com
In the [Arguments and Literals](/paper/dev/command-api/basics/arguments-and-literals) chapter, we have briefly declared the structure for a `/flyspeed` command with the use of a ranged float argument.
But that command does not actually set the flyspeed of the executing player. In order to do that, we'd have to append an executor onto it, like this:

```java title="FlightSpeedCommand.java"
```java title="FlightSpeedCommand.java" {5-6}
Commands.literal("flyspeed")
.then(Commands.argument("speed", FloatArgumentType.floatArg(0, 1.0f))
.executes(ctx -> {
float speed = FloatArgumentType.getFloat(ctx, "speed"); // Retrieve the speed argument
// highlight-next-line
CommandSender sender = ctx.getSource().getSender(); // Retrieve the command sender
// highlight-next-line
Entity executor = ctx.getSource().getExecutor(); // Retrieve the command executor, which may or may not be the same as the sender

// Check whether the executor is a player, as you can only set a player's flight speed
Expand Down
10 changes: 2 additions & 8 deletions src/content/docs/paper/dev/api/entity-api/display-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,30 +108,26 @@ world.spawn(location, BlockDisplay.class, entity -> {

You can also rotate it, let's tip it on its corner:

```java
```java {6, 8, 15-19}
world.spawn(location, BlockDisplay.class, entity -> {
entity.setBlock(Material.GRASS_BLOCK.createBlockData());
entity.setTransformation(
new Transformation(
new Vector3f(), // no translation
// highlight-next-line
new AxisAngle4f((float) -Math.toRadians(45), 1, 0, 0), // rotate -45 degrees on the X axis
new Vector3f(2, 2, 2), // scale up by a factor of 2 on all axes
// highlight-next-line
new AxisAngle4f((float) Math.toRadians(45), 0, 0, 1) // rotate +45 degrees on the Z axis
)
);
// or set a raw transformation matrix from JOML
// entity.setTransformationMatrix(
// new Matrix4f()
// .scale(2) // scale up by a factor of 2 on all axes
// highlight-start
// .rotateXYZ(
// (float) Math.toRadians(360 - 45), // rotate -45 degrees on the X axis
// 0,
// (float) Math.toRadians(45) // rotate +45 degrees on the Z axis
// )
// highlight-end
// );
});
```
Expand All @@ -142,12 +138,11 @@ world.spawn(location, BlockDisplay.class, entity -> {

Finally, we can also apply a translation transformation (position offset) to the display, for example:

```java
```java {5, 14}
world.spawn(location, BlockDisplay.class, entity -> {
entity.setBlock(Material.GRASS_BLOCK.createBlockData());
entity.setTransformation(
new Transformation(
// highlight-next-line
new Vector3f(0.5F, 0.5F, 0.5F), // offset by half a block on all axes
new AxisAngle4f((float) -Math.toRadians(45), 1, 0, 0), // rotate -45 degrees on the X axis
new Vector3f(2, 2, 2), // scale up by a factor of 2 on all axes
Expand All @@ -157,7 +152,6 @@ world.spawn(location, BlockDisplay.class, entity -> {
// or set a raw transformation matrix from JOML
// entity.setTransformationMatrix(
// new Matrix4f()
// highlight-next-line
// .translate(0.5F, 0.5F, 0.5F) // offset by half a block on all axes
// .scale(2) // scale up by a factor of 2 on all axes
// .rotateXYZ(
Expand Down
10 changes: 8 additions & 2 deletions src/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@

/* Dark mode colors. */
:root {
/* raw values for setting opacity */
--sl-color-accent-raw: 37, 99, 235;

--sl-color-accent-low: #1e3a8a;
--sl-color-accent: #2563eb;
--sl-color-accent: rgb(var(--sl-color-accent-raw));
--sl-color-accent-high: #60a5fa;
--sl-color-white: #ffffff;
--sl-color-gray-1: #e2e5e9;
Expand All @@ -52,8 +55,11 @@

/* Light mode colors. */
:root[data-theme="light"] {
/* raw values for setting opacity */
--sl-color-accent-raw: 37, 99, 235;

--sl-color-accent-low: #60a5fa;
--sl-color-accent: #2563eb;
--sl-color-accent: rgb(var(--sl-color-accent-raw));
--sl-color-accent-high: #1e3a8a;
--sl-color-white: #111111;
--sl-color-gray-1: #181a1b;
Expand Down