From db9d56cf8236e7c8fcc33450bc8801899d8673db Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sun, 14 Nov 2021 00:37:29 +0100 Subject: [PATCH] fix formatting --- README.md | 6 ++--- docs/packaging/README.md | 1 - docs/schema/addon.md | 6 ++--- docs/schema/addonscript.md | 4 ++-- docs/schema/conditions.md | 1 + docs/schema/file.md | 5 +++-- docs/schema/meta.md | 45 ++++++++++++++++++++++++-------------- docs/schema/relation.md | 3 ++- docs/schema/repository.md | 4 ++-- format.sh | 2 +- 10 files changed, 46 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 6cf4a31..a3257f7 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This repository contains the AddonScript specification. ## What is AddonScript? -AddonScript is a format to distribute Minecraft addons. An addon could be anything, which is installed +AddonScript is a format to distribute Minecraft addons. An addon could be anything, which is installed into the Minecraft game, like a mod, modpack, modloader, texturepack or even a world. -AddonScript can be used for example to define how addons are installed, or to specify dependencies +AddonScript can be used for example to define how addons are installed, or to specify dependencies for addons. This way, addon creators just have to publish the AddonScript file for their addon and let AddonScript compatible tools (for example launchers) install them. @@ -23,7 +23,7 @@ contribute ideas to the AddonScript specification. AddonScript depends on nothing, except Minecraft itself (and Java). This means that the specification does not depend on existing APIs and formats like Curseforge. It also does not reference any specific modloader like Forge or Fabric, instead they are themselves addons, which can be defined using AddonScript. -This means, that AddonScript is not bound to a specific set of modloaders, instead you can use any +This means, that AddonScript is not bound to a specific set of modloaders, instead you can use any modloader. ### Universal diff --git a/docs/packaging/README.md b/docs/packaging/README.md index ca65e4c..b12fc06 100644 --- a/docs/packaging/README.md +++ b/docs/packaging/README.md @@ -2,4 +2,3 @@ Packaging is a way to distribute an AddonScript file and associated files together in a single file. Currently, the only specified ackaging way is [zip-based packaging](zip.md). - diff --git a/docs/schema/addon.md b/docs/schema/addon.md index c298d4d..87a6a33 100644 --- a/docs/schema/addon.md +++ b/docs/schema/addon.md @@ -1,6 +1,6 @@ # Addon Object -``` json +```json { "addonscript": {}, "id": "myaddon", @@ -28,7 +28,7 @@ It should be written in the `kebab-case` format, meaning lowercase only and usin ### version -This is the version number of this version. It must follow [semver versioning specifications](https://semver.org/spec/v2.0.0.html), +This is the version number of this version. It must follow [semver versioning specifications](https://semver.org/spec/v2.0.0.html), as they are used to compare versions. ## Optional properties @@ -48,7 +48,7 @@ This is an array of [relation objects](relation.md) which represent addons in re ### flags This is an array of [flags](../flags.md) for this version. - + ### repositories This is an array of [repository objects](repository.md). Each repository object defines one repository from which files or diff --git a/docs/schema/addonscript.md b/docs/schema/addonscript.md index b04cc62..bccade3 100644 --- a/docs/schema/addonscript.md +++ b/docs/schema/addonscript.md @@ -1,6 +1,6 @@ # AddonScript Object -``` json +```json { "version": 2 } @@ -11,8 +11,8 @@ Future fields may be added. # Required properties ## version + This is the version of the addonscript format the file is written in. The specification you are reading is for version 2. Version 1 is an old version which is deprecated, and doesn't have to be (and shouldn't be) implemented by tools using addonscript. - diff --git a/docs/schema/conditions.md b/docs/schema/conditions.md index 59d7f16..83caf27 100644 --- a/docs/schema/conditions.md +++ b/docs/schema/conditions.md @@ -79,6 +79,7 @@ cannot be referenced, as only addon-ids are used. + ```json { "companion": [ diff --git a/docs/schema/file.md b/docs/schema/file.md index 0ef4bdc..40cb041 100644 --- a/docs/schema/file.md +++ b/docs/schema/file.md @@ -1,6 +1,6 @@ # File Object -``` json +```json { "id": "modfile", "url": "https://example.com/mymod.jar", @@ -19,13 +19,14 @@ This is the ID of the file. It should be written in the `kebab-case` format, meaning lowercase only and using `-` instead of spaces. + If multiple file objects in the same array have the same ID, they are treated as the same file, which means that the first one of them in the array will be used unless it can't be retrieved from the URL, in which case the next one will be used as a fallback. ### url -This is an [URL](../url.md), which points to the actual file. +This is a [URL](../url.md), which points to the actual file. ### install diff --git a/docs/schema/meta.md b/docs/schema/meta.md index 5d9921b..b126d5f 100644 --- a/docs/schema/meta.md +++ b/docs/schema/meta.md @@ -1,34 +1,37 @@ # Meta Object -``` json +```json { - "addon": { - "name": "My cool addon name", - "icon": "./icon.png", - "description":"./README.md", - "summary": "My Addon", - "website": "https://example.com", - "source": "https://gitea.com/user/myaddon", - "issues": "https://gitea.com/user/myaddon/issues", - "contributors": ["Alice", "Bob"] - }, - "version": { - "changelog": "./CHANGELOG.md", - "timestamp": 1594753200 - }, - "additional": {} + "addon": { + "name": "My cool addon name", + "icon": "./icon.png", + "description": "./README.md", + "summary": "My Addon", + "website": "https://example.com", + "source": "https://gitea.com/user/myaddon", + "issues": "https://gitea.com/user/myaddon/issues", + "contributors": ["Alice", "Bob"] + }, + "version": { + "changelog": "./CHANGELOG.md", + "timestamp": 1594753200 + }, + "additional": {} } ``` ## Optional properties ### addon + An [addon mata](#addon-meta-object) object. ### version + A [version mata](#version-meta-object) object. ### additional + This object can contain any arbitrary data, # Addon Meta Object @@ -36,29 +39,37 @@ This object can contain any arbitrary data, ## Optional Properties ### name + The full, human-readable name of the addon. This is what a program such as a launcher should display to the user. ### icon + A path to the icon of the addon. This path should point to an image file of small resolution which is ideally square. It can be dispayed to users in programs. ### description + A path to a description file for the addon. The file should be in CommonMark markdown. ### summary + A short description of the addon, to be shown in lists and menus where the addon is shown aside others. ### website + A URL to a website about the addon ### source + A URL to the source code of the addon. ### issues + A URL to an issue tracker for the addon. ### contributors + An array of people who have contributed to the addon. # Version Meta Object @@ -66,7 +77,9 @@ An array of people who have contributed to the addon. ## Optional properties ### changelog + A path to a changelog file for the addon. ### timestamp + A unix timestamp of the time and date of the version's release. diff --git a/docs/schema/relation.md b/docs/schema/relation.md index 87ca38a..030c273 100644 --- a/docs/schema/relation.md +++ b/docs/schema/relation.md @@ -14,11 +14,12 @@ ### id -This is the ID or namespaced ID of the addon this relation refers to. +This is the ID or namespaced ID of the addon this relation refers to. ### version + This is a [semver version range](https://github.com/semver/semver/pull/584) of supported versions of this relation. ## Optional properties diff --git a/docs/schema/repository.md b/docs/schema/repository.md index 03698fd..a775474 100644 --- a/docs/schema/repository.md +++ b/docs/schema/repository.md @@ -20,7 +20,7 @@ This is the type of the repository. Possible values are [`api`](../repository/ap ### url -This is the base URL of the repository. While other URLs in AddonScript can have different schemes, -the base URL has to be a http(s) URL, except for `index` and `maven` repositories, where it can also be `file`. +This is the base URL of the repository. While other URLs in AddonScript can have different schemes, +the base URL has to be a http(s) URL, except for `index` and `maven` repositories, where it can also be `file`. If it is a maven repository the scheme can also be `file`, where it points to a directory, which contains the maven repository. diff --git a/format.sh b/format.sh index 1f3c081..3007032 100755 --- a/format.sh +++ b/format.sh @@ -1,3 +1,3 @@ #!/bin/sh # Requires the prettier formatter. This should always be run before committing (looking at you, tilera!) -prettier --write ./**/*.md +prettier --write $(find -name "*.md")