From d6b5a4c01e3f866cf5e82772079bf658858095cd Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 11 Sep 2021 01:24:51 +0100 Subject: [PATCH 01/13] build.sh: fix shellcheck errors --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 3c6be47..504abc6 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,7 @@ log_msg() { # $1 - Command name to check for check_command() { set +e; - which $1 >/dev/null 2>&1; exit_code=$? + command -v "$1" >/dev/null 2>&1; exit_code="$?"; if [[ "${exit_code}" -ne 0 ]]; then log_msg "Error: Couldn't locate $1. Make sure it's installed and in your path."; fi From 4a40e78dd7d20462f9542eeba8d2fb42450f41da Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 11 Sep 2021 01:29:58 +0100 Subject: [PATCH 02/13] build.sh: fix missing exit --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 504abc6..c92e7a9 100755 --- a/build.sh +++ b/build.sh @@ -5,6 +5,7 @@ current_branch="$(git rev-parse --abbrev-ref HEAD)"; if [[ "${1}" == "ci" ]] && [[ "${current_branch}" != "main" ]]; then echo "Skipping build, because we are currently on the branch '${current_branch}', and we only deploy on the 'main' branch."; + exit 0; fi # ██████ ██ ██████ ██ ██ ██ ██ ██████ From 889ccf3accdcd16afb9b3676857ca37e93b38b52 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 11 Sep 2021 01:43:45 +0100 Subject: [PATCH 03/13] build.sh: only deploy commits present on the main branch --- build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index c92e7a9..17809ff 100755 --- a/build.sh +++ b/build.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash set -e; -current_branch="$(git rev-parse --abbrev-ref HEAD)"; +# current_branch="$(git rev-parse --abbrev-ref HEAD)"; +is_main="$(git branch --contains HEAD | awk '/HEAD/ { next } /main/ { print $1 }')"; -if [[ "${1}" == "ci" ]] && [[ "${current_branch}" != "main" ]]; then - echo "Skipping build, because we are currently on the branch '${current_branch}', and we only deploy on the 'main' branch."; - exit 0; +if [[ "${1}" == "ci" ]] && [[ ! -z "${is_main}" ]]; then + echo "Skipping build, because this commit does not appear to be on the 'main' branch, and we only deploy commits on the 'main' branch."; fi # ██████ ██ ██████ ██ ██ ██ ██ ██████ From 75d40d7a6c1027b6d4a438bfde584dc7926daff8 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 11 Sep 2021 01:45:57 +0100 Subject: [PATCH 04/13] Update dependencies --- .docs/package-lock.json | 343 ++++++++++++++-------------------------- .docs/package.json | 4 +- 2 files changed, 123 insertions(+), 224 deletions(-) diff --git a/.docs/package-lock.json b/.docs/package-lock.json index 6f48460..c0bfda5 100644 --- a/.docs/package-lock.json +++ b/.docs/package-lock.json @@ -13,8 +13,8 @@ }, "devDependencies": { "@11ty/eleventy": "^0.12.1", - "@11ty/eleventy-img": "^0.9.0", - "markdown-it-prism": "^2.1.8", + "@11ty/eleventy-img": "^0.10.0", + "markdown-it-prism": "^2.2.0", "phin": "^3.6.0" } }, @@ -75,9 +75,9 @@ } }, "node_modules/@11ty/eleventy-cache-assets": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.2.1.tgz", - "integrity": "sha512-RnbYXSFmj0d7+9kOPdCmdFou3616++aCNLBBNXxjVJF5tXdziO8PdjS9w0ktBgCIGfxz1/nwPHhL+HEqo3Iz/Q==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.3.0.tgz", + "integrity": "sha512-W8tvO00GlWaKt3ccpEStaUBoj9BE3EgzuD8uYChCfYbN2Q4HkEItkiapvIJT0zJwAwoMfnSq6VHPLScYlX2XCg==", "dev": true, "dependencies": { "debug": "^4.3.1", @@ -95,17 +95,16 @@ } }, "node_modules/@11ty/eleventy-img": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.9.0.tgz", - "integrity": "sha512-bw6++TlUokFuv/VUvnAyVQp5bykSleVvmvedIWkN8iKMykrNnf+UAUi9byXrlsFwgUvWBdMZH+0j1/1nKhv5VQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.10.0.tgz", + "integrity": "sha512-9Mi1Wg8qc1gD7TixQtbwa8t0Z4D2hZF0eweYeMHEFr4WGklnSVckUnTJBr0qG+9f+UX7MzUDXbDPPSRCIRdyYw==", "dev": true, "dependencies": { - "@11ty/eleventy-cache-assets": "^2.2.1", - "debug": "^4.3.1", - "fs-extra": "^9.0.1", - "image-size": "^0.9.3", + "@11ty/eleventy-cache-assets": "^2.3.0", + "debug": "^4.3.2", + "image-size": "^1.0.0", "p-queue": "^6.6.2", - "sharp": "^0.28.2", + "sharp": "^0.29.0", "short-hash": "^1.0.0" }, "funding": { @@ -113,40 +112,21 @@ "url": "https://opencollective.com/11ty" } }, - "node_modules/@11ty/eleventy-img/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "node_modules/@11ty/eleventy-img/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "ms": "2.1.2" }, "engines": { - "node": ">=10" - } - }, - "node_modules/@11ty/eleventy-img/node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" + "node": ">=6.0" }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@11ty/eleventy-img/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, - "engines": { - "node": ">= 10.0.0" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/@babel/helper-validator-identifier": { @@ -305,9 +285,9 @@ "dev": true }, "node_modules/are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", "dev": true, "dependencies": { "delegates": "^1.0.0", @@ -392,15 +372,6 @@ "node": ">=0.8.0" } }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/axios": { "version": "0.21.1", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", @@ -779,13 +750,13 @@ } }, "node_modules/color": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz", - "integrity": "sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/color/-/color-4.0.1.tgz", + "integrity": "sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA==", "dev": true, "dependencies": { - "color-convert": "^1.9.1", - "color-string": "^1.5.4" + "color-convert": "^2.0.1", + "color-string": "^1.6.0" } }, "node_modules/color-convert": { @@ -807,30 +778,15 @@ "dev": true }, "node_modules/color-string": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz", - "integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz", + "integrity": "sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==", "dev": true, "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" } }, - "node_modules/color/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, "node_modules/commander": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", @@ -965,9 +921,9 @@ } }, "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "node_modules/date-time": { @@ -1488,9 +1444,9 @@ } }, "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, "node_modules/follow-redirects": { @@ -1945,9 +1901,9 @@ ] }, "node_modules/image-size": { - "version": "0.9.7", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.9.7.tgz", - "integrity": "sha512-KRVgLNZkr00YGN0qn9MlIrmlxbRhsCcEb1Byq3WKGnIV4M48iD185cprRtaoK4t5iC+ym2Q5qlArxZ/V1yzDgA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.0.tgz", + "integrity": "sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==", "dev": true, "dependencies": { "queue": "6.0.2" @@ -1956,7 +1912,7 @@ "image-size": "bin/image-size.js" }, "engines": { - "node": ">=10.18.0" + "node": ">=12.0.0" } }, "node_modules/immutable": { @@ -2482,9 +2438,9 @@ } }, "node_modules/markdown-it-prism": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.1.8.tgz", - "integrity": "sha512-PBiqlX3zGPQnOk7q7TkeveQfXlqzhjfHg2zSwntDNauYY7KFhg2FzO6O+1boillQptEBcIaEAO9gwKq/tXGHUQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.0.tgz", + "integrity": "sha512-GOcP+oOt5AJHwD/6hnrdLXCSw1ZfjCCGblsmrPEyc5zEuNtRYYUjOsDX2eH5xoWTddnRwWlTT2EL/yN6mDcDwQ==", "dev": true, "dependencies": { "prismjs": "1.24.1" @@ -2712,9 +2668,9 @@ "dev": true }, "node_modules/node-abi": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.0.tgz", - "integrity": "sha512-g6bZh3YCKQRdwuO/tSZZYJAw622SjsRfJ2X0Iy4sSOHZ34/sPPdVBn8fev2tj7njzLwuqPw9uMtGsGkO5kIQvg==", + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", + "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", "dev": true, "dependencies": { "semver": "^5.4.1" @@ -2730,26 +2686,20 @@ } }, "node_modules/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.1.0.tgz", + "integrity": "sha512-Zz1o1BDX2VtduiAt6kgiUl8jX1Vm3NMboljFYKQJ6ee8AGfiTvM2mlZFI3xPbqjs80rCQgiVJI/DjQ/1QJ0HwA==", "dev": true }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", "dev": true, "engines": { "node": "4.x || >=6.0.0" } }, - "node_modules/noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", - "dev": true - }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -3114,9 +3064,9 @@ } }, "node_modules/prebuild-install": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.2.tgz", - "integrity": "sha512-PzYWIKZeP+967WuKYXlTOhYBgGOvTRSfaKI89XnfJ0ansRAH7hDU45X+K+FZeI1Wb/7p/NnuctPH3g0IqKUuSQ==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", + "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", "dev": true, "dependencies": { "detect-libc": "^1.0.3", @@ -3126,7 +3076,6 @@ "mkdirp-classic": "^0.5.3", "napi-build-utils": "^1.0.1", "node-abi": "^2.21.0", - "noop-logger": "^0.1.1", "npmlog": "^4.0.1", "pump": "^3.0.0", "rc": "^1.2.7", @@ -3850,23 +3799,23 @@ "dev": true }, "node_modules/sharp": { - "version": "0.28.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.28.3.tgz", - "integrity": "sha512-21GEP45Rmr7q2qcmdnjDkNP04Ooh5v0laGS5FDpojOO84D1DJwUijLiSq8XNNM6e8aGXYtoYRh3sVNdm8NodMA==", + "version": "0.29.1", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.1.tgz", + "integrity": "sha512-DpgdAny9TuS+oWCQ7MRS8XyY9x6q1+yW3a5wNx0J3HrGuB/Jot/8WcT+lElHY9iJu2pwtegSGxqMaqFiMhs4rQ==", "dev": true, "hasInstallScript": true, "dependencies": { - "color": "^3.1.3", + "color": "^4.0.1", "detect-libc": "^1.0.3", - "node-addon-api": "^3.2.0", - "prebuild-install": "^6.1.2", + "node-addon-api": "^4.1.0", + "prebuild-install": "^6.1.4", "semver": "^7.3.5", "simple-get": "^3.1.0", "tar-fs": "^2.1.1", "tunnel-agent": "^0.6.0" }, "engines": { - "node": ">=10" + "node": ">=12.13.0" }, "funding": { "url": "https://opencollective.com/libvips" @@ -4716,9 +4665,9 @@ } }, "@11ty/eleventy-cache-assets": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.2.1.tgz", - "integrity": "sha512-RnbYXSFmj0d7+9kOPdCmdFou3616++aCNLBBNXxjVJF5tXdziO8PdjS9w0ktBgCIGfxz1/nwPHhL+HEqo3Iz/Q==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.3.0.tgz", + "integrity": "sha512-W8tvO00GlWaKt3ccpEStaUBoj9BE3EgzuD8uYChCfYbN2Q4HkEItkiapvIJT0zJwAwoMfnSq6VHPLScYlX2XCg==", "dev": true, "requires": { "debug": "^4.3.1", @@ -4729,47 +4678,27 @@ } }, "@11ty/eleventy-img": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.9.0.tgz", - "integrity": "sha512-bw6++TlUokFuv/VUvnAyVQp5bykSleVvmvedIWkN8iKMykrNnf+UAUi9byXrlsFwgUvWBdMZH+0j1/1nKhv5VQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.10.0.tgz", + "integrity": "sha512-9Mi1Wg8qc1gD7TixQtbwa8t0Z4D2hZF0eweYeMHEFr4WGklnSVckUnTJBr0qG+9f+UX7MzUDXbDPPSRCIRdyYw==", "dev": true, "requires": { - "@11ty/eleventy-cache-assets": "^2.2.1", - "debug": "^4.3.1", - "fs-extra": "^9.0.1", - "image-size": "^0.9.3", + "@11ty/eleventy-cache-assets": "^2.3.0", + "debug": "^4.3.2", + "image-size": "^1.0.0", "p-queue": "^6.6.2", - "sharp": "^0.28.2", + "sharp": "^0.29.0", "short-hash": "^1.0.0" }, "dependencies": { - "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "ms": "2.1.2" } - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true } } }, @@ -4893,9 +4822,9 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", "dev": true, "requires": { "delegates": "^1.0.0", @@ -4965,12 +4894,6 @@ "integrity": "sha1-dhfBkXQB/Yykooqtzj266Yr+tDI=", "dev": true }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true - }, "axios": { "version": "0.21.1", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", @@ -5275,30 +5198,13 @@ "dev": true }, "color": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz", - "integrity": "sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/color/-/color-4.0.1.tgz", + "integrity": "sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA==", "dev": true, "requires": { - "color-convert": "^1.9.1", - "color-string": "^1.5.4" - }, - "dependencies": { - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - } + "color-convert": "^2.0.1", + "color-string": "^1.6.0" } }, "color-convert": { @@ -5317,9 +5223,9 @@ "dev": true }, "color-string": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz", - "integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz", + "integrity": "sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==", "dev": true, "requires": { "color-name": "^1.0.0", @@ -5446,9 +5352,9 @@ "dev": true }, "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "date-time": { @@ -5869,9 +5775,9 @@ } }, "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, "follow-redirects": { @@ -6213,9 +6119,9 @@ "dev": true }, "image-size": { - "version": "0.9.7", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.9.7.tgz", - "integrity": "sha512-KRVgLNZkr00YGN0qn9MlIrmlxbRhsCcEb1Byq3WKGnIV4M48iD185cprRtaoK4t5iC+ym2Q5qlArxZ/V1yzDgA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.0.tgz", + "integrity": "sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==", "dev": true, "requires": { "queue": "6.0.2" @@ -6636,9 +6542,9 @@ } }, "markdown-it-prism": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.1.8.tgz", - "integrity": "sha512-PBiqlX3zGPQnOk7q7TkeveQfXlqzhjfHg2zSwntDNauYY7KFhg2FzO6O+1boillQptEBcIaEAO9gwKq/tXGHUQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.0.tgz", + "integrity": "sha512-GOcP+oOt5AJHwD/6hnrdLXCSw1ZfjCCGblsmrPEyc5zEuNtRYYUjOsDX2eH5xoWTddnRwWlTT2EL/yN6mDcDwQ==", "dev": true, "requires": { "prismjs": "1.24.1" @@ -6811,9 +6717,9 @@ "dev": true }, "node-abi": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.0.tgz", - "integrity": "sha512-g6bZh3YCKQRdwuO/tSZZYJAw622SjsRfJ2X0Iy4sSOHZ34/sPPdVBn8fev2tj7njzLwuqPw9uMtGsGkO5kIQvg==", + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", + "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", "dev": true, "requires": { "semver": "^5.4.1" @@ -6828,21 +6734,15 @@ } }, "node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.1.0.tgz", + "integrity": "sha512-Zz1o1BDX2VtduiAt6kgiUl8jX1Vm3NMboljFYKQJ6ee8AGfiTvM2mlZFI3xPbqjs80rCQgiVJI/DjQ/1QJ0HwA==", "dev": true }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "dev": true - }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", "dev": true }, "nopt": { @@ -7107,9 +7007,9 @@ } }, "prebuild-install": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.2.tgz", - "integrity": "sha512-PzYWIKZeP+967WuKYXlTOhYBgGOvTRSfaKI89XnfJ0ansRAH7hDU45X+K+FZeI1Wb/7p/NnuctPH3g0IqKUuSQ==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", + "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", "dev": true, "requires": { "detect-libc": "^1.0.3", @@ -7119,7 +7019,6 @@ "mkdirp-classic": "^0.5.3", "napi-build-utils": "^1.0.1", "node-abi": "^2.21.0", - "noop-logger": "^0.1.1", "npmlog": "^4.0.1", "pump": "^3.0.0", "rc": "^1.2.7", @@ -7742,15 +7641,15 @@ "dev": true }, "sharp": { - "version": "0.28.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.28.3.tgz", - "integrity": "sha512-21GEP45Rmr7q2qcmdnjDkNP04Ooh5v0laGS5FDpojOO84D1DJwUijLiSq8XNNM6e8aGXYtoYRh3sVNdm8NodMA==", + "version": "0.29.1", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.1.tgz", + "integrity": "sha512-DpgdAny9TuS+oWCQ7MRS8XyY9x6q1+yW3a5wNx0J3HrGuB/Jot/8WcT+lElHY9iJu2pwtegSGxqMaqFiMhs4rQ==", "dev": true, "requires": { - "color": "^3.1.3", + "color": "^4.0.1", "detect-libc": "^1.0.3", - "node-addon-api": "^3.2.0", - "prebuild-install": "^6.1.2", + "node-addon-api": "^4.1.0", + "prebuild-install": "^6.1.4", "semver": "^7.3.5", "simple-get": "^3.1.0", "tar-fs": "^2.1.1", diff --git a/.docs/package.json b/.docs/package.json index 538f0ed..5a236bf 100644 --- a/.docs/package.json +++ b/.docs/package.json @@ -21,8 +21,8 @@ "homepage": "https://github.com/sbrl/Minetest-WorldEditAdditions#readme", "devDependencies": { "@11ty/eleventy": "^0.12.1", - "@11ty/eleventy-img": "^0.9.0", - "markdown-it-prism": "^2.1.8", + "@11ty/eleventy-img": "^0.10.0", + "markdown-it-prism": "^2.2.0", "phin": "^3.6.0" }, "dependencies": { From be3166624a4a17b4089cb674d7f036c5afb1a6b8 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 18 Sep 2021 12:16:03 +0100 Subject: [PATCH 05/13] //replacemix: fix crash caused by invalid invocation --- CHANGELOG.md | 1 + worldeditadditions_commands/commands/replacemix.lua | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14e927d..aee0cfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Note to self: See the bottom of this file for the release template text. - `moretrees:apple_tree_sapling_ongen` from `apple` to `apple_moretrees` - Add `plum` → `plumtree:sapling` - Add `holly` ⇒ `hollytree:sapling` + - `//replacemix`: Improve error handling to avoid crashes (thanks, Jonathon for reporting via Discord!) ## v1.12: The selection tools update (26th June 2021) diff --git a/worldeditadditions_commands/commands/replacemix.lua b/worldeditadditions_commands/commands/replacemix.lua index 085e596..dd5ff77 100644 --- a/worldeditadditions_commands/commands/replacemix.lua +++ b/worldeditadditions_commands/commands/replacemix.lua @@ -53,6 +53,9 @@ worldedit.register_command("replacemix", { end end end + if not target_node then return false, "Error: No target node specified." end + if not last_node_name then return false, "Error: At least 1 replace node must be specified." end + if not replace_nodes[last_node_name] then replace_nodes[last_node_name] = 1 end From 55982b2eabb0bb48703313f6cf1a3c3f3361344b Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 3 Oct 2021 15:31:27 +0100 Subject: [PATCH 06/13] cloud wand: Improve chat message text --- CHANGELOG.md | 1 + worldeditadditions/lib/selection/cloud.lua | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aee0cfb..a3f1451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Note to self: See the bottom of this file for the release template text. - `//bonemeal`: Add optional node list constraint - `//walls`: Add optional thickness argument - `//sstack`: Add human-readable approx volumes of regions in the selection stack + - Cloud wand: Improve chat message text ### Bugfixes diff --git a/worldeditadditions/lib/selection/cloud.lua b/worldeditadditions/lib/selection/cloud.lua index 35c261c..2910438 100644 --- a/worldeditadditions/lib/selection/cloud.lua +++ b/worldeditadditions/lib/selection/cloud.lua @@ -7,6 +7,7 @@ worldeditadditions.add_pos = {} worldeditadditions.selection = {} function worldeditadditions.selection.add_point(name, pos) if pos ~= nil then + local is_new = not worldedit.pos1[name] and not worldedit.pos2[name] -- print("[set_pos1]", name, "("..pos.x..", "..pos.y..", "..pos.z..")") if not worldedit.pos1[name] then worldedit.pos1[name] = vector.new(pos) end if not worldedit.pos2[name] then worldedit.pos2[name] = vector.new(pos) end @@ -22,7 +23,16 @@ function worldeditadditions.selection.add_point(name, pos) local volume_difference = volume_after - volume_before worldedit.marker_update(name) - worldedit.player_notify(name, "Expanded region by "..volume_difference.." nodes") + print("DEBUG volume_before", volume_before, "volume_after", volume_after) + if is_new then + local msg = "Created new region of "..volume_after.." node" + if volume_after ~= 1 then msg = msg.."s" end + worldedit.player_notify(name, msg) + else + local msg = "Expanded region by "..volume_difference.." node" + if volume_difference ~= 1 then msg = msg.."s" end + worldedit.player_notify(name, msg) + end else worldedit.player_notify(name, "Error: Too far away (try raising your maxdist with //farwand maxdist )") -- print("[set_pos1]", name, "nil") From 66a324420322452b51b55734948e08812db3348a Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 4 Oct 2021 21:45:15 +0100 Subject: [PATCH 07/13] Bugfix docs: fix last section not appearing in reference --- .docs/Reference.html | 3 ++- .docs/lib/parse_sections.js | 28 +++++++++++++++++----------- .docs/package-lock.json | 30 +++++++++++++++--------------- .docs/package.json | 2 +- Chat-Command-Reference.md | 2 +- 5 files changed, 36 insertions(+), 29 deletions(-) diff --git a/.docs/Reference.html b/.docs/Reference.html index 6d3dd9a..2c7494c 100644 --- a/.docs/Reference.html +++ b/.docs/Reference.html @@ -8,7 +8,8 @@
  • A full reference, with detailed explanations for each command
  • -

    After the contents, there is a filter box for filtering the detailed explanations to quickly find the one you're after.

    +

    There is also a filter box for filtering the detailed explanations to quickly find the one you're after.

    +
    diff --git a/.docs/lib/parse_sections.js b/.docs/lib/parse_sections.js index 5cdecf6..1de2589 100644 --- a/.docs/lib/parse_sections.js +++ b/.docs/lib/parse_sections.js @@ -16,27 +16,33 @@ markdown.use(markdown_prism, { } }); +function make_section(acc) { + let title = acc[0].match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, ""); + return { + title: htmlentities.encode(title), + slug: title.toLowerCase().replace(/[^a-z0-9-_\s]+/gi, "") + .replace(/\s+/g, "-") + .replace(/-.*$/, ""), + content: markdown.render(acc.slice(1).join("\n")) + }; +} + module.exports = function parse_sections(source) { const lines = source.split(/\r?\n/gi); const result = []; let acc = []; for(let line of lines) { if(line.startsWith(`#`) && !line.startsWith(`###`)) { - - if(acc.length > 0) { - let title = acc[0].match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, ""); - result.push({ - title: htmlentities.encode(title), - slug: title.toLowerCase().replace(/[^a-z0-9-_\s]+/gi, "") - .replace(/\s+/g, "-") - .replace(/-.*$/, ""), - content: markdown.render(acc.slice(1).join("\n")) - }); - } + if(acc.length > 0) + result.push(make_section(acc)); acc = [ line ]; } else acc.push(line); } + + if(acc.length > 0) + result.push(make_section(acc)); + return result; } diff --git a/.docs/package-lock.json b/.docs/package-lock.json index c0bfda5..7e54602 100644 --- a/.docs/package-lock.json +++ b/.docs/package-lock.json @@ -14,7 +14,7 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-img": "^0.10.0", - "markdown-it-prism": "^2.2.0", + "markdown-it-prism": "^2.2.1", "phin": "^3.6.0" } }, @@ -2438,12 +2438,12 @@ } }, "node_modules/markdown-it-prism": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.0.tgz", - "integrity": "sha512-GOcP+oOt5AJHwD/6hnrdLXCSw1ZfjCCGblsmrPEyc5zEuNtRYYUjOsDX2eH5xoWTddnRwWlTT2EL/yN6mDcDwQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.1.tgz", + "integrity": "sha512-Lo7nQxI+x+MXQkeEXVNIer7fWCGasuEEMxYU63HJCxZNF8bfzWrXDHGsxv0a/qD3mL4sYHj0jUFT0h4fG8WQVw==", "dev": true, "dependencies": { - "prismjs": "1.24.1" + "prismjs": "1.25.0" }, "engines": { "node": ">=6.0.0" @@ -3120,9 +3120,9 @@ } }, "node_modules/prismjs": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.1.tgz", - "integrity": "sha512-mNPsedLuk90RVJioIky8ANZEwYm5w9LcvCXrxHlwf4fNVSn8jEipMybMkWUyyF0JhnC+C4VcOVSBuHRKs1L5Ow==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz", + "integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==", "dev": true }, "node_modules/process-nextick-args": { @@ -6542,12 +6542,12 @@ } }, "markdown-it-prism": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.0.tgz", - "integrity": "sha512-GOcP+oOt5AJHwD/6hnrdLXCSw1ZfjCCGblsmrPEyc5zEuNtRYYUjOsDX2eH5xoWTddnRwWlTT2EL/yN6mDcDwQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.1.tgz", + "integrity": "sha512-Lo7nQxI+x+MXQkeEXVNIer7fWCGasuEEMxYU63HJCxZNF8bfzWrXDHGsxv0a/qD3mL4sYHj0jUFT0h4fG8WQVw==", "dev": true, "requires": { - "prismjs": "1.24.1" + "prismjs": "1.25.0" } }, "maximatch": { @@ -7048,9 +7048,9 @@ } }, "prismjs": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.1.tgz", - "integrity": "sha512-mNPsedLuk90RVJioIky8ANZEwYm5w9LcvCXrxHlwf4fNVSn8jEipMybMkWUyyF0JhnC+C4VcOVSBuHRKs1L5Ow==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz", + "integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==", "dev": true }, "process-nextick-args": { diff --git a/.docs/package.json b/.docs/package.json index 5a236bf..c235790 100644 --- a/.docs/package.json +++ b/.docs/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-img": "^0.10.0", - "markdown-it-prism": "^2.2.0", + "markdown-it-prism": "^2.2.1", "phin": "^3.6.0" }, "dependencies": { diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index 64aa296..9652a9c 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -882,7 +882,7 @@ The far wand (`worldeditadditions:farwand`) is a variant on the traditional Worl It functions very similarly to the regular WorldEdit wand, except that it has a _much_ longer range - which can be very useful for working on large-scale terrain for example. It also comes with an associated command to control it. ## `//farwand skip_liquid (true|false) | maxdist ` -This command helps control the behaviour of the [WorldEditAdditions far wand](#far-wand). Calling it without any arguments shows the current status: +This command helps control the behaviour of the [WorldEditAdditions far wand](#far-wand) and [cloud wand](#cloud-wand). Calling it without any arguments shows the current status: ```weacmd //farwand From da15c577a6e64aef907c1ec7e02474367e4154a3 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 4 Oct 2021 21:51:07 +0100 Subject: [PATCH 08/13] Update quick command reference --- CHANGELOG.md | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3f1451..a0305cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ Note to self: See the bottom of this file for the release template text. - `//bonemeal`: Add optional node list constraint - `//walls`: Add optional thickness argument - `//sstack`: Add human-readable approx volumes of regions in the selection stack - - Cloud wand: Improve chat message text ### Bugfixes @@ -28,6 +27,7 @@ Note to self: See the bottom of this file for the release template text. - Add `plum` → `plumtree:sapling` - Add `holly` ⇒ `hollytree:sapling` - `//replacemix`: Improve error handling to avoid crashes (thanks, Jonathon for reporting via Discord!) + - Cloud wand: Improve chat message text ## v1.12: The selection tools update (26th June 2021) diff --git a/README.md b/README.md index e49deca..4e1350b 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,14 @@ The detailed explanations have moved! Check them out [here](https://github.com/s ### Terrain - [`//overlay [] [] [ []] ...`](https://worldeditadditions.mooncarrot.space/Reference/#overlay) - - [`//layers [ []] [ []] ...`](https://worldeditadditions.mooncarrot.space/Reference/#layers) + - [`//layers [] [ []] [ []] ...`](https://worldeditadditions.mooncarrot.space/Reference/#layers) - [`//fillcaves []`](https://worldeditadditions.mooncarrot.space/Reference/#fillcaves) - [`//convolve [[,]] []`](https://worldeditadditions.mooncarrot.space/Reference/#convolve) - [`//erode [ [ []] [ []] ...]`](https://worldeditadditions.mooncarrot.space/Reference/#erode) **experimental** - [`//noise2d [ []] [ []] ...]`](https://worldeditadditions.mooncarrot.space/Reference/#noise2d) ### Flora - - [`//bonemeal [ []]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#bonemeal-strength-chance) + - [`//bonemeal [ [ [ [ ...]]]]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#bonemeal-strength-chance) - [`//forest [] [] [] [ []] ...`](https://worldeditadditions.mooncarrot.space/Reference/#forest) _(new in v1.9)_ - [`//saplingaliases [aliases|all_saplings]`](https://worldeditadditions.mooncarrot.space/Reference/#saplingaliases) _(new in v1.9)_ From d642d44e4c4db5c62ab7d6e9b8f7cfb32e1a9468 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 4 Oct 2021 21:52:33 +0100 Subject: [PATCH 09/13] Chat-Command-Reference: add note --- Chat-Command-Reference.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index 9652a9c..b96dc66 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -2,6 +2,8 @@ This is the full chat command reference for WorldEditAdditions. Having trouble finding the section you want? Try the **[quick reference](https://github.com/sbrl/Minetest-WorldEditAdditions#quick-command-reference)** instead, which has links to back to sections of this document! +Check out the reference on the new website - it's even searchable: + Other useful links: - [WorldEditAdditions quick reference](https://github.com/sbrl/Minetest-WorldEditAdditions#quick-command-reference) From 5f2d5216af5b42cc12bf4e7a2192c9f0f56a194c Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 4 Oct 2021 22:12:41 +0100 Subject: [PATCH 10/13] Reference: Categorise commands --- Chat-Command-Reference.md | 821 ++++++++++++++++++++++---------------- README.md | 1 + 2 files changed, 475 insertions(+), 347 deletions(-) diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index b96dc66..86bc4ca 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -13,112 +13,17 @@ Other useful links: **Note:** If anything in this reference isn't clear, that's a bug. Please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new) (or even better a PR improving it) to let me know precisely which bit you don't understand and why. - -## `//floodfill [ []]` -Floods all connected nodes of the same type starting at _pos1_ with (which defaults to `water_source`), in a sphere with a radius of (which defaults to 50). - -```weacmd -//floodfill -//floodfill water_source 50 -//floodfill glass 25 -``` - -## `//overlay [] [] [ []] ...` -Places `` in the last contiguous air space encountered above the first non-air node. In other words, overlays all top-most nodes in the specified area with ``. Optionally supports a mix of node names and chances, as `//mix` (WorldEdit) and `//replacemix` (WorldEditAdditions) does. - -Will also work in caves, as it scans columns of nodes from top to bottom, skipping every non-air node until it finds one - and only then will it start searching for a node to place the target node on top of. - -Note that all-air columns are skipped - so if you experience issues with it not overlaying correctly, try `//expand down 1` to add an extra node's space to your defined region. - -Note also that columns without any air nodes in them at all are also skipped, so try `//expand y 1` to add an extra layer to your defined region. - -```weacmd -//overlay grass -//overlay glass -//overlay grass_with_dirt -//overlay grass_with_dirt 10 dirt -//overlay grass_with_dirt 10 dirt 2 sand 1 -//overlay sandstone dirt 2 sand 5 -//overlay dirt 90% stone 10% -``` - -## `//layers [] [ []] [ []] ...` -Finds the first non-air node in each column and works downwards, replacing non-air nodes with a defined list of nodes in sequence. Like WorldEdit for Minecraft's `//naturalize` command, and also similar to [`we_env`'s `//populate`](https://github.com/sfan5/we_env). Speaking of, this command has `//naturalise` and `//naturalize` as aliases. Defaults to 1 layer of grass followed by 3 layers of dirt. - -Since WorldEditAdditions v1.13, a maximum and minimum slope is optionally accepted, and constrains the columns in the defined region that `//layers` will operate on. For example, specifying a value of `20` would mean that only columns with a slop less than or equal to 20° (degrees, not radians) will be operated on. A value of `45..60` would mean that only columns with a slope between 45° and 60° will be operated on. - -The list of nodes has a form similar to that of a chance list you might find in `//replacemix`, `//overlay`, or `//mix` - see the examples below. If the number of layers isn't specified, `1` is assumed (i.e. a single layer). +## Geometry + -```weacmd -//layers dirt_with_grass dirt 3 -//layers sand 5 sandstone 4 desert_stone 2 -//layers brick stone 3 -//layers cobble 2 dirt -//layers 45..60 dirt_with_snow dirt 2 -//layers 30 snowblock dirt_with_snow dirt 2 -``` - -## `//forest [] [] [] [ []] ...` -Plants and grows saplings to generate a forest. A density value is optionally taken, which controls the overall density of the forest that is generated. The `bonemeal` mod is required - just like for the [`//bonemeal`](#bonemeal-strength-chance) command. - -The density defaults to 1, acts like a multiplier, and is not affected by the chances of all saplings listed (e.g. you can have a sapling with a chance of 1-in-50, and the overall density of the forest will be unaffected). For example, 2 results in a forest twice as dense as the default, and 0.5 a forest half as dense as the default density. - -The tree types are provided as a list of names and 1-in-N chances, just like [`//overlay`](#overlay-node_name_a-chance_a-node_name_b-chance_b-node_name_n-chance_n-), `//mix`, `//layers`, etc. Unlike the aforementioned commands however, `//forest` has an additional layer of alias resolution to ease the process of determining what the name of the sapling is you want to use to generate forests with. See [`//saplingaliases`](#saplingaliases-aliasesall_saplings) for more details. - -Saplings are placed with [`//overlay`](#overlay-node_name_a-chance_a-node_name_b-chance_b-node_name_n-chance_n-) and grown using the same method that's used by the `//bonemeal` command. Up to 100 attempts are made to grow placed saplings. If all of those attempts fail (success is determined by whether the sapling is still present or not), the sapling is removed and the failure counter is incremented. - -Currently, the following mods are known to have aliases registered: - - - `default` - - [`moretrees`](https://content.minetest.net/packages/VanessaE/moretrees/) (warning: these saplings don't appear to work very well this command - assistance in debugging this would be very helpful) - - [`cool_trees`](https://content.minetest.net/packages/runs/cool_trees/) - -If you like, you can also reference the full name of a sapling node instead. The only requirements for saplings to be supported by this mod are: - -1. It can be bonemealed -2. It has the `sapling` group - -For example, the first 2 examples below are functionally equivalent. - -```weacmd -//forest aspen -//forest default:aspen_sapling -//forest 2 oak 3 aspen pine -//forest 0.5 acacia -``` - - -## `//saplingaliases [aliases|all_saplings]` -Lists all the currently registered sapling aliases in alphabetical order. These aliases can be used in the `//forest` subcommand. - -Optionally takes a single parameter, which is the operating mode. Current implemented operating modes: - -Mode | Description -----------------|---------------------- -`aliases` | The default. Lists all the currently registered sapling aliases in alphabetical order. -`all_saplings` | Spins through all the nodes currently registered in Minetest, and lists all the nodes that have the `sapling` group. - -```weacmd -//saplingaliases -//saplingaliases all_saplings -//saplingaliases aliases -``` - - -## `//fillcaves []` -Fills in all airlike nodes beneath non airlike nodes, which gives the effect of filling in caves. Defaults to filling in with stone, but this can be customised. - -Note that the *entire* cave you want filling must be selected, as `//fillcaves` only operates within the defined region (ref #50). - -```weacmd -//fillcaves -//fillcaves dirt -//fillcaves brick -``` - - -## `//ellipsoid [h[ollow]]` +### `//ellipsoid [h[ollow]]` Creates a solid ellipsoid at position 1 with the radius `(rx, ry, rz)`. ```weacmd @@ -129,7 +34,7 @@ Creates a solid ellipsoid at position 1 with the radius `(rx, ry, rz)`. //ellipsoid 7 4 7 papyrus hollow ``` -## `//hollowellipsoid ` +### `//hollowellipsoid ` Creates a hollow ellipsoid at position 1 with the radius `(rx, ry, rz)`. Works the same way as `//ellipsoid` does. ```weacmd @@ -137,7 +42,7 @@ Creates a hollow ellipsoid at position 1 with the radius `(rx, ry, rz)`. Works t //hollowellipsoid 21 11 41 stone ``` -## `//torus [ [h[ollow]]]` +### `//torus [ [h[ollow]]]` Creates a solid torus at position 1 with the specified major and minor radii. The major radius is the distance from the centre of the torus to the centre of the circle bit, and the minor radius is the radius of the circle bit. The optional axes sets the axes upon which the torus will lay flat. Possible values: `xy` (the default), `xz`, `yz`. A single axis may also be specified (i.e. `x`, `y`, or `z`) - this will be interpreted as the axis that runs through the hole in the middle of the torus. @@ -150,7 +55,7 @@ The optional axes sets the axes upon which the torus will lay flat. Possible val //torus 25 10 dirt xz hollow ``` -## `//hollowtorus []` +### `//hollowtorus []` Creates a hollow torus at position 1 with the radius major and minor radii. Works the same way as `//torus` does. ```weacmd @@ -159,7 +64,7 @@ Creates a hollow torus at position 1 with the radius major and minor radii. Work //hollowtorus 18 6 dirt xz ``` -## `//line [ []]` +### `//line [ []]` Draw a line from position 1 to position 2, optionally with a given thickness. The radius can be thought of as the thickness of the line, and is defined as the distance from a given node to an imaginary line from pos1 to pos2. Defaults to drawing with dirt and a radius of 1. @@ -173,7 +78,7 @@ Floating-point values are fully supported for the radius. //line glass 0.5 ``` -## `//hollow []` +### `//hollow []` Replaces nodes inside the defined region with air, but leaving a given number of nodes near the outermost edges alone. In other words, it makes the defined region hollow, while leaving walls around the edges of a given thickness (defaulting to a wall thickness of 1). Note that all air-like nodes are also left alone. @@ -183,7 +88,7 @@ Note that all air-like nodes are also left alone. //hollow 2 ``` -## `//maze [ [ []]]` +### `//maze [ [ []]]` Generates a maze using replace_node as the walls and air as the paths. Uses [an algorithm of my own devising](https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html) (see also [this post of mine that has lots of eye candy :D](https://starbeamrainbowlabs.com/blog/article.php?article=posts/429-lua-blender-mazes.html)). It is guaranteed that you can get from every point to every other point in generated mazes, and there are no loops. Requires the currently selected area to be at least 3x3 on the x and z axes respectively. @@ -205,7 +110,8 @@ The last example below shows how to set the path length and width: //maze glass 2 1 minetestiscool ``` -## `//maze3d [ [ [ []]]]` + +### `//maze3d [ [ [ []]]]` Same as `//maze`, but instead generates mazes in 3 dimensions instead of 2. Requires the currently selected area to be at least 3x3x3. The optional `path_depth` parameter defaults to `1` and allows customisation of the height of the paths generated. @@ -227,36 +133,8 @@ Additional examples: //maze3d stone 6 3 3 54321 ``` -## `//bonemeal [ [ [ [ ...]]]]` -Requires the [`bonemeal`](https://content.minetest.net/packages/TenPlus1/bonemeal/) ([repo](https://notabug.org/TenPlus1/bonemeal/)) mod (otherwise _WorldEditAdditions_ will not register this command and output a message to the server log). Alias: `//flora`. -Bonemeals all eligible nodes in the current region. An eligible node is one that has an air node directly above it - note that just because a node is eligible doesn't mean to say that something will actually happen when the `bonemeal` mod bonemeals it. - -Optionally takes a strength value (that's passed to `bonemeal:on_use()`, the method in the `bonemeal` mod that is called to actually do the bonemealing). The strength value is a positive integer from 1 to 4 (i.e. 1, 2, 3, or 4) - the default is 1 (the lowest strength). - -I observe that a higher strength value gives a higher chance that something will actually grow. In the case of soil or sand nodes, I observe that it increases the area of effect of a single bonemeal action (thus at higher strengths generally you'll probably want a higher chance number - see below). See the [`bonemeal` mod README](https://notabug.org/TenPlus1/bonemeal) for more information. - -Also optionally takes a chance number. This is the chance that an eligible node will actually get bonemealed, and is a positive integer that defaults to 1. The chance number represents a 1-in-{number} chance to bonemeal any given eligible node, where {number} is the chance number. In other words, the higher the chance number the lower the chance that a node will be bonemealed. - -For example, a chance number of 2 would mean a 50% chance that any given eligible node will get bonemealed. A chance number of 16 would be a 6.25% chance, and a chance number of 25 would be 2%. - -Since WorldEditAdditions v1.12, a percentage chance is also supported. This is denoted by suffixing a number with a percent sign (e.g. `//bonemeal 1 25%`). - -Since WorldEditAdditions v1.13, a list of node names is also optionally supported. This will constrain bonemeal operations to be performed only on the node names listed. - - -```weacmd -//bonemeal -//bonemeal 3 25 -//bonemeal 4 -//bonemeal 1 10 -//bonemeal 2 15 -//bonemeal 2 10% -//bonemeal 2 10% dirt -//bonemeal 4 50 ethereal:grove_dirt -``` - -## `//walls []` +### `//walls []` Creates vertical walls of `` around the inside edges of the defined region, optionally specifying the thickness thereof. ```weacmd @@ -267,7 +145,29 @@ Creates vertical walls of `` around the inside edges of the define //walls glass 4 ``` -## `//scale | [ [ ` + + +## Misc + + + +### `//floodfill [ []]` +Floods all connected nodes of the same type starting at _pos1_ with (which defaults to `water_source`), in a sphere with a radius of (which defaults to 50). + +```weacmd +//floodfill +//floodfill water_source 50 +//floodfill glass 25 +``` + + +### `//scale | [ [ ` Advanced version of [`//stretch` from WorldEdit](https://github.com/Uberi/Minetest-WorldEdit/blob/master/ChatCommands.md#stretch-stretchx-stretchy-stretchz) that can scale both up and down at the same time by transparently splitting it into 2 different operations. Scaling up is *always* done before scaling down. Although the syntax looks complicated, it's really quite simple. The key concept to understand is that of the scale factor. It refers to how much the defined region should be scaled up or down by, and can be specified in multiple different ways: @@ -287,7 +187,7 @@ In short, you can specify the scale factor directly, as a percentage, or as 1 nu With this in mind, there are 3 forms that you can tell `//scale` how you want to scale the defined region: -### Single Axis +#### Single Axis If you just need to scale a single axis, you can tell `//scale` that like so: ```weacmd @@ -313,7 +213,7 @@ This will scale in the _negative_ y direction by 2 times (again, doubling the he //scale -x 1/3 ``` -### All axes +#### All axes To scale on all axes at once, `//scale` takes the shortcut syntax of specifying a single scale factor: ```weacmd @@ -323,7 +223,7 @@ To scale on all axes at once, `//scale` takes the shortcut syntax of specifying Both of the above will scale the defined region up by 2 times in all directions. -### Multiple scale factors +#### Multiple scale factors If you want to specify different scale factors for difference axes, then `//scale` also supports a third syntax. Here's an example: ```weacmd @@ -349,7 +249,7 @@ By adding 3 extra numbers for the x, y, and z axes respectively, we can control So in the above example, we scale in the positive x and z directions, and the negative y direction. -## `//replacemix [] [] [ []] [ []] ...` +### `//replacemix [] [] [ []] [ []] ...` Replaces a given node with a random mix of other nodes. Functions like `//mix`. This command is best explained with examples: @@ -406,7 +306,19 @@ Here are all the above examples together: //replacemix dirt 3 sandstone 10 dry_dirt cobble 2 ``` -## `//convolve [[,]] []` + + +## Terrain + + + +### `//convolve [[,]] []` Advanced version of `//smooth` from we_env, and one of the few WorldEditAdditions commands to have any aliases (`//smoothadv` and `//conv`). Extracts a heightmap from the defined region and then proceeds to [convolve](https://en.wikipedia.org/wiki/Kernel_(image_processing)) over it with the specified kernel. The kernel can be thought of as the filter that will be applied to the heightmap. Once done, the newly convolved heightmap is applied to the terrain. @@ -434,7 +346,59 @@ The sigma value is only applicable to the `gaussian` kernel, and can be thought //convolve gaussian 5 0.2 ``` -## `//erode [ [ []] [ []] ...]` + +### `//overlay [] [] [ []] ...` +Places `` in the last contiguous air space encountered above the first non-air node. In other words, overlays all top-most nodes in the specified area with ``. Optionally supports a mix of node names and chances, as `//mix` (WorldEdit) and `//replacemix` (WorldEditAdditions) does. + +Will also work in caves, as it scans columns of nodes from top to bottom, skipping every non-air node until it finds one - and only then will it start searching for a node to place the target node on top of. + +Note that all-air columns are skipped - so if you experience issues with it not overlaying correctly, try `//expand down 1` to add an extra node's space to your defined region. + +Note also that columns without any air nodes in them at all are also skipped, so try `//expand y 1` to add an extra layer to your defined region. + +```weacmd +//overlay grass +//overlay glass +//overlay grass_with_dirt +//overlay grass_with_dirt 10 dirt +//overlay grass_with_dirt 10 dirt 2 sand 1 +//overlay sandstone dirt 2 sand 5 +//overlay dirt 90% stone 10% +``` + + +### `//fillcaves []` +Fills in all airlike nodes beneath non airlike nodes, which gives the effect of filling in caves. Defaults to filling in with stone, but this can be customised. + +Note that the *entire* cave you want filling must be selected, as `//fillcaves` only operates within the defined region (ref #50). + +```weacmd +//fillcaves +//fillcaves dirt +//fillcaves brick +``` + + + +### `//layers [] [ []] [ []] ...` +Finds the first non-air node in each column and works downwards, replacing non-air nodes with a defined list of nodes in sequence. Like WorldEdit for Minecraft's `//naturalize` command, and also similar to [`we_env`'s `//populate`](https://github.com/sfan5/we_env). Speaking of, this command has `//naturalise` and `//naturalize` as aliases. Defaults to 1 layer of grass followed by 3 layers of dirt. + +Since WorldEditAdditions v1.13, a maximum and minimum slope is optionally accepted, and constrains the columns in the defined region that `//layers` will operate on. For example, specifying a value of `20` would mean that only columns with a slop less than or equal to 20° (degrees, not radians) will be operated on. A value of `45..60` would mean that only columns with a slope between 45° and 60° will be operated on. + +The list of nodes has a form similar to that of a chance list you might find in `//replacemix`, `//overlay`, or `//mix` - see the examples below. If the number of layers isn't specified, `1` is assumed (i.e. a single layer). + + +```weacmd +//layers dirt_with_grass dirt 3 +//layers sand 5 sandstone 4 desert_stone 2 +//layers brick stone 3 +//layers cobble 2 dirt +//layers 45..60 dirt_with_snow dirt 2 +//layers 30 snowblock dirt_with_snow dirt 2 +``` + + +### `//erode [ [ []] [ []] ...]` Runs an erosion algorithm over the defined region, optionally passing a number of key - value pairs representing parameters that are passed to the chosen algorithm. This command is **experimental**, as the author is currently on-the-fence about the effects it produces. Works best if you run `//fillcaves` first, or otherwise have no air nodes below the top non-air node in each column. @@ -456,7 +420,7 @@ Usage examples: Each of the algorithms above have 1 or more parameters that they support. These are detailed below. -### Algorithm: `snowballs` +#### Algorithm: `snowballs` Based on the algorithm detailed in [this blog post](https://jobtalle.com/simulating_hydraulic_erosion.html) ([direct link to the source code](https://github.com/jobtalle/HydraulicErosion/blob/master/js/archipelago/island/terrain/erosionHydraulic.js)), devised by [Job Talle](https://jobtalle.com/). Parameter | Type | Default Value | Description @@ -483,7 +447,7 @@ Usage examples: If you find any good combinations of these parameters, please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new) (or a PR!) and let me know! I'll include good combinations here, and possibly add a presets feature too. -### Algorithm: `river` +#### Algorithm: `river` Ever been annoyed by small 1 wide holes or thin pillars all over the place? This command is for you! Does not operate on the very edge of the defined region, because the algorithm can't see the neighbours of those columns. Parameter | Type | Default Value | Description @@ -502,7 +466,7 @@ Usage examples: ``` -## `//noise2d [ []] [ []] ...]` +### `//noise2d [ []] [ []] ...]` Applies 2D noise to the terrain in the defined region. Like `//erode`, this command accepts a number of different key-value parameters and provides a number of different underlying algorithms. Parameter | Type | Default Value | Description @@ -553,7 +517,107 @@ Example invocations: ``` -## `//count` + +## Flora + + + +### `//forest [] [] [] [ []] ...` +Plants and grows saplings to generate a forest. A density value is optionally taken, which controls the overall density of the forest that is generated. The `bonemeal` mod is required - just like for the [`//bonemeal`](#bonemeal-strength-chance) command. + +The density defaults to 1, acts like a multiplier, and is not affected by the chances of all saplings listed (e.g. you can have a sapling with a chance of 1-in-50, and the overall density of the forest will be unaffected). For example, 2 results in a forest twice as dense as the default, and 0.5 a forest half as dense as the default density. + +The tree types are provided as a list of names and 1-in-N chances, just like [`//overlay`](#overlay-node_name_a-chance_a-node_name_b-chance_b-node_name_n-chance_n-), `//mix`, `//layers`, etc. Unlike the aforementioned commands however, `//forest` has an additional layer of alias resolution to ease the process of determining what the name of the sapling is you want to use to generate forests with. See [`//saplingaliases`](#saplingaliases-aliasesall_saplings) for more details. + +Saplings are placed with [`//overlay`](#overlay-node_name_a-chance_a-node_name_b-chance_b-node_name_n-chance_n-) and grown using the same method that's used by the `//bonemeal` command. Up to 100 attempts are made to grow placed saplings. If all of those attempts fail (success is determined by whether the sapling is still present or not), the sapling is removed and the failure counter is incremented. + +Currently, the following mods are known to have aliases registered: + + - `default` + - [`moretrees`](https://content.minetest.net/packages/VanessaE/moretrees/) (warning: these saplings don't appear to work very well this command - assistance in debugging this would be very helpful) + - [`cool_trees`](https://content.minetest.net/packages/runs/cool_trees/) + +If you like, you can also reference the full name of a sapling node instead. The only requirements for saplings to be supported by this mod are: + +1. It can be bonemealed +2. It has the `sapling` group + +For example, the first 2 examples below are functionally equivalent. + +```weacmd +//forest aspen +//forest default:aspen_sapling +//forest 2 oak 3 aspen pine +//forest 0.5 acacia +``` + + +### `//saplingaliases [aliases|all_saplings]` +Lists all the currently registered sapling aliases in alphabetical order. These aliases can be used in the `//forest` subcommand. + +Optionally takes a single parameter, which is the operating mode. Current implemented operating modes: + +Mode | Description +----------------|---------------------- +`aliases` | The default. Lists all the currently registered sapling aliases in alphabetical order. +`all_saplings` | Spins through all the nodes currently registered in Minetest, and lists all the nodes that have the `sapling` group. + +```weacmd +//saplingaliases +//saplingaliases all_saplings +//saplingaliases aliases +``` + + + +### `//bonemeal [ [ [ [ ...]]]]` +Requires the [`bonemeal`](https://content.minetest.net/packages/TenPlus1/bonemeal/) ([repo](https://notabug.org/TenPlus1/bonemeal/)) mod (otherwise _WorldEditAdditions_ will not register this command and output a message to the server log). Alias: `//flora`. + +Bonemeals all eligible nodes in the current region. An eligible node is one that has an air node directly above it - note that just because a node is eligible doesn't mean to say that something will actually happen when the `bonemeal` mod bonemeals it. + +Optionally takes a strength value (that's passed to `bonemeal:on_use()`, the method in the `bonemeal` mod that is called to actually do the bonemealing). The strength value is a positive integer from 1 to 4 (i.e. 1, 2, 3, or 4) - the default is 1 (the lowest strength). + +I observe that a higher strength value gives a higher chance that something will actually grow. In the case of soil or sand nodes, I observe that it increases the area of effect of a single bonemeal action (thus at higher strengths generally you'll probably want a higher chance number - see below). See the [`bonemeal` mod README](https://notabug.org/TenPlus1/bonemeal) for more information. + +Also optionally takes a chance number. This is the chance that an eligible node will actually get bonemealed, and is a positive integer that defaults to 1. The chance number represents a 1-in-{number} chance to bonemeal any given eligible node, where {number} is the chance number. In other words, the higher the chance number the lower the chance that a node will be bonemealed. + +For example, a chance number of 2 would mean a 50% chance that any given eligible node will get bonemealed. A chance number of 16 would be a 6.25% chance, and a chance number of 25 would be 2%. + +Since WorldEditAdditions v1.12, a percentage chance is also supported. This is denoted by suffixing a number with a percent sign (e.g. `//bonemeal 1 25%`). + +Since WorldEditAdditions v1.13, a list of node names is also optionally supported. This will constrain bonemeal operations to be performed only on the node names listed. + + +```weacmd +//bonemeal +//bonemeal 3 25 +//bonemeal 4 +//bonemeal 1 10 +//bonemeal 2 15 +//bonemeal 2 10% +//bonemeal 2 10% dirt +//bonemeal 4 50 ethereal:grove_dirt +``` + + + +## Statistics + + + +### `//count` Counts all the nodes in the defined region and returns the result along with calculated percentages (note that if the chat window used a monospace font, the returned result would be a perfect table. If someone has a ~~hack~~ solution to make the columns line up neatly, please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new) :D) **Note:** The output of `//count` can be rather long sometimes, and Minetest by default only shows the last few lines of chat. Press F10 to show the full chat window that you can then scroll through to inspect the full output. @@ -563,7 +627,7 @@ Counts all the nodes in the defined region and returns the result along with cal ``` -## `//basename ` +### `//basename ` Returns the absolute canonical name of a node, given an alias or partial node name. For example: ```weacmd @@ -578,7 +642,235 @@ Returns the absolute canonical name of a node, given an alias or partial node na ``` -## `//subdivide ` + +## Selection + + + + + +### `//scol [ ] ` +Short for _select column_. Sets the pos2 at a set distance along 1 axis from pos1. If the axis isn't specified, defaults the direction you are facing. Implementation thanks to @VorTechnix. + +```weacmd +//scol 10 +//scol x 3 +``` + + +### `//srect [ []] ` +Short for _select rectangle_. Sets the pos2 at a set distance along 2 axes from pos1. If the axes aren't specified, defaults to positive y and the direction you are facing. Implementation thanks to @VorTechnix. + +```weacmd +//srect x z 10 +//srect 3 +//srect -z y 25 +``` + + +### `//scube [ [ []]] ` +Short for _select cube_. Sets the pos2 at a set distance along 3 axes from pos1. If the axes aren't specified, defaults to positive y, the direction you are facing and the axis to the left of facing. Implementation thanks to @VorTechnix. + +```weacmd +//scube 5 +//scube z a y 12 +//scube x z 3 +//scube -z 12 +``` + + +### `//scloud <0-6|stop|reset>` +Short for _select point cloud_. Sets pos1 and pos2 to include the nodes you punch. Numbers 1-6 designate how many nodes you want to punch before the operation ends. 0 or stop terminate the operation so that any further nodes you punch won't be added to selection. Reset terminates operation if one is running and resets the selection area. + +```weacmd +//scloud 6 +//scloud 5 +//scloud stop +``` + + +### `//scentre` +Short for _select center_. Sets pos1 and pos2 to the centre point(s) of the current selection area. 1, 2, 4 or 8 nodes may be selected depending on what parts of the original selection are even in distance. Implementation thanks to @VorTechnix. + +```weacmd +//scentre +``` + + +### `//srel [ [ ]]` +Short for _select relative_. Sets the pos2 at set distances along 3 axes relative to pos1. If pos1 is not set it will default to the node directly under the player. The axis arguments accept `x, y, z` as well as `up, down, left, right, front, back`. Left, right, front and back are relative to player facing direction. Negative (`-`) can be applied to the axis, the length or both. Implementation thanks to @VorTechnix. + +```weacmd +//srel front 5 +//srel y 12 right -2 +//srel left 3 up 5 -front 7 +//scube -z 12 -y -2 x -2 +``` + + +### `//smake [ []]` +Short for _selection make_. Modifies existing selection by moving pos2. Allows you to make the selection an odd or even length on one or more axes or set two or more axes equal to each other or the longest, shortest or average of them. Implementation thanks to @VorTechnix. + +Usage examples: + +```weacmd +//smake odd shrink +//smake even avg xz +//smake equal grow xy +//smake equal average +//smake equal zy x +``` + +#### ``: odd|even|equal + +Value | Description +--------|--------------- +`odd` | Round up or down, based on mode, all axes specified in `` to the nearest odd length relative to pos1 +`even` | Round up or down, based on mode, all axes specified in `` to the nearest even length relative to pos1 +`equal` | Set `` axes length equal to the length of `` axis if specified or to the length of the largest, smallest or average of the `` axes based on mode. + +#### ``: grow|shrink|average + +#### *If `` == odd or even:* + +Value | Description +----------------|-------------- +`grow` | Grow each axis specified in `` to the nearest odd/even number to itself +`shrink` | Shrink each axis specified in `` to the nearest odd/even number to itself +`average`/`avg` | Takes the average of all axes specified in `` and then for each specified axis grows or shrinks it, depending on whether it is less than or greater than the average, to the nearest odd/even number to itself + +#### *If `` == equal:* +The `` argument can be omitted and will not be parsed if present if `` is specified + +Value | Description +----------------|--------------- +`grow` | Grow each axis specified in `` to the length of the longest specified axis +`shrink` | Shrink each axis specified in `` to the length of the shortest specified axis +`average`/`avg` | Set each axis specified in `` to the average length of all the specified axes +If `` | `` becomes optional. If present it will be ignored. + +#### Additional arguments: + +Name | Description +------------|------------------ +`` | Specify axes to perform operation on (default= xz)| +``: If `` == odd or even | Does nothing +``: If `` == equal | Overrides `` and sets all `` axes equal to itself + +### `//sfactor []` +Short for _selection factor_; alias: `//sfac`. Built specifically for use with `//maze`, this command sets targeted axes equal to the nearest multiple of `` based on the ``. + +Usage examples: + +```weacmd +//sfac grow 5 +//sfac avg 3 xy +``` + +#### ``: grow|shrink|average + +Value | Description +--------|-------------- +`grow` | Rounds the length of each target axis up to the nearest multiple of `` +`shrink` | Rounds the length of each target axis down to the nearest multiple of `` +`average`/`avg` | Takes the average of all axes specified in `` and then for each specified axis grows or shrinks it, depending on whether it is less than or greater than the average, to the nearest multiple of `` + +### `//sstack` +Displays the contents of your per-user selection stack. This stack can be pushed to and popped from rather like a stack of plates. See also `//spush` (for pushing to the selection stack) and `//spop` (for popping from the selection stack). + +```weacmd +//sstack +``` + +### `//spush` +Pushes the currently defined region onto your per-user selection stack. Does not otherwise alter the defined region. + +If the stack is full (currently the limit is set to 100 regions in the stack), then it will complain at you but otherwise will have no effect. + +Note that pos2 does _not_ need to be defined in order to use this. if it isn't defined, then a pos2 of `nil` will be pushed onto the stack instead. + +```weacmd +//spush +``` + +### `//spop` +Pops a selection off your per-user selection stack and applies it to the currently defined region. If pos2 from the item popped from the stack is nil, then pos2 is explicitly unset. If the stack is empty, this has no effect. + +```weacmd +//spop +``` + + + +## Measurement + + + +### `//mcount` +Alias for [`//count`](#count). + +``` +//mcount +``` + + +### `//mface` +Returns the horizontal (X/Z) axis or axes the player is looking along. +Aliases: `//mfacing`. + +``` +//mface +``` + + +### `//midpos` +Returns the coordinates of the centre of the current selection. + +``` +//midpos +``` + + +### `//msize` +Returns the lengths of the current selection on the X, Y and Z axes. + +``` +//msize +``` + + +### `//mtrig` +Returns the length of the diagonal from pos1 to pos2 and its angle on the XZ (horizontal) and Y (vertical) axes. + +``` +//mtrig +``` + + + +## Meta + + + +### `//subdivide ` Splits the current WorldEdit region into `(, , )` sized chunks, and run `// ` over each chunk. Sometimes, we want to run a single command on a truly vast area. Usually, this results in running out of memory. If this was you, then this command is just what you need! It should be able to handle any sized region - the only limit is your patience for command to complete..... @@ -597,7 +889,7 @@ While other server commands can be executed while a `//subdivide` is running, `/ ``` -## `//multi .....` +### `//multi .....` Executes multi chat commands in sequence. Intended for _WorldEdit_ commands, but does work with others too. Don't forget a space between commands! ```weacmd @@ -621,7 +913,7 @@ In addition, this also allows for including a double forward slash in the argume ``` -## `//many ` +### `//many ` Executes a single chat command many times in a row. Uses `minetest.after()` to yield to the main server thread to allow other things to happen at the same time, so technically you could have multiple `//many` calls going at once (but multithreading support is out of reach, so only a single one will be executing at the same time). Note that this isn't necessarily limited to executing WorldEdit / WorldEditAdditions commands. Combine with `//multi` (see above) execute multiple commands at once for even more power and flexibility! @@ -632,7 +924,7 @@ Note that this isn't necessarily limited to executing WorldEdit / WorldEditAddit ``` -## `//ellipsoidapply ` +### `//ellipsoidapply ` Executes the given command, and then clips the result to the largest ellipsoid that will fit inside the defined region. The specified command must obviously take 2 positions - so for example `//set`, `//replacemix`, and `//maze3d` will work, but `//sphere`, `//torus`, and `//floodfill` won't. For advanced users, `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they will not be affected by the ellipsoidal clipping operation. @@ -646,7 +938,7 @@ For advanced users, `//multi` is also supported - but make sure your modificatio ``` -## `//airapply ` +### `//airapply ` Like [`//ellipsoidapply`](#ellipsoidapply), but instead only keeps changes that replace airlike nodes, and discards any other changes made. As with `//ellipsoidapply` for advanced users `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they be kept regardless, as `//airapply` only applies the masking to the nodes in the defined region. @@ -657,7 +949,7 @@ As with `//ellipsoidapply` for advanced users `//multi` is also supported - but ``` -## `//noiseapply2d ` +### `//noiseapply2d ` Like [`//ellipsoidapply`](#ellipsoidapply), but instead only keeps changes where a noise function (defaults to `perlinmt`, see [`//noise2d`](#noise2d)) returns a value greater than a given threshold value. Also takes a scale value that controls the scale of the noise - -higher values result in smaller "blobs". If you're operating on small areas, then a value of at least 10 is advised as "blobs" are by default on the scale of ~50 nodes. @@ -672,194 +964,18 @@ Any suggestions on how to provide more customisability without making this comm ``` -## `//scol [ ] ` -Short for _select column_. Sets the pos2 at a set distance along 1 axis from pos1. If the axis isn't specified, defaults the direction you are facing. Implementation thanks to @VorTechnix. -```weacmd -//scol 10 -//scol x 3 -``` +## Extras + -## `//srect [ []] ` -Short for _select rectangle_. Sets the pos2 at a set distance along 2 axes from pos1. If the axes aren't specified, defaults to positive y and the direction you are facing. Implementation thanks to @VorTechnix. - -```weacmd -//srect x z 10 -//srect 3 -//srect -z y 25 -``` - - -## `//scube [ [ []]] ` -Short for _select cube_. Sets the pos2 at a set distance along 3 axes from pos1. If the axes aren't specified, defaults to positive y, the direction you are facing and the axis to the left of facing. Implementation thanks to @VorTechnix. - -```weacmd -//scube 5 -//scube z a y 12 -//scube x z 3 -//scube -z 12 -``` - - -## `//scloud <0-6|stop|reset>` -Short for _select point cloud_. Sets pos1 and pos2 to include the nodes you punch. Numbers 1-6 designate how many nodes you want to punch before the operation ends. 0 or stop terminate the operation so that any further nodes you punch won't be added to selection. Reset terminates operation if one is running and resets the selection area. - -```weacmd -//scloud 6 -//scloud 5 -//scloud stop -``` - - -## `//scentre` -Short for _select center_. Sets pos1 and pos2 to the centre point(s) of the current selection area. 1, 2, 4 or 8 nodes may be selected depending on what parts of the original selection are even in distance. Implementation thanks to @VorTechnix. - -```weacmd -//scentre -``` - - -## `//srel [ [ ]]` -Short for _select relative_. Sets the pos2 at set distances along 3 axes relative to pos1. If pos1 is not set it will default to the node directly under the player. The axis arguments accept `x, y, z` as well as `up, down, left, right, front, back`. Left, right, front and back are relative to player facing direction. Negative (`-`) can be applied to the axis, the length or both. Implementation thanks to @VorTechnix. - -```weacmd -//srel front 5 -//srel y 12 right -2 -//srel left 3 up 5 -front 7 -//scube -z 12 -y -2 x -2 -``` - - -## `//smake [ []]` -Short for _selection make_. Modifies existing selection by moving pos2. Allows you to make the selection an odd or even length on one or more axes or set two or more axes equal to each other or the longest, shortest or average of them. Implementation thanks to @VorTechnix. - -Usage examples: - -```weacmd -//smake odd shrink -//smake even avg xz -//smake equal grow xy -//smake equal average -//smake equal zy x -``` - -### ``: odd|even|equal - -Value | Description ---------|--------------- -`odd` | Round up or down, based on mode, all axes specified in `` to the nearest odd length relative to pos1 -`even` | Round up or down, based on mode, all axes specified in `` to the nearest even length relative to pos1 -`equal` | Set `` axes length equal to the length of `` axis if specified or to the length of the largest, smallest or average of the `` axes based on mode. - -### ``: grow|shrink|average - -#### *If `` == odd or even:* - -Value | Description -----------------|-------------- -`grow` | Grow each axis specified in `` to the nearest odd/even number to itself -`shrink` | Shrink each axis specified in `` to the nearest odd/even number to itself -`average`/`avg` | Takes the average of all axes specified in `` and then for each specified axis grows or shrinks it, depending on whether it is less than or greater than the average, to the nearest odd/even number to itself - -#### *If `` == equal:* -The `` argument can be omitted and will not be parsed if present if `` is specified - -Value | Description -----------------|--------------- -`grow` | Grow each axis specified in `` to the length of the longest specified axis -`shrink` | Shrink each axis specified in `` to the length of the shortest specified axis -`average`/`avg` | Set each axis specified in `` to the average length of all the specified axes -If `` | `` becomes optional. If present it will be ignored. - -### Additional arguments: - -Name | Description -------------|------------------ -`` | Specify axes to perform operation on (default= xz)| -``: If `` == odd or even | Does nothing -``: If `` == equal | Overrides `` and sets all `` axes equal to itself - -## `//sfactor []` -Short for _selection factor_; alias: `//sfac`. Built specifically for use with `//maze`, this command sets targeted axes equal to the nearest multiple of `` based on the ``. - -Usage examples: - -```weacmd -//sfac grow 5 -//sfac avg 3 xy -``` - -### ``: grow|shrink|average - -Value | Description ---------|-------------- -`grow` | Rounds the length of each target axis up to the nearest multiple of `` -`shrink` | Rounds the length of each target axis down to the nearest multiple of `` -`average`/`avg` | Takes the average of all axes specified in `` and then for each specified axis grows or shrinks it, depending on whether it is less than or greater than the average, to the nearest multiple of `` - -## `//sstack` -Displays the contents of your per-user selection stack. This stack can be pushed to and popped from rather like a stack of plates. See also `//spush` (for pushing to the selection stack) and `//spop` (for popping from the selection stack). - -```weacmd -//sstack -``` - -## `//spush` -Pushes the currently defined region onto your per-user selection stack. Does not otherwise alter the defined region. - -If the stack is full (currently the limit is set to 100 regions in the stack), then it will complain at you but otherwise will have no effect. - -Note that pos2 does _not_ need to be defined in order to use this. if it isn't defined, then a pos2 of `nil` will be pushed onto the stack instead. - -```weacmd -//spush -``` - -## `//spop` -Pops a selection off your per-user selection stack and applies it to the currently defined region. If pos2 from the item popped from the stack is nil, then pos2 is explicitly unset. If the stack is empty, this has no effect. - -```weacmd -//spop -``` - -## `//mcount` -Alias for [`//count`](#count). - -``` -//mcount -``` - -## `//mface` -Returns the horizontal (X/Z) axis or axes the player is looking along. -Aliases: `//mfacing`. - -``` -//mface -``` - -## `//midpos` -Returns the coordinates of the centre of the current selection. - -``` -//midpos -``` - -## `//msize` -Returns the lengths of the current selection on the X, Y and Z axes. - -``` -//msize -``` - -## `//mtrig` -Returns the length of the diagonal from pos1 to pos2 and its angle on the XZ (horizontal) and Y (vertical) axes. - -``` -//mtrig -``` - -## `//y` +### `//y` Confirms the execution of a command if it could potentially affect a large number of nodes and take a while. This is a regular WorldEdit command. @@ -868,7 +984,8 @@ Confirms the execution of a command if it could potentially affect a large numbe //y ``` -## `//n` + +### `//n` Prevents the execution of a command if it could potentially affect a large number of nodes and take a while. This is a regular WorldEdit command. @@ -878,12 +995,22 @@ Prevents the execution of a command if it could potentially affect a large numbe ``` -## Far Wand + +## Tools + + +### Far Wand The far wand (`worldeditadditions:farwand`) is a variant on the traditional WorldEdit wand (`worldedit:wand`). It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/master/worldeditadditions_farwand/textures/worldeditadditions_farwand.png) It functions very similarly to the regular WorldEdit wand, except that it has a _much_ longer range - which can be very useful for working on large-scale terrain for example. It also comes with an associated command to control it. -## `//farwand skip_liquid (true|false) | maxdist ` +### `//farwand skip_liquid (true|false) | maxdist ` This command helps control the behaviour of the [WorldEditAdditions far wand](#far-wand) and [cloud wand](#cloud-wand). Calling it without any arguments shows the current status: ```weacmd @@ -907,7 +1034,7 @@ You can change the maximum range with the `maxdist` subcommand: Note that the number there isn't in blocks (because hard maths). It is however proportional to the distance the wand will raycast looks for nodes, so a higher value will result in it raycasting further. -## Cloud Wand +### Cloud Wand The cloud wand (`worldeditadditions:cloudwand`) is a another variant the above _Far Wand_. It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/master/worldeditadditions_farwand/textures/worldeditadditions_cloudwand.png) Unlike the other 2 wands, this wand functions in an additive manner. Left-click on a node to expand the currently defined region (creating a new one if one isn't defined already) to include that node. Right click to clear the currently defined region. diff --git a/README.md b/README.md index 4e1350b..670ef3a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ The detailed explanations have moved! Check them out [here](https://github.com/s ### Statistics - [`//count`](https://worldeditadditions.mooncarrot.space/Reference/#count) + - [`//basename `](https://worldeditadditions.mooncarrot.space/Reference/#basename) ### Selection - [`//scol [ ] `](https://worldeditadditions.mooncarrot.space/Reference/#scol) From c8773efe22af7a6acb31712445c35a75c48b8b56 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 5 Oct 2021 02:02:53 +0100 Subject: [PATCH 11/13] Docs: Upgrade reference to support categorical display It even persists your preference using localStorage! --- .docs/Reference.11tydata.js | 29 ++++--- .docs/Reference.html | 114 +++++++++++++++++++++++--- .docs/css/theme.css | 28 ++++++- .docs/lib/parse_sections.js | 51 ++++++++++-- .docs/package-lock.json | 156 ++++++++++++++++++++++++++++++++++++ .docs/package.json | 1 + 6 files changed, 348 insertions(+), 31 deletions(-) diff --git a/.docs/Reference.11tydata.js b/.docs/Reference.11tydata.js index a93e951..1bcba38 100644 --- a/.docs/Reference.11tydata.js +++ b/.docs/Reference.11tydata.js @@ -2,23 +2,30 @@ const fs = require("fs"); const path = require("path"); const parse_sections = require("./lib/parse_sections.js"); -const sections = parse_sections(fs.readFileSync( - path.resolve( - __dirname, - `../Chat-Command-Reference.md` - ), - "utf-8" -)); +let { sections, categories } = parse_sections(fs.readFileSync( + path.resolve( + __dirname, + `../Chat-Command-Reference.md` + ), + "utf-8" + )) -console.log(`REFERENCE SECTION TITLES`, sections.slice(1) - .sort((a, b) => a.title.localeCompare(b.title)).map(s => s.title)); +sections = sections.slice(1).sort((a, b) => a.title.replace(/^\/+/g, "").localeCompare( + b.title.replace(/^\/+/g, ""))); + +console.log(`REFERENCE SECTION TITLES`) +console.log(sections + .map(s => [s.category, s.title].join(`\t`)).join(`\n`)); +console.log(`************************`); + +console.log(`REFERENCE SECTION COLOURS`, categories); module.exports = { layout: "theme.njk", title: "Reference", tags: "navigable", date: "2001-01-01", section_intro: sections[0], - sections_help: sections.slice(1) - .sort((a, b) => a.title.localeCompare(b.title)) + sections_help: sections, // Remove the very beginning bit + categories: [...categories.keys()].join("|") } diff --git a/.docs/Reference.html b/.docs/Reference.html index 2c7494c..4394a52 100644 --- a/.docs/Reference.html +++ b/.docs/Reference.html @@ -26,16 +26,23 @@

    🔗 - Contents + Contents

    -

    TODO: Group commands here by category (*especially* the meta commands)

    - +
    + + +
    + +
    +

    Alphabetical

    + +
    {% for section in sections_help %} -
    +

    🔗 - {{ section.title }} + {{ section.title }} + {{ section.category }}

    {{ section.content }} diff --git a/.docs/css/theme.css b/.docs/css/theme.css index 7868e09..22658f3 100644 --- a/.docs/css/theme.css +++ b/.docs/css/theme.css @@ -78,10 +78,18 @@ h1, h2, h3, h4, h5, h6 { .linked-section-heading > a.section-link:hover { opacity: 1; } -.linked-section-heading > span { +.linked-section-heading > span.title { flex: 1; word-wrap: anywhere; } +.linked-section-heading > span.category { + font-size: 0.75em; + border-radius: 1em; + background: var(--cat-colour); + padding: 0 0.5em; + line-height: 1.5; + align-self: flex-start; +} nav { background: var(--bg-bright); @@ -353,6 +361,17 @@ footer { background: var(--pattern-hex), var(--bg-transcluscent); } +.command-ordering-tabs { + display: flex; + gap: 1em; + margin-bottom: 2em; +} +.command-ordering-tabs button { + flex: 1; + font-size: 1.1em; + padding: 0.5em; +} +.command-ordering-tabs button.active { font-weight: bold; } .command-list { margin: 0; @@ -363,11 +382,16 @@ footer { .command-list > li > a { text-decoration: none; } +.command-list.coloured code { background: var(--cat-colour); } .command-list code { display: block; padding: 0.5em; box-sizing: border-box; - margin: 0.5em; + margin: 0.5em 0; +} + +.filterable { + border: 0.2em solid var(--cat-colour); } diff --git a/.docs/lib/parse_sections.js b/.docs/lib/parse_sections.js index 1de2589..1c82213 100644 --- a/.docs/lib/parse_sections.js +++ b/.docs/lib/parse_sections.js @@ -1,7 +1,11 @@ +const crypto = require("crypto"); + const htmlentities = require("html-entities"); const markdown = require("markdown-it")({ xhtmlOut: true }); +const chroma = require("chroma-js"); + const markdown_prism = require("markdown-it-prism"); markdown.use(markdown_prism, { @@ -16,9 +20,19 @@ markdown.use(markdown_prism, { } }); -function make_section(acc) { - let title = acc[0].match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, ""); +function extract_title(line) { + return line.match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, "") +} + +function make_section(acc, cat_current, cats) { + let title = extract_title(acc[0]); return { + category: cat_current, + category_colour: cats.get(cat_current), + category_colour_dark: chroma(cats.get(cat_current)) + .set("hsl.s", 0.8) + .set("hsl.l", "*0.6") + .css("hsl"), title: htmlentities.encode(title), slug: title.toLowerCase().replace(/[^a-z0-9-_\s]+/gi, "") .replace(/\s+/g, "-") @@ -28,13 +42,36 @@ function make_section(acc) { } module.exports = function parse_sections(source) { + const cats = new Map(); + source.match(/^##\s+.*$/gm) + .map(extract_title) + .map((item, i, all) => cats.set( + item, + chroma(`hsl(${i/all.length*(360-360/all.length)}, 60%, 90%)`).css("hsl") + )); const lines = source.split(/\r?\n/gi); const result = []; let acc = []; + let cat_current = null; for(let line of lines) { - if(line.startsWith(`#`) && !line.startsWith(`###`)) { - if(acc.length > 0) - result.push(make_section(acc)); + + if(line.startsWith(`#`)) { + + // 1: Deal with the previous section + if(acc.length > 0) { + let heading_level_prev = acc[0].match(/^#+/)[0].length; + if(heading_level_prev === 3 && acc.length > 0) { + result.push(make_section(acc, cat_current, cats)); + } + + } + + // 2: Deal with the new line + let heading_level = line.match(/^#+/)[0].length + + if(heading_level === 2) + cat_current = extract_title(line); + acc = [ line ]; } else @@ -42,7 +79,7 @@ module.exports = function parse_sections(source) { } if(acc.length > 0) - result.push(make_section(acc)); + result.push(make_section(acc, cat_current, cats)); - return result; + return { sections: result, categories: cats }; } diff --git a/.docs/package-lock.json b/.docs/package-lock.json index 7e54602..b06e3b4 100644 --- a/.docs/package-lock.json +++ b/.docs/package-lock.json @@ -14,6 +14,7 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-img": "^0.10.0", + "chroma-js": "^2.1.2", "markdown-it-prism": "^2.2.1", "phin": "^3.6.0" } @@ -729,6 +730,15 @@ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, + "node_modules/chroma-js": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.1.2.tgz", + "integrity": "sha512-ri/ouYDWuxfus3UcaMxC1Tfp3IE9K5iQzxc2hSxbBRVNQFut1UuGAsZmiAf2mOUubzGJwgMSv9lHg+XqLaz1QQ==", + "dev": true, + "dependencies": { + "cross-env": "^6.0.3" + } + }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -926,6 +936,36 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "node_modules/cross-env": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz", + "integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/date-time": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz", @@ -2180,6 +2220,12 @@ "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", "dev": true }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "node_modules/javascript-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz", @@ -2959,6 +3005,15 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -3821,6 +3876,27 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/short-hash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/short-hash/-/short-hash-1.0.0.tgz", @@ -4434,6 +4510,21 @@ "node": ">=0.10.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -5180,6 +5271,15 @@ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, + "chroma-js": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.1.2.tgz", + "integrity": "sha512-ri/ouYDWuxfus3UcaMxC1Tfp3IE9K5iQzxc2hSxbBRVNQFut1UuGAsZmiAf2mOUubzGJwgMSv9lHg+XqLaz1QQ==", + "dev": true, + "requires": { + "cross-env": "^6.0.3" + } + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -5357,6 +5457,26 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "cross-env": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz", + "integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "date-time": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz", @@ -6335,6 +6455,12 @@ "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "javascript-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz", @@ -6930,6 +7056,12 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -7656,6 +7788,21 @@ "tunnel-agent": "^0.6.0" } }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, "short-hash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/short-hash/-/short-hash-1.0.0.tgz", @@ -8149,6 +8296,15 @@ "integrity": "sha1-YU9/v42AHwu18GYfWy9XhXUOTwk=", "dev": true }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", diff --git a/.docs/package.json b/.docs/package.json index c235790..fff70e1 100644 --- a/.docs/package.json +++ b/.docs/package.json @@ -22,6 +22,7 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-img": "^0.10.0", + "chroma-js": "^2.1.2", "markdown-it-prism": "^2.2.1", "phin": "^3.6.0" }, From de60c94c400645e0ee689c247d10daf78b98eec0 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 5 Oct 2021 02:38:12 +0100 Subject: [PATCH 12/13] docs bugfix: alow filtering command list on category names --- .docs/Reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docs/Reference.html b/.docs/Reference.html index 4394a52..2b53f45 100644 --- a/.docs/Reference.html +++ b/.docs/Reference.html @@ -151,7 +151,7 @@ switch(mode_this) { case "all": show = search_text(query, - el_next.textContent + el_next.textContent + ` ` + el_next.dataset.category ); break; case "header": From 8044a9059cf5e738b1d94ddc138788a003d44bd8 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 10 Oct 2021 20:34:36 +0100 Subject: [PATCH 13/13] docs: fix title of reference --- .docs/Reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docs/Reference.html b/.docs/Reference.html index 2b53f45..bf10399 100644 --- a/.docs/Reference.html +++ b/.docs/Reference.html @@ -1,6 +1,6 @@
    -

    {{ section_intro.title }}

    +

    Reference

    This is the full chat command reference for WorldEditAdditions. It has 2 parts: