-
-
-
-
-
diff --git a/docs/.vuepress/theme/index.js b/docs/.vuepress/theme/index.js
deleted file mode 100644
index f6c8854..0000000
--- a/docs/.vuepress/theme/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// eslint-disable-next-line no-undef
-module.exports = {
- extend: '@vuepress/theme-default',
-};
diff --git a/docs/.vuepress/theme/layouts/404.vue b/docs/.vuepress/theme/layouts/404.vue
deleted file mode 100644
index 41c1734..0000000
--- a/docs/.vuepress/theme/layouts/404.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/docs/.vuepress/theme/layouts/Layout.vue b/docs/.vuepress/theme/layouts/Layout.vue
deleted file mode 100644
index 305b0bb..0000000
--- a/docs/.vuepress/theme/layouts/Layout.vue
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/docs/.vuepress/theme/mixins/darkThemeHandler.js b/docs/.vuepress/theme/mixins/darkThemeHandler.js
deleted file mode 100644
index f633555..0000000
--- a/docs/.vuepress/theme/mixins/darkThemeHandler.js
+++ /dev/null
@@ -1,36 +0,0 @@
-export default {
- data() {
- return {
- darkTheme: false,
- };
- },
-
- mounted() {
- if (this.yuu.disableDarkTheme !== true) {
- if (this.yuu.defaultDarkTheme === true && !localStorage.getItem('dark-theme')) {
- const { matches } = window.matchMedia('(prefers-color-scheme: dark)');
- localStorage.setItem('dark-theme', matches);
- }
-
- this.darkTheme = localStorage.getItem('dark-theme') === 'true';
- this.toggleDarkTheme();
- }
- },
-
- methods: {
- onToggleClick() {
- this.darkTheme = !this.darkTheme;
- this.toggleDarkTheme();
- },
-
- toggleDarkTheme() {
- if (this.darkTheme) {
- document.body.classList.add('yuu-theme-dark');
- return localStorage.setItem('dark-theme', true);
- }
-
- document.body.classList.remove('yuu-theme-dark');
- localStorage.setItem('dark-theme', false);
- },
- },
-};
diff --git a/docs/.vuepress/theme/mixins/yuuConfig.js b/docs/.vuepress/theme/mixins/yuuConfig.js
deleted file mode 100644
index 16e67ed..0000000
--- a/docs/.vuepress/theme/mixins/yuuConfig.js
+++ /dev/null
@@ -1,17 +0,0 @@
-export default {
- data() {
- return {
- yuu: {},
- };
- },
-
- mounted() {
- const { yuu = {} } = this.$site.themeConfig;
-
- this.yuu = {
- defaultDarkTheme: yuu.defaultDarkTheme || false,
- disableDarkTheme: yuu.disableDarkTheme || false,
- extraOptions: yuu.extraOptions || {},
- };
- },
-};
diff --git a/docs/.vuepress/theme/styles/custom-blocks.styl b/docs/.vuepress/theme/styles/custom-blocks.styl
deleted file mode 100644
index 7cbaba8..0000000
--- a/docs/.vuepress/theme/styles/custom-blocks.styl
+++ /dev/null
@@ -1,66 +0,0 @@
-@import './variables.styl';
-
-.custom-block {
- .custom-block-title {
- font-weight: 600;
- margin-bottom: -0.4rem;
- }
-
- &.tip, &.warning, &.danger {
- padding: 0.1rem 1.5rem;
- border-left-width: 0.5rem;
- border-left-style: solid;
- margin: 1rem 0;
- }
-
- &.tip {
- background-color: lighten($tipGreen, 85%);
- border-color: $tipGreen;
- color: darken($tipGreen, 50%);
-
- .custom-block-title {
- color: darken($tipGreen, 20%);
- }
-
- a {
- color: $tipGreen;
- }
- }
-
- &.warning {
- background-color: rgba(255, 229, 100, 0.3);
- border-color: darken($warningYellow, 35%);
- color: darken($warningYellow, 70%);
-
- .custom-block-title {
- color: darken($warningYellow, 50%);
- }
-
- a {
- color: darken($warningYellow, 40%);
- }
- }
-
- &.danger {
- background-color: lighten($dangerRed, 90%);
- border-color: $dangerRed;
- color: darken($dangerRed, 50%);
-
- .custom-block-title {
- color: $dangerRed;
- }
-
- a {
- color: lighten($dangerRed, 15%);
- }
- }
-
- &.details {
- display: block;
- position: relative;
- border-radius: 2px;
- margin: 1.6em 0;
- padding: 1.6em;
- background-color: $detailsGray;
- }
-}
diff --git a/docs/.vuepress/theme/styles/index.styl b/docs/.vuepress/theme/styles/index.styl
deleted file mode 100644
index 4312d88..0000000
--- a/docs/.vuepress/theme/styles/index.styl
+++ /dev/null
@@ -1,97 +0,0 @@
-@import './variables.styl';
-
-html {
- background-color: unset;
-}
-
-h2 {
- padding-bottom: 0;
- border-bottom: 0;
-}
-
-.theme-default-content {
- code {
- color: lighten($textColor, 20%);
- padding: 0.25rem 0.5rem;
- margin: 0;
- font-size: 0.85em;
- background-color: rgba(27, 31, 35, 0.05);
- border-radius: 3px;
-
- .token {
- &.deleted {
- color: #da3b3b;
- }
-
- &.inserted {
- color: #42b983;
- }
- }
- }
-
- a code {
- color: $accentColor;
- }
-}
-
-// @parent-theme/components/PageEdit.vue
-.page-edit {
- max-width: $contentWidth;
- .edit-link a,
- .last-updated .prefix {
- color: $accentColor;
- }
-}
-
-// @parent-theme/components/PageNav.vue
-.page-nav {
- max-width: $contentWidth;
-}
-
-// @parent-theme/components/SidebarGroup.vue
-.sidebar-heading {
- color: #999;
-}
-
-// @parent-theme/components/SidebarLink.vue
-.sidebar {
- .sidebar-links {
- .sidebar-heading {
- font-size: 1.1em;
- }
-
- a.sidebar-link {
- font-size: 1rem;
- line-height: 1.4;
- }
-
- .sidebar-sub-headers a.sidebar-link {
- font-size: 1em;
- }
- }
-}
-
-// @parent-theme/components/AlgoliaSearchBox.vue
-.algolia-search-wrapper {
- .algolia-autocomplete {
- .algolia-docsearch-suggestion {
- .algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight {
- background-color: rgba(#fff, 0.25);
- }
-
- @media (max-width: $MQMobile) {
- .algolia-docsearch-suggestion--subcategory-column {
- opacity: 1;
- background-color: transparent !important;
- }
- }
- }
-
- .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight {
- box-shadow: inset 0 -2px 0 0 rgba(#3eaf7c, 0.8);
- }
- }
-}
-
-// @parent-theme/styles/custom-blocks.styl
-@import './custom-blocks.styl';
diff --git a/docs/.vuepress/theme/styles/themes/dark.styl b/docs/.vuepress/theme/styles/themes/dark.styl
deleted file mode 100644
index d978098..0000000
--- a/docs/.vuepress/theme/styles/themes/dark.styl
+++ /dev/null
@@ -1,321 +0,0 @@
-@import '../variables.styl';
-
-.yuu-theme-dark {
- color: $darkTextColor;
- background-color: $darkPrimaryBg;
-
- hr {
- border-top-color: $darkBorderColor;
- }
-
- .theme-default-content {
- code {
- color: $purple;
- background-color: $darkSecondaryBg;
- }
-
- a code {
- color: $accentColor;
- }
- }
-
- tr {
- border-top-color: $darkBorderColor;
-
- &:nth-child(2n) {
- background-color: $darkSecondaryBg;
- }
- }
-
- th, td {
- border-color: $darkBorderColor;
- }
-
- // @parent-theme/components/AlgoliaSearchBox.vue
- .algolia-search-wrapper .algolia-autocomplete {
- .ds-dropdown-menu {
- background-color: $darkPrimaryBg;
- border-color: $darkBorderColor;
-
- &::before {
- background-color: $darkPrimaryBg;
- border-color: $darkBorderColor;
- }
-
- [class^="ds-dataset-"] {
- background-color: $darkPrimaryBg;
- }
-
- .ds-suggestion {
- border-color: $darkBorderColor;
- }
-
- .ds-cursor .algolia-docsearch-suggestion--content {
- color: $darkTextColor;
- background-color: $darkSecondaryBg !important;
-
- &::before {
- background-color: $darkBorderColor;
- }
- }
-
- .algolia-docsearch-suggestion--content::before {
- background-color: $darkBorderColor;
- }
- }
-
- .algolia-docsearch-suggestion--category-header {
- border-color: $darkBorderColor;
- }
-
- .algolia-docsearch-suggestion {
- color: $darkTextColor;
- background-color: $darkPrimaryBg;
- border-color: $darkBorderColor;
-
- .algolia-docsearch-suggestion--category-header {
- color: $darkTextColor;
- }
-
- .algolia-docsearch-suggestion--title {
- color: $darkAltTextColor;
- }
-
- .algolia-docsearch-suggestion--subcategory-column {
- color: $darkTextColor;
- background-color: $darkPrimaryBg;
- border-color: $darkBorderColor;
-
- &::before {
- background-color: $darkBorderColor;
- }
-
- .algolia-docsearch-suggestion--highlight {
- color: $accentColor;
- }
- }
-
- .algolia-docsearch-suggestion--subcategory-column-text {
- color: $darkTextColor;
- }
-
- @media (max-width: $MQMobile) {
- .algolia-docsearch-suggestion--subcategory-column-text {
- background-color: rgba(#fff, 0.1);
- }
- }
- }
- }
-
- // @parent-theme/components/Home.vue
- .home {
- .hero .description,
- .feature h2,
- .feature p {
- color: $darkTextColor;
- }
-
- .features {
- border-top-color: $darkBorderColor;
- }
-
- .footer {
- color: $darkAltTextColor;
- border-top-color: $darkBorderColor;
- }
- }
-
- // @theme/components/Navbar.vue
- .navbar {
- color: $darkTextColor;
- background-color: $darkPrimaryBg;
- border-bottom-color: $darkBorderColor;
-
- .links {
- background-color: $darkPrimaryBg;
- }
-
- .site-name {
- color: $darkTextColor;
- }
- }
-
- // @parent-theme/components/NavLinks.vue
- .nav-links {
- a,
- .dropdown-wrapper .dropdown-title {
- color: $darkTextColor;
-
- &:hover,
- &.router-link-active {
- color: $accentColor;
- }
- }
-
- .dropdown-wrapper .nav-dropdown {
- background-color: $darkPrimaryBg;
- border-color: $darkBorderColor;
- }
- }
-
- .yuu-theme-blue {
- .nav-item > a:not(.external) {
- &:hover,
- &.router-link-active {
- border-bottom-color: $blueAccentColor;
- }
- }
- }
-
- .yuu-theme-red {
- .nav-item > a:not(.external) {
- &:hover,
- &.router-link-active {
- border-bottom-color: $redAccentColor;
- }
- }
- }
-
- .yuu-theme-purple {
- .nav-item > a:not(.external) {
- &:hover,
- &.router-link-active {
- border-bottom-color: $purpleAccentColor;
- }
- }
- }
-
- // @parent-theme/components/PageEdit.vue
- .page-nav .inner {
- border-top-color: $darkBorderColor;
- }
-
- // @vuepress/plugin-search/SearchBox.vue
- .search-box {
- input,
- .suggestions {
- background-color: $darkSecondaryBg;
- border-color: $darkBorderColor;
- }
-
- input {
- color: $darkTextColor;
-
- &:focus {
- border-color: alpha($accentColor, 0.75);
- }
- }
-
- .suggestion {
- &.focused {
- background-color: $darkPrimaryBg;
-
- a {
- color: $accentColor;
- }
- }
-
- a {
- color: $darkAltTextColor;
- }
- }
- }
-
- // @parent-theme/components/Sidebar.vue
- .sidebar {
- background-color: $darkPrimaryBg;
- border-right-color: $darkBorderColor;
- .nav-links {
- border-bottom-color: $darkBorderColor;
- }
- }
-
- // @parent-theme/components/SidebarLink.vue
- a.sidebar-link {
- color: $darkAltTextColor;
-
- &:hover,
- &.active {
- color: $accentColor;
- }
- }
-
- // @vuepress/plugin-pwa/lib/SWUpdatePopup.vue
- .yuu-theme-dark {
- .sw-update-popup {
- background-color: $darkPrimaryBg;
- }
- }
-
- // @parent-theme/styles/custom-blocks.styl
- .custom-block {
- &.tip {
- color: lighten($tipGreen, 50%);
- background-color: alpha($tipGreen, 0.25);
-
- .custom-block-title {
- color: lighten($tipGreen, 20%);
- }
- }
-
- &.warning {
- color: lighten($warningYellow, 40%);
- background-color: alpha($warningYellow, 0.25);
-
- .custom-block-title {
- color: darken($warningYellow, 20%);
- }
-
- a {
- color: darken($warningYellow, 10%);
- }
- }
-
- &.danger {
- color: lighten($dangerRed, 50%);
- background-color: alpha($dangerRed, 0.25);
-
- .custom-block-title {
- color: lighten($dangerRed, 30%);
- }
-
- a {
- color: lighten($dangerRed, 20%);
- }
- }
-
- &.details {
- background-color: darken($detailsGray, 85%);
- }
- }
-
-.el-tabs--border-card > .el-tabs__content {
- padding: 15px;
- background-color: #282c34 !important;
-}
-.el-tabs__nav-scroll {
- overflow: hidden;
- background-color: #282c34 !important;
-}
-
-.el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
- background-color: #202225 !important;
- border-right-color: #202225 !important;
- border-left-color: #202225 !important;
-}
-
-
-.el-tabs--border-card > .el-tabs__content {
- /* padding: 15px; */
- background-color: #22242d !important;
-
-}
-
-.el-tabs--border-card {
- background: #FFFFFF;
- border: none !important;
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
- margin-top: 15px;
-}
-
-}
\ No newline at end of file
diff --git a/docs/.vuepress/theme/styles/variables.styl b/docs/.vuepress/theme/styles/variables.styl
deleted file mode 100644
index 95d8960..0000000
--- a/docs/.vuepress/theme/styles/variables.styl
+++ /dev/null
@@ -1,17 +0,0 @@
-// overwrites
-$contentWidth = 920px;
-
-// dark theme colors
-$darkPrimaryBg = #1a1a1a;
-$darkSecondaryBg = #2a2a2a;
-$darkTextColor = #f3f3f3;
-$darkAltTextColor = #b9b9b9;
-$darkBorderColor = alpha(#fff, 0.1);
-
-$purple = #dd6efd;
-
-// content block colors
-$tipGreen = #42b983;
-$warningYellow = #ffe564;
-$dangerRed = #c00;
-$detailsGray = #eee;
diff --git a/docs/concepts/_category_.json b/docs/concepts/_category_.json
new file mode 100644
index 0000000..671d4f7
--- /dev/null
+++ b/docs/concepts/_category_.json
@@ -0,0 +1,10 @@
+{
+ "label": "๐ก Concepts",
+ "position": 3,
+ "link": {
+ "type": "generated-index",
+ "slug": "concepts",
+ "title": "Concepts",
+ "description": "Learn more about Triton's building blocks"
+ }
+}
diff --git a/docs/concepts/commands-permissions.md b/docs/concepts/commands-permissions.md
index 23ad6d9..29988b3 100644
--- a/docs/concepts/commands-permissions.md
+++ b/docs/concepts/commands-permissions.md
@@ -1,3 +1,8 @@
+---
+description: "Detailed reference for Triton's commmands and permissions"
+sidebar_position: 3
+---
+
# Commands and Permissions
Here is a brief summary of the plugin's commands and permissions:
diff --git a/docs/concepts/config.md b/docs/concepts/config.md
index 5bee82f..dbd2e97 100644
--- a/docs/concepts/config.md
+++ b/docs/concepts/config.md
@@ -1,9 +1,11 @@
+---
+sidebar_position: 1
+description: "Detailed reference of Triton's config file"
+---
# Plugin Configuration
This page is a guide on Triton's `config.yml` file.
-[[toc]]
-
## Introduction
This file is where you can configure how Triton will behave in that server.
@@ -25,7 +27,8 @@ Each language must have a language ID (the key of the YML section),
a `flag` and a `display-name`.
Both `commands` and `minecraft-code` are optional.
-::: details Example Language
+
+Example language
```yaml
languages:
@@ -34,9 +37,9 @@ languages:
display-name: '&aEnglish (UK)'
```
-:::
+
-::: warning
+:::warning
When using BungeeCord with a non-local storage option (read below),
you'll need to make sure this section is _exactly_ the same across all servers.
The only exception to this rule is the `commands` field that is ignored on Spigot
@@ -59,7 +62,8 @@ You can find the complete list of locales in the
All the values in the list are **case-insensitive**
-::: details Usage example
+
+Usage example
```yaml
languages:
@@ -69,7 +73,7 @@ languages:
minecraft-code: [en_GB, en_US, en_AU, en_CA, en_NZ, en_PT, en_UD]
```
-:::
+
### `display-name`
@@ -85,10 +89,11 @@ Sometimes you might have missing translations on all languages or just don't wan
fallback directly to the main language (e.g. make European Portuguese fallback to Brazillian portuguese first and then English).
This is a list of languages to try if the translation is not available in this language.
-Despite the value of this field, Triton will always attempt to fetch the translation from the default language
+Regardless of the value of this field, Triton will always attempt to fetch the translation from the default language
after trying all the languages in the config.
-:::details Example
+
+Example
Consider the following configuration (some fields are removed for simplification):
@@ -124,7 +129,7 @@ from the following languages, in order, until that language has the requested tr
- Spanish (Spain) - `es_ES`
- English (UK) - `en_GB`
-:::
+
### `commands`
@@ -143,8 +148,10 @@ There are 2 available variables for use: `%player%` and `%uuid%`.
If you're using BungeeCord, you can also limit commands to certain servers by doing something like:
`BUNGEE:lobby,lobby-2,lobby-3:alert This will only run on 3 servers!`
-::: warning
+:::warning
+
The commands **must not** have a preceding slash (`/`).
+
:::
#### Examples
@@ -167,10 +174,12 @@ Run command on BungeeCord console, but only if the player is on the `lobby` serv
BUNGEE:lobby:alert This will only run on lobby!
```
-::: tip
+:::tip
+
_(BungeeCord only)_
If a command you're using contains a `:` and you want it to be universal, do something like this:
`PLAYER::give @a minecraft:dirt`
+
:::
### `main-language`
@@ -302,7 +311,7 @@ be translated to the default language.
### `prevent-placeholders-in-chat`
-_Default: true_
+_Default: true_
When enabled, if a player types a placeholder in the chat, it will be ignored by Triton.
Otherwise, the placeholder will be translated like normal.
Keep in mind that placeholders outside the player's message (e.g. in the prefix), will
diff --git a/docs/concepts/dynamic-signs.md b/docs/concepts/dynamic-signs.md
index d3ecd13..8d289ca 100644
--- a/docs/concepts/dynamic-signs.md
+++ b/docs/concepts/dynamic-signs.md
@@ -1,6 +1,11 @@
+---
+description: "Dynamic signs allows translating signs that are dynamically"
+sidebar_position: 9
+---
+
# Dynamic Signs
-::: tip REQUIREMENTS
+:::note[Requirements]
Requires Triton v2.3.0 or later.
:::
diff --git a/docs/concepts/patterns.md b/docs/concepts/patterns.md
index 881bf54..4be5f63 100644
--- a/docs/concepts/patterns.md
+++ b/docs/concepts/patterns.md
@@ -1,11 +1,16 @@
+---
+description: "Patterns allow translation of plugins without editing the original text"
+sidebar_position: 7
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
# Patterns
-::: tip REQUIREMENTS
+:::note[Requirements]
Triton v2.0.0 or later is required.
:::
-[[toc]]
-
This feature allows you to translate messages without using placeholders.
Sometimes plugins don't allow you to edit their messages, which means Triton wouldn't work.
@@ -18,15 +23,15 @@ To get started, you just need to add `patterns` to any existing Translatable Ite
**Example:**
-:::: tabs
+
+
-::: tab TWIN
To add a pattern to TWIN, use the _Patterns_ section available in Translatable Items.
![TWIN example](./patterns-1.png)
-:::
-::: tab JSON
+
+
```json
{
@@ -43,10 +48,10 @@ To add a pattern to TWIN, use the _Patterns_ section available in Translatable I
},
```
-:::
-::::
+
+
-::: tip
+:::tip
Depending on the message and plugin, you may need to try both `&` and `ยง` to get the color code right.
:::
@@ -54,12 +59,12 @@ The example above will replace any `&aThis is something that needs &bto &dbe &1
Notice that `)` in the latter needs to be escaped, since this is regex.
To make sure you're using valid regex, you can use a tool like [RegExr](https://regexr.com).
-::: tip
+:::tip
To avoid people typing matching text in the chat, you can (and should) use the beginning (`^`)
and end (`$`) anchors in your patterns.
:::
-::: danger
+:::danger[Performance Considerations]
Don't use patterns unless you really have to. Each pattern is checked against every message,
which can hit your server performance severely. Use Triton placeholders when possible.
:::
@@ -70,15 +75,13 @@ You can use regex groups to select variables and use them in the translated mess
**Example:**
-:::: tabs
-
-::: tab TWIN
+
+
![TWIN example with variables](./patterns-2.png)
-:::
-
-::: tab JSON
+
+
```json
{
@@ -95,8 +98,8 @@ You can use regex groups to select variables and use them in the translated mess
}
```
-:::
-::::
+
+
## Other information
diff --git a/docs/concepts/placeholderapi.md b/docs/concepts/placeholderapi.md
index 2837472..827bd78 100644
--- a/docs/concepts/placeholderapi.md
+++ b/docs/concepts/placeholderapi.md
@@ -1,6 +1,11 @@
+---
+description: "Triton integrates with PlaceholderAPI, allowing translations to be used through PAPI placeholders"
+sidebar_position: 8
+---
+
# clip's PlaceholderAPI
-::: tip REQUIREMENTS
+:::note[Requirements]
Requires Triton v1.1.0 or later.
:::
diff --git a/docs/concepts/placeholders.md b/docs/concepts/placeholders.md
index 7b3de3f..50c67ab 100644
--- a/docs/concepts/placeholders.md
+++ b/docs/concepts/placeholders.md
@@ -1,7 +1,9 @@
+---
+description: "Details about the syntax of Triton placeholders"
+sidebar_position: 5
+---
# Triton Placeholders
-[[toc]]
-
This, along with [translations](./translations.md), is by far the most complex part of the plugin. So let's dive in!
Before processing though, make sure you've read
@@ -36,7 +38,7 @@ It's syntax is very simple: `[lang]translation.key.here[/lang]`.
If you replace `translation.key.here` with the key of the translation you want,
that placeholder will be replaced with the translation in the language of the player.
-::: warning
+:::warning
Since various kinds of text in Minecraft have length limits, most plugins truncate those texts if they would cause the client to crash.
Because of that, Triton might not be able to detect a placeholder if it has been truncated. To fix that, reduce the key length and try again.
:::
@@ -55,7 +57,7 @@ If you remember correctly, you define variables in the translation using `%1`, `
These will be replaced with the content inside the `[arg]` tags, in order
(the first `[arg]` tag will be `%1`, the second will be `%2` and so on).
-::: tip
+:::tip
You can nest placeholders if you want.
Example: `[lang]economy.withdrawal[args][arg]10[/arg][arg][lang]currency.usd[/lang][/arg][/args][/lang]`
diff --git a/docs/concepts/storage.md b/docs/concepts/storage.md
index dd43c78..58e54c2 100644
--- a/docs/concepts/storage.md
+++ b/docs/concepts/storage.md
@@ -1,12 +1,14 @@
+---
+description: "Detailed description of how Triton stores translations and other data"
+sidebar_position: 2
+---
# Storage
-::: warning
+:::warning
Triton handles storage differently since v3. The documentation below
might not apply to other versions.
:::
-[[toc]]
-
## Introduction
Changing the storage location will affect where translations/collections
@@ -27,7 +29,7 @@ If you want to use local storage, you don't need the make any changes, it's good
However, if you want to use non-local storage, you have to change the storage type and fill in the information accordingly.
-```yaml{7}
+```yaml {7}
# This section controls the storage location of player data and translations.
# If using a database, the tables/collections will be created automatically for you.
# You can use '/triton database upload' to upload the local translations to a remote storage.
@@ -47,7 +49,7 @@ storage:
table-prefix: 'triton_'
```
-::: tip
+:::tip
The `server-name` variable is only loaded when using non-local storage types
and it's used to filter translations that have entries in the `server` field.
If you're using a server template system, it might not be possible to set this.
@@ -55,12 +57,12 @@ Leaving this empty will work correctly as long as you don't want to filter
translations by server.
:::
-::: warning
+:::warning
If you're using the BungeeCord network approach, you must use the same storage configuration on all servers, including on BungeeCord itself.
If you fail to do that, translations might not be loaded correctly.
:::
-::: danger
+:::danger
If you're using MySQL storage with BungeeCord (or a proxy), you **MUST** have the same configuration for `languages` on Triton's config on
all servers and on the proxy.
If you don't do this, translations will **not** be synced correctly between servers.
@@ -85,7 +87,7 @@ extremely seamless.
### Using `/triton database`
-::: danger
+:::danger
Be extremely careful when using this command, since it will overwrite all files on download
and all database content on upload.
:::
diff --git a/docs/concepts/translations.md b/docs/concepts/translations.md
index 315e27f..55cccea 100644
--- a/docs/concepts/translations.md
+++ b/docs/concepts/translations.md
@@ -1,6 +1,11 @@
-# Translations
+---
+description: "Overview of translations and reference for how they are stored"
+sidebar_position: 4
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
-[[toc]]
+# Translations
## Introduction
@@ -23,17 +28,16 @@ Before you can add translations, you must have, at least, one collection.
Triton generates the `default` collection for you automatically, but you can
rename it or create other collections.
-:::: tabs
+
+
-::: tab TWIN
-
-Creating a collection through TWIN is extremely straight-forward.
+Creating a collection through TWIN is extremely straightforward.
Simply click on the "Add Collection" button in the sidebar and type the name for the collection.
Hit "Add" and _bam_, your collection has been created.
-:::
+
+
-::: tab JSON
Each collection is a JSON file in the `translations` folder, so you can create them
simply by creating a new file.
@@ -58,29 +62,33 @@ alternative syntax:
}
```
-:::
-::::
+
+
### Deleting a collection
Deleting a collection is also very easy to do, just follow the instructions
for your preferred method:
-:::: tabs
-::: tab TWIN
+
+
+
Deleting a collection on TWIN will, by default, move the translations to the default collection.
If you don't want this to happen, consider selecting all the translations inside the collection
and using the "Move to collection" bulk item.
To delete a collection, just click the "Delete collection" button in the sidebar and select the collection you want to delete.
-:::
-::: tab JSON
+
+
+
+
Deleting a collection file from the `translations` folder also deletes all translations inside.
Copy them to another collection if this is not the behaviour you want.
To delete a collection, simply delete the corresponding file inside the `translations` folder.
-:::
-::::
+
+
+
## Managing translations
@@ -95,8 +103,9 @@ The type field is automatically set on TWIN by selecting the text type.
Meanwhile, the `languages` field is where you'll define the actual translations for each
language.
-::::: tabs
-:::: tab TWIN
+
+
+
To add a text translation, click on the "Add item" (`+`) button on the
top right corner while on the dashboard. Then choose _"Text"_ to create a Text Item.
@@ -104,12 +113,14 @@ Fill in the information as you wish.
Example:
![TWIN Text Translation Item example](./translations-1.png)
-::::
-:::: tab JSON
+
+
+
+
To add a text translation, simply open the `translations/default.json` file
and add this object (as an example) to the JSON array:
-```json{2-3}
+```json {2-3}
{
"type": "text",
"key": "my.first.translation",
@@ -140,15 +151,16 @@ If this is the first time you opened your `translations/default.json` file, this
]
```
-::: tip
+:::tip
To make sure you're using valid JSON, use a JSON parser.
There are hundreds of JSON parsers online, but [here](https://jsonformatter.org/json-pretty-print) is one (completely random one).
You can also use an IDE like [Visual Studio Code](https://code.visualstudio.com)
:::
If you are not sure how to use the `translations/default.json` file, take a look at these [examples](https://github.com/tritonmc/Triton/tree/v1/examples).
-::::
-:::::
+
+
+
#### Using variables
@@ -163,11 +175,14 @@ These variables will later be replaced by their actual value passed through the
[Triton Placeholder](./placeholders.md)'s `arg` tag.
Example:
-:::: tabs
-::: tab TWIN
+
+
+
+
![TWIN Translations with variables example](./translations-2.png)
-:::
-::: tab JSON
+
+
+
```json
{
@@ -180,12 +195,12 @@ Example:
}
```
-:::
-::::
+
+
#### Using JSON chat components
-::: tip REQUIREMENTS
+:::note[Requirements]
This feature requires Triton v3.1.0 or newer.
Understanding of the [Minecraft JSON Text Format](https://minecraft.gamepedia.com/Raw_JSON_text_format) is also required.
:::
@@ -208,7 +223,7 @@ In the future, a button to switch between text and JSON modes will be added, whi
#### Using Kyori's MiniMessage
-::: tip REQUIREMENTS
+:::note[Requirements]
This feature requires Triton v3.5.1 or newer and PaperMC (or a fork).
Understanding of the [MiniMessage Format](https://docs.adventure.kyori.net/minimessage.html#format) is also required.
:::
@@ -228,7 +243,7 @@ Example:
#### Using PlaceholderAPI
-::: tip REQUIREMENTS
+:::note[Requirements]
This feature requires Triton v3.7.0 or newer.
:::
@@ -244,14 +259,16 @@ Welcome, %player_name%!
Also known as Sign Groups, these can be used to translate signs.
-:::: tabs
+
+
-::: tab TWIN
Here is an example of a working sign:
![TWIN Sign example](./translations-3.png)
-:::
-::: tab JSON
+
+
+
+
**Sign Groups** look a bit different. Their type is `sign` instead of `text`.
Here is an example of a working sign:
@@ -290,8 +307,9 @@ Finally, the `locations` parameter holds a list of all the signs in this **Sign
While you can't provide dynamic arguments to signs directly, you can still have dynamic signs.
Take a look at the [dynamic signs page](./dynamic-signs.md) if you want to translate signs
that have dynamic information (e.g. game join, shops).
-:::
-::::
+
+
+
## Available Fields for Translatable Items
diff --git a/docs/concepts/twin.md b/docs/concepts/twin.md
index 7586979..794f458 100644
--- a/docs/concepts/twin.md
+++ b/docs/concepts/twin.md
@@ -1,19 +1,24 @@
+---
+description: "TWIN is the web interface for Triton that allows for easy management of your translations"
+sidebar_position: 6
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
# TWIN
**TWIN** stands for **T**โriton **W**โeb **In**โterface.
Its goal is you help you manage your `translations` folder easily.
-[[toc]]
-
## Get your TWIN token
To get started, you first need to get your TWIN token.
This token is used to verify your purchase and give you access to the TWIN web services.
There are two ways to get it: using Discord or by sending me a PM on Spigot.
-:::: tabs
+
+
-::: tab Discord
This is by far the fastest and most efficient way to get your TWIN token. Here is what you need to do:
1. [Join our Discord if you haven't already](https://triton.rexcantor64.com/discord).
@@ -22,14 +27,14 @@ This is by far the fastest and most efficient way to get your TWIN token. Here i
4. You should receive a message from the bot saying that your account has been verified.
5. Finally, reply `!twin` to the bot to get the token.
-:::
+
+
-::: tab PM on Spigot
This is really straightforward, but it takes longer than the previous method. I might take a few hours or even days before I reply.
Just send me a [PM on Spigot](https://www.spigotmc.org/members/rexcantor64.165436/) asking for your TWIN token.
-:::
-::::
+
+
## Using TWIN
diff --git a/docs/experimental-features/_category_.json b/docs/experimental-features/_category_.json
new file mode 100644
index 0000000..c4d08a7
--- /dev/null
+++ b/docs/experimental-features/_category_.json
@@ -0,0 +1,10 @@
+{
+ "label": "๐งช Experimental Features",
+ "position": 5,
+ "link": {
+ "type": "generated-index",
+ "slug": "experimental-features",
+ "title": "Experimental Features",
+ "description": "List of unstable features that are not finalized and may change at any moment"
+ }
+}
diff --git a/docs/experimental-features/async-protocollib.md b/docs/experimental-features/async-protocollib.md
index 92ed30e..013450a 100644
--- a/docs/experimental-features/async-protocollib.md
+++ b/docs/experimental-features/async-protocollib.md
@@ -1,12 +1,15 @@
+---
+description: "Run the ProtocolLib listener on a separate thread, improving performance"
+sidebar_position: 1
+---
+
# Async ProtocolLib
-:::danger Experimental Feature Ahead
+:::danger[Experimental Feature Ahead]
The feature below is experimental and might not behave as expected.
Enable at your own risk!
:::
-[[toc]]
-
Up until Triton 3.6.0 almost all packets were intercepted on the main thread.
Starting with **Triton 3.7.0** you can enable an option on config to try out
intercepting ProtocolLib packets asynchronously.
diff --git a/docs/faq/README.md b/docs/faq/README.md
index 858138e..183b5a1 100644
--- a/docs/faq/README.md
+++ b/docs/faq/README.md
@@ -1,6 +1,10 @@
-# FAQ
+---
+title: โ FAQ
+description: Frequently asked questions about Triton
+sidebar_position: 2
+---
-[[toc]]
+# FAQ
## I cannot translate item names and lores on inventory
diff --git a/docs/getting-started/_category_.json b/docs/getting-started/_category_.json
new file mode 100644
index 0000000..85b4fb1
--- /dev/null
+++ b/docs/getting-started/_category_.json
@@ -0,0 +1,10 @@
+{
+ "label": "๐ Getting Started",
+ "position": 1,
+ "link": {
+ "type": "generated-index",
+ "slug": "getting-started",
+ "title": "Getting Started",
+ "description": "Get started with Triton in a few simple steps!"
+ }
+}
diff --git a/docs/getting-started/beta-enrollment.md b/docs/getting-started/beta-enrollment.md
deleted file mode 100644
index 49f04a4..0000000
--- a/docs/getting-started/beta-enrollment.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Beta Enrollment
-
-To get access to the beta access, you'll need to DM `Rexcantor64#7413` on Discord.
-
-There are currently no restrictions on the number of beta testers.
-However if a lot of people apply, priority will be given to those with issues that'll be fixed directly by beta versions.
-
-After being accepted, you'll be required to create an account on [Polymart](https://polymart.org/) in order to download beta versions.
-
-## Transfering purchases from SpigotMC
-
-Polymart should allow you to easily transfer purchases from SpigotMC.
-If you use the same email address as the one in the PayPal account to used to purchase the plugin on SpigotMC,
-you'll automatically gain access.
-
-Otherwise, click on the purchase button and then on _"Already purchased on SpigotMC?"_. Follow the on-screen instructions.
diff --git a/docs/getting-started/initial-configuration.md b/docs/getting-started/initial-configuration.md
index ce9a37f..65829a5 100644
--- a/docs/getting-started/initial-configuration.md
+++ b/docs/getting-started/initial-configuration.md
@@ -1,6 +1,9 @@
-# Initial Configuration
+---
+description: Get started with editing Triton's configuration
+sidebar_position: 2
+---
-[[toc]]
+# Initial Configuration
## Type of Installation
@@ -15,7 +18,7 @@ With that in mind, let's get started.
---
-::: warning VELOCITY
+:::warning[VELOCITY]
If you're using Velocity instead of BungeeCord, you can follow the same configuration that's described for BungeeCord.
However, there are some limitations with Velocity that you should be aware, so take a look at
@@ -40,13 +43,14 @@ If you want to use local storage, you don't need the make any changes, it's good
However, if you want to use non-local storage, you have to change the storage type and fill in the information accordingly.
-```yaml{7}
+```yaml title="config.yml"
# This section controls the storage location of player data and translations.
# If using a database, the tables/collections will be created automatically for you.
# You can use '/triton database upload' to upload the local translations to a remote storage.
# This MUST match what is on BungeeCord
storage:
# Valid options: 'local', 'mysql', 'mongodb'
+ # highlight-next-line
type: 'local'
# This should match the name of this server in BungeeCord's config.yml
# Used to filter translations for this server only
@@ -60,7 +64,7 @@ storage:
table-prefix: 'triton_'
```
-::: tip
+:::tip
The `server-name` variable is only loaded when using non-local storage types
and it's used to filter translations that have entries in the `server` field.
If you're using a server template system, it might not be possible to set this.
@@ -68,12 +72,12 @@ Leaving this empty will work correctly as long as you don't want to filter
translations by server.
:::
-::: warning
+:::warning
If you're using the BungeeCord network approach, you must use the same storage configuration on all servers, including on BungeeCord itself.
If you fail to do that, translations might not be loaded correctly.
:::
-::: danger
+:::danger
If you're using MySQL storage with BungeeCord (or a proxy), you **MUST** have the same configuration for `languages` on Triton's config on
all servers and on the proxy.
If you don't do this, translations will **not** be synced correctly between servers.
@@ -88,7 +92,7 @@ To get a flag code, follow the [guide on generating flag codes](../guides/flags.
Details about every variable below can be found in the [config page](../concepts/config.md).
-```yaml
+```yaml title="config.yml"
# This will be ignored if 'bungeecord' is enabled.
languages:
# The language name. This will influence the language key in the translation files.
@@ -125,7 +129,7 @@ languages:
# - 'SERVER:say %player% (%uuid%) has just changed their language!'
```
-::: tip
+:::tip
If you're using the BungeeCord network approach with local storage,
you only need to configure the languages on the BungeeCord server.
:::
@@ -138,12 +142,12 @@ To use it, you must first [get a TWIN token](../concepts/twin.md).
To get the token, you can either join our [Discord server](https://triton.rexcantor64.com/discord)
or DM me ([Rexcantor64](https://www.spigotmc.org/members/rexcantor64.165436/)) on Spigot.
-```yaml{4}
+```yaml
# To access TWIN, you need a special token.
twin-token: ''
```
-::: tip
+:::tip
If you're using the BungeeCord network approach, you don't need to put the token in any Spigot server.
:::
diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md
index 504314c..389ce11 100644
--- a/docs/getting-started/installation.md
+++ b/docs/getting-started/installation.md
@@ -1,3 +1,8 @@
+---
+description: Download and install the plugin, along with its dependencies
+sidebar_position: 1
+---
+
# Installation
## Downloading the plugin and dependencies
@@ -14,7 +19,7 @@ Additionally, you might need to download some dependencies if you don't have the
Once you've downloaded the plugin, place the `.jar` in the `plugins` folder of all your servers (Spigot, BungeeCord, etc).
-::: warning
+:::warning
Using any other server software than Spigot or BungeeCord (e.g. Paper, Waterfall, etc) is not officially supported.
However, since a large number of users are using those, bug fixes will be provided,
even though internal testing is only done on vanilla Spigot/BungeeCord.
diff --git a/docs/guides/_category_.json b/docs/guides/_category_.json
new file mode 100644
index 0000000..7a4c417
--- /dev/null
+++ b/docs/guides/_category_.json
@@ -0,0 +1,10 @@
+{
+ "label": "๐ Guides",
+ "position": 4,
+ "link": {
+ "type": "generated-index",
+ "slug": "guides",
+ "title": "Guides",
+ "description": "Easy to follow guides for various subjects related to Triton"
+ }
+}
diff --git a/docs/guides/bulk-translate.md b/docs/guides/bulk-translate.md
index bd92238..20e2761 100644
--- a/docs/guides/bulk-translate.md
+++ b/docs/guides/bulk-translate.md
@@ -1,6 +1,9 @@
-# Bulk translating with the generator tool
+---
+description: "Learn how to use the Triton Generator Tool to quickly translate plugins"
+sidebar_position: 2
+---
-[[toc]]
+# Bulk translating with the generator tool
## What is the Triton Generator Tool?
@@ -54,7 +57,7 @@ After filling in all the information, click the "Convert" button.
Two files will be downloaded to your computer: the collection file (`output.json`)
and the original file with the content replaced by placeholders (`original.`).
-::: warning
+:::warning
Some browsers, like Chrome, will block multiple downloads from the same site.
Click on "Accept" when the permission request comes up.
:::
diff --git a/docs/guides/first-translation.md b/docs/guides/first-translation.md
index cf6d7c3..e753054 100644
--- a/docs/guides/first-translation.md
+++ b/docs/guides/first-translation.md
@@ -1,12 +1,18 @@
+---
+description: "This guide goes into the basics of creating a translation"
+sidebar_position: 1
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import YoutubeEmbed from "@site/src/components/YoutubeEmbed";
+
# First Translation
## Video Tutorial
If you prefer a video tutorial of this guide, you can follow the official get started video:
-