From 85362caf96fae952fa4ebf5b1aaab7ce67b9dcda Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sun, 14 Nov 2021 00:25:43 +0100 Subject: [PATCH] add prettier format script and format --- docs/SUMMARY.md | 20 +++++++++++--------- docs/flags.md | 16 ++++++++-------- docs/install.md | 18 ++++++++++++++---- docs/namespaces.md | 1 - docs/url.md | 11 +++++++---- format.sh | 3 +++ 6 files changed, 43 insertions(+), 26 deletions(-) create mode 100755 format.sh diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 7d30b49..9f1bb51 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -3,22 +3,24 @@ - [AddonScript](README.md) # Schema + - [Addon Object](schema/addon.md) - - [AddonScript Object](schema/addonscript.md) - - [File Object](schema/file.md) - - [Install Object](schema/install.md) - - [Relation Object](schema/relation.md) - - [Conditions Object](schema/conditions.md) - - [Repository Object](schema/repository.md) - - [Meta Object](schema/meta.md) + - [AddonScript Object](schema/addonscript.md) + - [File Object](schema/file.md) + - [Install Object](schema/install.md) + - [Relation Object](schema/relation.md) + - [Conditions Object](schema/conditions.md) + - [Repository Object](schema/repository.md) + - [Meta Object](schema/meta.md) # Concepts + - [Installing](install.md) - [Flags](flags.md) - [URLs](url.md) - [Namespaces](namespaces.md) # Packaging -- [Packaging](packaging/README.md) - - [Zip-based Packaging](packaging/zip.md) +- [Packaging](packaging/README.md) + - [Zip-based Packaging](packaging/zip.md) diff --git a/docs/flags.md b/docs/flags.md index fd8a96e..54fc1e5 100644 --- a/docs/flags.md +++ b/docs/flags.md @@ -12,8 +12,8 @@ a [relation](schema/relation.md) was made. These are flags, which can be set for [versions](schema/version.md). -- `instance` This flag specifies, that this is a version of an instance addon. Instance addons represent instances of -Minecraft itself, while non-instance addons have to be installed into an existing instance of Minecraft. +- `instance` This flag specifies, that this is a version of an instance addon. Instance addons represent instances of + Minecraft itself, while non-instance addons have to be installed into an existing instance of Minecraft. ## Relational flags @@ -21,18 +21,18 @@ These are flags, which describe the relation between the addon and [related addo or [files](schema/file.md). - `required` This flag specifies, that the related addon or file is required for the addon. If the addon gets installed, -than any relation or file, which has this flag set, also has to be installed. + than any relation or file, which has this flag set, also has to be installed. - `optional` This flag specifies, that the related addon or file is optional for this addon. If the addon gets installed, -the user should be able to choose, whether he wants to install the relation or file with this flag, or not. This flag -can be used in combination with the [conditions](schema/conditions.md) property. + the user should be able to choose, whether he wants to install the relation or file with this flag, or not. This flag + can be used in combination with the [conditions](schema/conditions.md) property. ### Relation specific These are relational flags, which can only be used for [relations](schema/relation.md). - `included` This flag specifies, that the related addon is included in this one. This also means, that if some -addon requires the related addon, it can also be installed with this addon instead. + addon requires the related addon, it can also be installed with this addon instead. - `incompatible` This flag specifies, that the related addon is incompatible to this one. This means, that they can't -be installed together in the same instance. + be installed together in the same instance. - `launch` This flag specifies, that the related addon should take care of the Minecraft launch process. It can only -be used, if both this and the related addon are instance addons. + be used, if both this and the related addon are instance addons. diff --git a/docs/install.md b/docs/install.md index 8d915cb..57129f3 100644 --- a/docs/install.md +++ b/docs/install.md @@ -3,31 +3,39 @@ ## Install commands ### move + args: + - `[location]` -`move` is simplest install step of all. It just moves the selected file to +`move` is simplest install step of all. It just moves the selected file to the given location. ### extract + args: + - `[location]` `extract` can be used with zip files, to extract the contents of the zip file to the given location. ### rename + args: + - `[new name]` `rename` renames the selected file to the new given filename. ### execute + args: + - `[location]` - `[jar arguments]` -`execute` can be used with an executable jar file. The jar file will be executed with the given arguments and +`execute` can be used with an executable jar file. The jar file will be executed with the given arguments and the given location as working directory. A client should inform the user before just executing the file and ask them for permission to do so and/or it should execute the jar in a closed environment like a container to prevent malicous code from running. @@ -40,11 +48,13 @@ has to be a [client JSON file](https://minecraft.fandom.com/wiki/Client.json) as itself. If it is server-sided. it has to be a jar file, which is the file, that should be launched to start the server. The jar file has to be moved to the root of the instance directory, before using `launch` on it. Moreover, this install step may only be used with instance addons and there may be only one file for each -side, which has this install step, except all of them are marked as `optional`, in which case they are also +side, which has this install step, except all of them are marked as `optional`, in which case they are also implicitly marked as incompatible. ### select + args: + - `[filename]` `select` is used to select the file with the given file name for other installation steps. @@ -54,7 +64,7 @@ If no file name is given, the selection resets to the original file itself, also ## Locations Locations are specified as a relative path from the Minecraft directory to which the file should be installed. -For example `./mods` would point to the mods directory of the Minecraft instance. +For example `./mods` would point to the mods directory of the Minecraft instance. ## Directories diff --git a/docs/namespaces.md b/docs/namespaces.md index 906a9b4..decaf1f 100644 --- a/docs/namespaces.md +++ b/docs/namespaces.md @@ -1,2 +1 @@ # Addon IDs and Namespaces - diff --git a/docs/url.md b/docs/url.md index f8095c4..deb2ee9 100644 --- a/docs/url.md +++ b/docs/url.md @@ -4,21 +4,24 @@ AddonScript uses URLs to point to specific files. AddonScript specifies three UR to point to files. ## http(s) -```https://example.com/file.jar``` + +`https://example.com/file.jar` This URL scheme is mostly self-explaining. It is jsut a simple http or https URL, which points to a file on a http server. ## mvn -```mvn://com.example/someartifact/1.0/core.jar``` + +`mvn://com.example/someartifact/1.0/core.jar` This URL scheme is used, to point to a maven artifact. The URL consists of multiple parts. In this example `com.example` it the namespace of the artifact, `someartifact` is the artifact ID, -`1.0` is the version, `core` is an optional specifier and `.jar` is the file ending. +`1.0` is the version, `core` is an optional specifier and `.jar` is the file ending. `mvn://com.example/someartifact/1.0.jar` would also be a valid URL without an optional specifier. ## file -```./relative/path/to/file.jar``` + +`./relative/path/to/file.jar` This is a relative path to a file. It can only be used with [packaging](packaging/README.md) or in some third-party environments, which are not covered by this specification. diff --git a/format.sh b/format.sh new file mode 100755 index 0000000..1f3c081 --- /dev/null +++ b/format.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# Requires the prettier formatter. This should always be run before committing (looking at you, tilera!) +prettier --write ./**/*.md