From 5abc2213dcf60eacfa6d8f9fe32d5aab1143134f Mon Sep 17 00:00:00 2001
From: olijeffers0n <69084614+olijeffers0n@users.noreply.github.com>
Date: Tue, 30 Jan 2024 20:03:31 +0000
Subject: [PATCH 1/7] feat: ConfiguredProperty for documenting "magic" values
consistently
---
.../getting-started/{README.md => README.mdx} | 2 +-
.../admin/getting-started/{faq.md => faq.mdx} | 2 +-
.../creating-your-first-plugin.mdx | 4 +--
...ocity-1.md => porting-from-velocity-1.mdx} | 2 +-
src/components/ConfiguredProperty.tsx | 30 +++++++++++++++++++
src/theme/MDXComponents.tsx | 12 ++++----
6 files changed, 42 insertions(+), 10 deletions(-)
rename docs/velocity/admin/getting-started/{README.md => README.mdx} (97%)
rename docs/velocity/admin/getting-started/{faq.md => faq.mdx} (97%)
rename docs/velocity/dev/how-to/{porting-from-velocity-1.md => porting-from-velocity-1.mdx} (94%)
create mode 100644 src/components/ConfiguredProperty.tsx
diff --git a/docs/velocity/admin/getting-started/README.md b/docs/velocity/admin/getting-started/README.mdx
similarity index 97%
rename from docs/velocity/admin/getting-started/README.md
rename to docs/velocity/admin/getting-started/README.mdx
index a76737aa1..cd6947d67 100644
--- a/docs/velocity/admin/getting-started/README.md
+++ b/docs/velocity/admin/getting-started/README.mdx
@@ -9,7 +9,7 @@ This page covers how to install and set up a minimal configuration of Velocity.
## Installing Java
Velocity is written in Java, so if you do not already have Java installed, you will need to install
-it before you continue. Velocity requires Java 17 or newer. See our
+it before you continue. Velocity requires Java or newer. See our
[java installation guide](/misc/java-install) for detailed instructions.
## Downloading Velocity
diff --git a/docs/velocity/admin/getting-started/faq.md b/docs/velocity/admin/getting-started/faq.mdx
similarity index 97%
rename from docs/velocity/admin/getting-started/faq.md
rename to docs/velocity/admin/getting-started/faq.mdx
index 671ae81fb..a36a5718a 100644
--- a/docs/velocity/admin/getting-started/faq.md
+++ b/docs/velocity/admin/getting-started/faq.mdx
@@ -10,7 +10,7 @@ many of these questions from the user perspective.
## What version of Java does Velocity require?
-Velocity 3.3.x requires Java 17 or above.
+Velocity 3.3.x requires Java or above.
## Where can I find Velocity plugins?
diff --git a/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx b/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx
index 6efe25069..79a262556 100644
--- a/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx
+++ b/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx
@@ -26,7 +26,7 @@ IDEA is recommended.
- Open your IDE
- Click `Create New Project` or the equivalent
- Select either `Gradle` or `Maven`
-- Make sure your **Project JDK** is Java 11 or later
+- Make sure your **Project JDK** is Java or later
- **Finish** the dialog and open the project.
Now we have created our project, we need configure our build system.
@@ -174,7 +174,7 @@ You will be asked to provide some information about your project.
| **Group ID** | The group ID of your project. This is used for Maven and Gradle. This is usually your domain name in reverse. If you don't know what you should put here, you can use something like `io.github.` or if you don't have GitHub you can just use `me.`. |
| **Artifact ID** | The artifact ID of your project. This is used for Maven and Gradle. This is usually the name of your project. This is usually the same as the `Name` field. |
| **Version** | The version of your project. This is used for Maven and Gradle. This is usually `1.0-SNAPSHOT` and does not really matter for now. |
-| **JDK** | The JDK you want to use. This can be anything from Java 11 and above. |
+| **JDK** | The JDK you want to use. This can be anything from Java and above. |
Now you can click on the `Create` button and IntelliJ will create the project for you.
If everything went well, you should see something like this:
diff --git a/docs/velocity/dev/how-to/porting-from-velocity-1.md b/docs/velocity/dev/how-to/porting-from-velocity-1.mdx
similarity index 94%
rename from docs/velocity/dev/how-to/porting-from-velocity-1.md
rename to docs/velocity/dev/how-to/porting-from-velocity-1.mdx
index 9abf75c12..40b89864a 100644
--- a/docs/velocity/dev/how-to/porting-from-velocity-1.md
+++ b/docs/velocity/dev/how-to/porting-from-velocity-1.mdx
@@ -10,7 +10,7 @@ document very carefully**.
## Minimum supported Java version bump
-Velocity 3.3.x now requires Java 17 and above.
+Velocity 3.3.x now requires Java and above.
## Removal of legacy dependencies
diff --git a/src/components/ConfiguredProperty.tsx b/src/components/ConfiguredProperty.tsx
new file mode 100644
index 000000000..4dc4a62fc
--- /dev/null
+++ b/src/components/ConfiguredProperty.tsx
@@ -0,0 +1,30 @@
+import React from 'react';
+
+const CONFIGURED_PROPERTIES = {
+ MIN_VELOCITY_JAVA: "17",
+}
+
+const CONFIGURED_PROPERTY_NAMES = Object.keys(CONFIGURED_PROPERTIES);
+
+export function isConfiguredProperty(propertyKey: string): boolean {
+ return CONFIGURED_PROPERTY_NAMES.includes(propertyKey);
+}
+
+export function getConfiguredProperty(propertyKey: string): string {
+ return CONFIGURED_PROPERTIES[propertyKey];
+}
+
+export default function ConfiguredProperty({ propertyKey }) {
+
+ if (!isConfiguredProperty(propertyKey)) {
+ return null;
+ }
+
+ const value = getConfiguredProperty(propertyKey);
+
+ return (
+
+ {value}
+
+ );
+}
diff --git a/src/theme/MDXComponents.tsx b/src/theme/MDXComponents.tsx
index c36af1faf..0b2fda9f8 100644
--- a/src/theme/MDXComponents.tsx
+++ b/src/theme/MDXComponents.tsx
@@ -1,11 +1,12 @@
import React from 'react';
import { Icon } from '@iconify/react';
import MDXComponents from '@theme-original/MDXComponents';
-import TabItem from "@theme/TabItem";
-import Tabs from "@theme/Tabs";
-import VersionFormattedCode from '../components/VersionFormattedCode';
-import SoftwareVersion from "../components/SoftwareVersion";
-import VersionedJavaDocLink from "../components/VersionedJavaDocLink";
+import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs';
+import VersionFormattedCode from '@site/src/components/VersionFormattedCode';
+import SoftwareVersion from '@site/src/components/SoftwareVersion';
+import VersionedJavaDocLink from '../components/VersionedJavaDocLink';
+import ConfiguredProperty from '@site/src/components/ConfiguredProperty';
export default {
// Re-use the default mapping
@@ -16,5 +17,6 @@ export default {
VersionFormattedCode,
SoftwareVersion,
VersionedJavaDocLink,
+ ConfiguredProperty,
Icon: Icon,
};
From 7d39f21afa0b39f10830c297b9d58c0be735141f Mon Sep 17 00:00:00 2001
From: olijeffers0n <69084614+olijeffers0n@users.noreply.github.com>
Date: Tue, 30 Jan 2024 20:30:55 +0000
Subject: [PATCH 2/7] Move the config to its own file
---
config-specs/properties/properties.json | 4 ++++
.../{getting-started.md => getting-started.mdx} | 12 ++++++------
src/components/ConfiguredProperty.tsx | 9 +++------
3 files changed, 13 insertions(+), 12 deletions(-)
create mode 100644 config-specs/properties/properties.json
rename docs/paper/admin/getting-started/{getting-started.md => getting-started.mdx} (79%)
diff --git a/config-specs/properties/properties.json b/config-specs/properties/properties.json
new file mode 100644
index 000000000..9992f681f
--- /dev/null
+++ b/config-specs/properties/properties.json
@@ -0,0 +1,4 @@
+{
+ "MIN_VELOCITY_JAVA": "17",
+ "RECOMMENDED_PAPER_JAVA": "21"
+}
diff --git a/docs/paper/admin/getting-started/getting-started.md b/docs/paper/admin/getting-started/getting-started.mdx
similarity index 79%
rename from docs/paper/admin/getting-started/getting-started.md
rename to docs/paper/admin/getting-started/getting-started.mdx
index 36c1cc8d6..d957fa6b8 100644
--- a/docs/paper/admin/getting-started/getting-started.md
+++ b/docs/paper/admin/getting-started/getting-started.mdx
@@ -13,12 +13,12 @@ With the release of Minecraft 1.18, Paper now requires **Java 17** to run. We re
:::
-| Paper Version | Recommended Java Version |
-|----------------|--------------------------|
-| 1.8 to 1.11 | Java 8 |
-| 1.12 to 1.16.4 | Java 11 |
-| 1.16.5 | Java 16 |
-| 1.17.1-1.18.1+ | Java 21 |
+| Paper Version | Recommended Java Version |
+|----------------|------------------------------------------------------------------|
+| 1.8 to 1.11 | Java 8 |
+| 1.12 to 1.16.4 | Java 11 |
+| 1.16.5 | Java 16 |
+| 1.17.1-1.18.1+ | Java |
## Downloading Paper
diff --git a/src/components/ConfiguredProperty.tsx b/src/components/ConfiguredProperty.tsx
index 4dc4a62fc..f4b5f86b5 100644
--- a/src/components/ConfiguredProperty.tsx
+++ b/src/components/ConfiguredProperty.tsx
@@ -1,17 +1,14 @@
import React from 'react';
+import configuredProperties from '@site/config-specs/properties/properties.json';
-const CONFIGURED_PROPERTIES = {
- MIN_VELOCITY_JAVA: "17",
-}
-
-const CONFIGURED_PROPERTY_NAMES = Object.keys(CONFIGURED_PROPERTIES);
+const CONFIGURED_PROPERTY_NAMES = Object.keys(configuredProperties);
export function isConfiguredProperty(propertyKey: string): boolean {
return CONFIGURED_PROPERTY_NAMES.includes(propertyKey);
}
export function getConfiguredProperty(propertyKey: string): string {
- return CONFIGURED_PROPERTIES[propertyKey];
+ return configuredProperties[propertyKey];
}
export default function ConfiguredProperty({ propertyKey }) {
From 8f406cfe7ad5d66e0b85420ad324fe214a05c670 Mon Sep 17 00:00:00 2001
From: olijeffers0n <69084614+olijeffers0n@users.noreply.github.com>
Date: Fri, 2 Feb 2024 19:09:49 +0000
Subject: [PATCH 3/7] Add property component to recommendation
---
docs/paper/admin/getting-started/getting-started.mdx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/paper/admin/getting-started/getting-started.mdx b/docs/paper/admin/getting-started/getting-started.mdx
index d957fa6b8..1271444d9 100644
--- a/docs/paper/admin/getting-started/getting-started.mdx
+++ b/docs/paper/admin/getting-started/getting-started.mdx
@@ -9,7 +9,8 @@ description: How to get started with downloading and setting up a Paper server.
:::tip
-With the release of Minecraft 1.18, Paper now requires **Java 17** to run. We recommend using **Java 21**, which [is easy to download and install](/misc/java-install).
+With the release of Minecraft 1.18, Paper now requires **Java 17** to run. We recommend using
+**Java **, which [is easy to download and install](/misc/java-install).
:::
From ad3b7c14bd9081a81493e915c4f5be67b0af645c Mon Sep 17 00:00:00 2001
From: olijeffers0n <69084614+olijeffers0n@users.noreply.github.com>
Date: Fri, 2 Feb 2024 19:12:50 +0000
Subject: [PATCH 4/7] Add info to CONTRIBUTING.md
---
CONTRIBUTING.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 17e030331..6f4c7049d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -142,6 +142,22 @@ for older versions. This is done by using yarn's docusaurus version command:
yarn docusaurus docs:version:paper "1.20"
```
+## Magic Value Handling
+
+When writing documentation, it is important to avoid using "magic values" in the documentation. This may be slightly less
+obscure than in code, but it is still important to avoid using them. For example, these values may end up being used in
+multiple places, and if they change, it is important to change them in all places. This is why it is important to use
+our ConfiguredProperty component to embed these values into the documentation. An example of this would be:
+
+```jsx
+
+```
+
+This will embed the value of the property into the documentation, and if it changes, it will be changed in all places.
+
+These values are stored in the `config-spec/properties/properties.json` file. If you need to add a new property, you can
+add it to this file, and it will be available to use in the documentation.
+
## Code of Conduct
Contributors are expected to follow the [Community Guidelines](https://papermc.io/community/guidelines) of the PaperMC organization in all
From dde7c975bc46e8a7fa38771994c2dd92beff0a31 Mon Sep 17 00:00:00 2001
From: olijeffers0n <69084614+olijeffers0n@users.noreply.github.com>
Date: Fri, 2 Feb 2024 19:20:44 +0000
Subject: [PATCH 5/7] fix links
---
docs/velocity/README.mdx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/velocity/README.mdx b/docs/velocity/README.mdx
index 099a162cd..3ee0cb43b 100644
--- a/docs/velocity/README.mdx
+++ b/docs/velocity/README.mdx
@@ -7,7 +7,7 @@ Velocity is the ridiculously scalable, flexible Minecraft proxy.
## Getting started
It is simple to get started with Velocity. Get started with our
-[Getting Started guide](admin/getting-started/README.md).
+[Getting Started guide](admin/getting-started/README.mdx).
## I need help
@@ -19,7 +19,7 @@ We have put a lot of effort into documenting Velocity as much as possible with o
our coverage will continue to expand. We strongly encourage you to check the sidebar of the docs for
relevant resources. Helping yourself using the resources in these docs saves all of us time.
-We recommend you visit the [frequently-asked questions](admin/getting-started/faq.md) to begin your
+We recommend you visit the [frequently-asked questions](admin/getting-started/faq.mdx) to begin your
search. Most common issues with Velocity are answered there.
Please do not be offended if we respond to your question linking back here. Asking us a question
From 86f7e912e7e96127c2357c141b5a4cf0d13d4698 Mon Sep 17 00:00:00 2001
From: olijeffers0n <69084614+olijeffers0n@users.noreply.github.com>
Date: Sat, 3 Feb 2024 16:11:56 +0000
Subject: [PATCH 6/7] dont wrap the property in a pointless extra tag
---
src/components/ConfiguredProperty.tsx | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/components/ConfiguredProperty.tsx b/src/components/ConfiguredProperty.tsx
index f4b5f86b5..f6009ecf1 100644
--- a/src/components/ConfiguredProperty.tsx
+++ b/src/components/ConfiguredProperty.tsx
@@ -1,4 +1,3 @@
-import React from 'react';
import configuredProperties from '@site/config-specs/properties/properties.json';
const CONFIGURED_PROPERTY_NAMES = Object.keys(configuredProperties);
@@ -17,11 +16,5 @@ export default function ConfiguredProperty({ propertyKey }) {
return null;
}
- const value = getConfiguredProperty(propertyKey);
-
- return (
-
- {value}
-
- );
+ return getConfiguredProperty(propertyKey);
}
From 25b97e1eb92b5feb0b95b3beb4ec5dced0681e0d Mon Sep 17 00:00:00 2001
From: Ollie <69084614+olijeffers0n@users.noreply.github.com>
Date: Fri, 23 Feb 2024 20:54:42 +0000
Subject: [PATCH 7/7] Overhaul Property
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Matouš Kučera
---
CONTRIBUTING.md | 8 +++----
config-specs/properties.json | 5 +++++
config-specs/properties/properties.json | 4 ----
.../admin/getting-started/getting-started.mdx | 16 +++++++-------
.../velocity/admin/getting-started/README.mdx | 4 ++--
docs/velocity/admin/getting-started/faq.mdx | 2 +-
.../creating-your-first-plugin.mdx | 4 ++--
.../dev/how-to/porting-from-velocity-1.mdx | 2 +-
src/components/ConfiguredProperty.tsx | 20 -----------------
src/components/Property.tsx | 22 +++++++++++++++++++
src/theme/MDXComponents.tsx | 4 ++--
11 files changed, 47 insertions(+), 44 deletions(-)
create mode 100644 config-specs/properties.json
delete mode 100644 config-specs/properties/properties.json
delete mode 100644 src/components/ConfiguredProperty.tsx
create mode 100644 src/components/Property.tsx
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6f4c7049d..4290c208a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -145,17 +145,17 @@ yarn docusaurus docs:version:paper "1.20"
## Magic Value Handling
When writing documentation, it is important to avoid using "magic values" in the documentation. This may be slightly less
-obscure than in code, but it is still important to avoid using them. For example, these values may end up being used in
+obscure than in code, but it is still important to avoid using them. For example, these values may end up being used in
multiple places, and if they change, it is important to change them in all places. This is why it is important to use
-our ConfiguredProperty component to embed these values into the documentation. An example of this would be:
+our `Property` component to embed these values into the documentation. An example of this would be:
```jsx
-
+
```
This will embed the value of the property into the documentation, and if it changes, it will be changed in all places.
-These values are stored in the `config-spec/properties/properties.json` file. If you need to add a new property, you can
+These values are stored in the `config-specs/properties.json` file. If you need to add a new property, you can
add it to this file, and it will be available to use in the documentation.
## Code of Conduct
diff --git a/config-specs/properties.json b/config-specs/properties.json
new file mode 100644
index 000000000..8b1baf58c
--- /dev/null
+++ b/config-specs/properties.json
@@ -0,0 +1,5 @@
+{
+ "PAPER_JAVA_MIN": "17",
+ "PAPER_JAVA_RECOMMENDED": "21",
+ "VELOCITY_JAVA_MIN": "17"
+}
diff --git a/config-specs/properties/properties.json b/config-specs/properties/properties.json
deleted file mode 100644
index 9992f681f..000000000
--- a/config-specs/properties/properties.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "MIN_VELOCITY_JAVA": "17",
- "RECOMMENDED_PAPER_JAVA": "21"
-}
diff --git a/docs/paper/admin/getting-started/getting-started.mdx b/docs/paper/admin/getting-started/getting-started.mdx
index ab5f3a038..3a018cea8 100644
--- a/docs/paper/admin/getting-started/getting-started.mdx
+++ b/docs/paper/admin/getting-started/getting-started.mdx
@@ -9,17 +9,17 @@ description: How to get started with downloading and setting up a Paper server.
:::tip
-With the release of Minecraft 1.18, Paper now requires **Java 17** to run. We recommend using
-**Java **, which [is easy to download and install](/misc/java-install).
+Paper requires at least **Java ** to run. We recommend using
+**Java **, which [is easy to download and install](/misc/java-install).
:::
-| Paper Version | Recommended Java Version |
-|----------------|------------------------------------------------------------------|
-| 1.8 to 1.11 | Java 8 |
-| 1.12 to 1.16.4 | Java 11 |
-| 1.16.5 | Java 16 |
-| 1.17.1-1.18.1+ | Java |
+| Paper Version | Recommended Java Version |
+|----------------|-------------------------------------------------|
+| 1.8 to 1.11 | Java 8 |
+| 1.12 to 1.16.4 | Java 11 |
+| 1.16.5 | Java 16 |
+| 1.17.1-1.18.1+ | Java |
## Downloading Paper
diff --git a/docs/velocity/admin/getting-started/README.mdx b/docs/velocity/admin/getting-started/README.mdx
index cd6947d67..10a2f7764 100644
--- a/docs/velocity/admin/getting-started/README.mdx
+++ b/docs/velocity/admin/getting-started/README.mdx
@@ -9,8 +9,8 @@ This page covers how to install and set up a minimal configuration of Velocity.
## Installing Java
Velocity is written in Java, so if you do not already have Java installed, you will need to install
-it before you continue. Velocity requires Java or newer. See our
-[java installation guide](/misc/java-install) for detailed instructions.
+it before you continue. Velocity requires Java or newer. See our
+[Java installation guide](/misc/java-install) for detailed instructions.
## Downloading Velocity
diff --git a/docs/velocity/admin/getting-started/faq.mdx b/docs/velocity/admin/getting-started/faq.mdx
index a36a5718a..8e8c1e5aa 100644
--- a/docs/velocity/admin/getting-started/faq.mdx
+++ b/docs/velocity/admin/getting-started/faq.mdx
@@ -10,7 +10,7 @@ many of these questions from the user perspective.
## What version of Java does Velocity require?
-Velocity 3.3.x requires Java or above.
+Velocity 3.3.x requires Java or above.
## Where can I find Velocity plugins?
diff --git a/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx b/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx
index 79a262556..1dd91efcd 100644
--- a/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx
+++ b/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx
@@ -26,7 +26,7 @@ IDEA is recommended.
- Open your IDE
- Click `Create New Project` or the equivalent
- Select either `Gradle` or `Maven`
-- Make sure your **Project JDK** is Java or later
+- Make sure your **Project JDK** is Java or later
- **Finish** the dialog and open the project.
Now we have created our project, we need configure our build system.
@@ -174,7 +174,7 @@ You will be asked to provide some information about your project.
| **Group ID** | The group ID of your project. This is used for Maven and Gradle. This is usually your domain name in reverse. If you don't know what you should put here, you can use something like `io.github.` or if you don't have GitHub you can just use `me.`. |
| **Artifact ID** | The artifact ID of your project. This is used for Maven and Gradle. This is usually the name of your project. This is usually the same as the `Name` field. |
| **Version** | The version of your project. This is used for Maven and Gradle. This is usually `1.0-SNAPSHOT` and does not really matter for now. |
-| **JDK** | The JDK you want to use. This can be anything from Java and above. |
+| **JDK** | The JDK you want to use. This can be anything from Java and above. |
Now you can click on the `Create` button and IntelliJ will create the project for you.
If everything went well, you should see something like this:
diff --git a/docs/velocity/dev/how-to/porting-from-velocity-1.mdx b/docs/velocity/dev/how-to/porting-from-velocity-1.mdx
index 40b89864a..76efbb26b 100644
--- a/docs/velocity/dev/how-to/porting-from-velocity-1.mdx
+++ b/docs/velocity/dev/how-to/porting-from-velocity-1.mdx
@@ -10,7 +10,7 @@ document very carefully**.
## Minimum supported Java version bump
-Velocity 3.3.x now requires Java and above.
+Velocity 3.3.x now requires Java and above.
## Removal of legacy dependencies
diff --git a/src/components/ConfiguredProperty.tsx b/src/components/ConfiguredProperty.tsx
deleted file mode 100644
index f6009ecf1..000000000
--- a/src/components/ConfiguredProperty.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import configuredProperties from '@site/config-specs/properties/properties.json';
-
-const CONFIGURED_PROPERTY_NAMES = Object.keys(configuredProperties);
-
-export function isConfiguredProperty(propertyKey: string): boolean {
- return CONFIGURED_PROPERTY_NAMES.includes(propertyKey);
-}
-
-export function getConfiguredProperty(propertyKey: string): string {
- return configuredProperties[propertyKey];
-}
-
-export default function ConfiguredProperty({ propertyKey }) {
-
- if (!isConfiguredProperty(propertyKey)) {
- return null;
- }
-
- return getConfiguredProperty(propertyKey);
-}
diff --git a/src/components/Property.tsx b/src/components/Property.tsx
new file mode 100644
index 000000000..c0658ad1e
--- /dev/null
+++ b/src/components/Property.tsx
@@ -0,0 +1,22 @@
+import properties from "@site/config-specs/properties.json";
+
+export function hasProperty(key: string): boolean {
+ return key in properties;
+}
+
+export function getProperty(key: string): string | null {
+ return properties[key] ?? null;
+}
+
+interface PropertyProps {
+ name: string;
+ defaultValue?: string;
+}
+
+export default function Property({ name, defaultValue = "" }: PropertyProps) {
+ if (!hasProperty(name)) {
+ return defaultValue;
+ }
+
+ return getProperty(name);
+}
diff --git a/src/theme/MDXComponents.tsx b/src/theme/MDXComponents.tsx
index 0b2fda9f8..07dd276f2 100644
--- a/src/theme/MDXComponents.tsx
+++ b/src/theme/MDXComponents.tsx
@@ -6,7 +6,7 @@ import Tabs from '@theme/Tabs';
import VersionFormattedCode from '@site/src/components/VersionFormattedCode';
import SoftwareVersion from '@site/src/components/SoftwareVersion';
import VersionedJavaDocLink from '../components/VersionedJavaDocLink';
-import ConfiguredProperty from '@site/src/components/ConfiguredProperty';
+import Property from '@site/src/components/Property';
export default {
// Re-use the default mapping
@@ -17,6 +17,6 @@ export default {
VersionFormattedCode,
SoftwareVersion,
VersionedJavaDocLink,
- ConfiguredProperty,
+ Property,
Icon: Icon,
};