diff --git a/README.ko.md b/README.ko.md index fd39ffe1f0c4..dc5a4f0cd056 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,7 +1,7 @@ # 카타클리즘: 밝은 밤
- + [![en][icon-en]][en] [![ko][icon-ko]][ko] @@ -107,9 +107,9 @@ | 1. 옵션 (ESC) -> 디버그 메뉴 (a) | 2. 정보 (i) | | :------------------------------: | :--------------------------: | -| ![](doc/img/readme-bug1.png) | ![](doc/img/readme-bug2.png) | +| ![](doc/src/content/docs/en/contributing/img/readme-bug1.png) | ![](doc/src/content/docs/en/contributing/img/readme-bug2.png) | | 3. 버그 리포트 제출 (U) | 4. 이슈 링크가 생성됩니다 | -| ![](doc/img/readme-bug3.png) | ![](doc/img/readme-bug4.png) | +| ![](doc/src/content/docs/en/contributing/img/readme-bug3.png) | ![](doc/src/content/docs/en/contributing/img/readme-bug4.png) | `버전 및 환경 설정(Version and configuration)` 항목이 채워진 이슈가 브라우저에서 열립니다. diff --git a/README.md b/README.md index e03b4a2754b5..0536e81668c8 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,10 @@ # Cataclysm: Bright Nights
- - -[![en][icon-en]][en] [![ko][icon-ko]][ko] +
-[en]: ./README.md -[icon-en]: https://img.shields.io/badge/lang-en-red?style=flat-square -[ko]: ./README.ko.md -[icon-ko]: https://img.shields.io/badge/lang-ko-orange?style=flat-square - Cataclysm: Bright Nights is a roguelike with sci-fi elements set in a post-apocalyptic world. While some have described it as a "zombie game", there is far more to Cataclysm than that. Struggle @@ -109,9 +102,9 @@ Run `Submit a bug report on github` inside the game to submit an issue. | 1. open Options (ESC) -> Debug Menu (a) | 2. open Info (i) | | :-------------------------------------: | :------------------------------: | -| ![](doc/img/readme-bug1.png) | ![](doc/img/readme-bug2.png) | +| ![](doc/src/content/docs/en/contributing/img/readme-bug1.png) | ![](doc/src/content/docs/en/contributing/img/readme-bug2.png) | | 3. Submit a bug report on github (U) | 4. An link to issue is generated | -| ![](doc/img/readme-bug3.png) | ![](doc/img/readme-bug4.png) | +| ![](doc/src/content/docs/en/contributing/img/readme-bug3.png) | ![](doc/src/content/docs/en/contributing/img/readme-bug4.png) | It will open a bug report on browser with `Version and configuration` filled in. diff --git a/deno.lock b/deno.lock index 0d4e19d722f5..44bab227cdb6 100644 --- a/deno.lock +++ b/deno.lock @@ -1,6 +1,95 @@ { "version": "2", "remote": { - "https://deno.land/std@0.201.0/collections/chunk.ts": "f82c52a82ad9338018570c42f6de0fb132fcb14914c31a444e360ac104d7b55b" + "https://deno.land/std@0.201.0/assert/_constants.ts": "8a9da298c26750b28b326b297316cdde860bc237533b07e1337c021379e6b2a9", + "https://deno.land/std@0.201.0/assert/_diff.ts": "1a3c044aedf77647d6cac86b798c6417603361b66b54c53331b312caeb447aea", + "https://deno.land/std@0.201.0/assert/_format.ts": "a69126e8a469009adf4cf2a50af889aca364c349797e63174884a52ff75cf4c7", + "https://deno.land/std@0.201.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", + "https://deno.land/std@0.201.0/assert/assert_equals.ts": "d8ec8a22447fbaf2fc9d7c3ed2e66790fdb74beae3e482855d75782218d68227", + "https://deno.land/std@0.201.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", + "https://deno.land/std@0.201.0/assert/equal.ts": "9f1a46d5993966d2596c44e5858eec821859b45f783a5ee2f7a695dfc12d8ece", + "https://deno.land/std@0.201.0/fmt/colors.ts": "87544aa2bc91087bb37f9c077970c85bfb041b48e4c37356129d7b450a415b6f", + "https://deno.land/std@0.201.0/front_matter/mod.ts": "f4a40ed1d5c41af2e664a661879c9dc0c9ca49199f6406da8b62c0aa2a2fb640", + "https://deno.land/std@0.201.0/front_matter/yaml.ts": "a681fbff79b9641379b1ceda27308b6e83ca5d26a1bcfe669cd1289fc3692ac7", + "https://deno.land/std@0.201.0/fs/_util.ts": "fbf57dcdc9f7bc8128d60301eece608246971a7836a3bb1e78da75314f08b978", + "https://deno.land/std@0.201.0/fs/walk.ts": "a16146724a6aaf9efdb92023a74e9805195c3469900744ce5de4113b07b29779", + "https://deno.land/std@0.201.0/path/_basename.ts": "057d420c9049821f983f784fd87fa73ac471901fb628920b67972b0f44319343", + "https://deno.land/std@0.201.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", + "https://deno.land/std@0.201.0/path/_dirname.ts": "355e297236b2218600aee7a5301b937204c62e12da9db4b0b044993d9e658395", + "https://deno.land/std@0.201.0/path/_extname.ts": "eaaa5aae1acf1f03254d681bd6a8ce42a9cb5b7ff2213a9d4740e8ab31283664", + "https://deno.land/std@0.201.0/path/_format.ts": "4a99270d6810f082e614309164fad75d6f1a483b68eed97c830a506cc589f8b4", + "https://deno.land/std@0.201.0/path/_from_file_url.ts": "6eadfae2e6f63ad9ee46b26db4a1b16583055c0392acedfb50ed2fc694b6f581", + "https://deno.land/std@0.201.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", + "https://deno.land/std@0.201.0/path/_is_absolute.ts": "05dac10b5e93c63198b92e3687baa2be178df5321c527dc555266c0f4f51558c", + "https://deno.land/std@0.201.0/path/_join.ts": "815f5e85b042285175b1492dd5781240ce126c23bd97bad6b8211fe7129c538e", + "https://deno.land/std@0.201.0/path/_normalize.ts": "a19ec8706b2707f9dd974662a5cd89fad438e62ab1857e08b314a8eb49a34d81", + "https://deno.land/std@0.201.0/path/_os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3", + "https://deno.land/std@0.201.0/path/_parse.ts": "0f9b0ff43682dd9964eb1c4398610c4e165d8db9d3ac9d594220217adf480cfa", + "https://deno.land/std@0.201.0/path/_relative.ts": "27bdeffb5311a47d85be26d37ad1969979359f7636c5cd9fcf05dcd0d5099dc5", + "https://deno.land/std@0.201.0/path/_resolve.ts": "7a3616f1093735ed327e758313b79c3c04ea921808ca5f19ddf240cb68d0adf6", + "https://deno.land/std@0.201.0/path/_to_file_url.ts": "a141e4a525303e1a3a0c0571fd024552b5f3553a2af7d75d1ff3a503dcbb66d8", + "https://deno.land/std@0.201.0/path/_to_namespaced_path.ts": "0d5f4caa2ed98ef7a8786286df6af804b50e38859ae897b5b5b4c8c5930a75c8", + "https://deno.land/std@0.201.0/path/_util.ts": "4e191b1bac6b3bf0c31aab42e5ca2e01a86ab5a0d2e08b75acf8585047a86221", + "https://deno.land/std@0.201.0/path/basename.ts": "bdfa5a624c6a45564dc6758ef2077f2822978a6dbe77b0a3514f7d1f81362930", + "https://deno.land/std@0.201.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000", + "https://deno.land/std@0.201.0/path/dirname.ts": "b6533f4ee4174a526dec50c279534df5345836dfdc15318400b08c62a62a39dd", + "https://deno.land/std@0.201.0/path/extname.ts": "62c4b376300795342fe1e4746c0de518b4dc9c4b0b4617bfee62a2973a9555cf", + "https://deno.land/std@0.201.0/path/format.ts": "110270b238514dd68455a4c54956215a1aff7e37e22e4427b7771cefe1920aa5", + "https://deno.land/std@0.201.0/path/from_file_url.ts": "9f5cb58d58be14c775ec2e57fc70029ac8b17ed3bd7fe93e475b07280adde0ac", + "https://deno.land/std@0.201.0/path/glob.ts": "593e2c3573883225c25c5a21aaa8e9382a696b8e175ea20a3b6a1471ad17aaed", + "https://deno.land/std@0.201.0/path/is_absolute.ts": "0b92eb35a0a8780e9f16f16bb23655b67dace6a8e0d92d42039e518ee38103c1", + "https://deno.land/std@0.201.0/path/join.ts": "31c5419f23d91655b08ec7aec403f4e4cd1a63d39e28f6e42642ea207c2734f8", + "https://deno.land/std@0.201.0/path/mod.ts": "6e1efb0b13121463aedb53ea51dabf5639a3172ab58c89900bbb72b486872532", + "https://deno.land/std@0.201.0/path/normalize.ts": "6ea523e0040979dd7ae2f1be5bf2083941881a252554c0f32566a18b03021955", + "https://deno.land/std@0.201.0/path/parse.ts": "be8de342bb9e1924d78dc4d93c45215c152db7bf738ec32475560424b119b394", + "https://deno.land/std@0.201.0/path/posix.ts": "0a1c1952d132323a88736d03e92bd236f3ed5f9f079e5823fae07c8d978ee61b", + "https://deno.land/std@0.201.0/path/relative.ts": "8bedac226afd360afc45d451a6c29fabceaf32978526bcb38e0c852661f66c61", + "https://deno.land/std@0.201.0/path/resolve.ts": "133161e4949fc97f9ca67988d51376b0f5eef8968a6372325ab84d39d30b80dc", + "https://deno.land/std@0.201.0/path/separator.ts": "40a3e9a4ad10bef23bc2cd6c610291b6c502a06237c2c4cd034a15ca78dedc1f", + "https://deno.land/std@0.201.0/path/to_file_url.ts": "00e6322373dd51ad109956b775e4e72e5f9fa68ce2c6b04e4af2a6eed3825d31", + "https://deno.land/std@0.201.0/path/to_namespaced_path.ts": "1b1db3055c343ab389901adfbda34e82b7386bcd1c744d54f9c1496ee0fd0c3d", + "https://deno.land/std@0.201.0/path/win32.ts": "8b3f80ef7a462511d5e8020ff490edcaa0a0d118f1b1e9da50e2916bdd73f9dd", + "https://deno.land/std@0.201.0/yaml/_error.ts": "b59e2c76ce5a47b1b9fa0ff9f96c1dd92ea1e1b17ce4347ece5944a95c3c1a84", + "https://deno.land/std@0.201.0/yaml/_loader/loader.ts": "63ec7f0a265dbbabc54b25a4beefff7650e205160a2d75c7d8f8363b5f84851a", + "https://deno.land/std@0.201.0/yaml/_loader/loader_state.ts": "0841870b467169269d7c2dfa75cd288c319bc06f65edd9e42c29e5fced91c7a4", + "https://deno.land/std@0.201.0/yaml/_mark.ts": "dcd8585dee585e024475e9f3fe27d29740670fb64ebb970388094cad0fc11d5d", + "https://deno.land/std@0.201.0/yaml/_state.ts": "ef03d55ec235d48dcfbecc0ab3ade90bfae69a61094846e08003421c2cf5cfc6", + "https://deno.land/std@0.201.0/yaml/_type/binary.ts": "24d49614463a7339a8a16d894919c2ec18a10588ae360ec352093b60e2cc8b0d", + "https://deno.land/std@0.201.0/yaml/_type/bool.ts": "5bfa75da84343d45347b521ba4e5aeace9fe6f53447405290d53315a3fc20e66", + "https://deno.land/std@0.201.0/yaml/_type/float.ts": "056bd3cb9c5586238b20517511014fb24b0e36f98f9f6073e12da308b6b9808a", + "https://deno.land/std@0.201.0/yaml/_type/function.ts": "ff574fe84a750695302864e1c31b93f12d14ada4bde79a5f93197fc33ad17471", + "https://deno.land/std@0.201.0/yaml/_type/int.ts": "563ad074f0fa7aecf6b6c3d84135bcc95a8269dcc15de878de20ce868fd773fa", + "https://deno.land/std@0.201.0/yaml/_type/map.ts": "7b105e4ab03a361c61e7e335a0baf4d40f06460b13920e5af3fb2783a1464000", + "https://deno.land/std@0.201.0/yaml/_type/merge.ts": "8192bf3e4d637f32567917f48bb276043da9cf729cf594e5ec191f7cd229337e", + "https://deno.land/std@0.201.0/yaml/_type/mod.ts": "060e2b3d38725094b77ea3a3f05fc7e671fced8e67ca18e525be98c4aa8f4bbb", + "https://deno.land/std@0.201.0/yaml/_type/nil.ts": "606e8f0c44d73117c81abec822f89ef81e40f712258c74f186baa1af659b8887", + "https://deno.land/std@0.201.0/yaml/_type/omap.ts": "cfe59a294726f5cea705c39a61fd2b08199cf48f4ccd6b040cb550ec0f38d0a1", + "https://deno.land/std@0.201.0/yaml/_type/pairs.ts": "0032fdfe57558d21696a4f8cf5b5cfd1f698743177080affc18629685c905666", + "https://deno.land/std@0.201.0/yaml/_type/regexp.ts": "1ce118de15b2da43b4bd8e4395f42d448b731acf3bdaf7c888f40789f9a95f8b", + "https://deno.land/std@0.201.0/yaml/_type/seq.ts": "95333abeec8a7e4d967b8c8328b269e342a4bbdd2585395549b9c4f58c8533a2", + "https://deno.land/std@0.201.0/yaml/_type/set.ts": "f28ba44e632ef2a6eb580486fd47a460445eeddbdf1dbc739c3e62486f566092", + "https://deno.land/std@0.201.0/yaml/_type/str.ts": "a67a3c6e429d95041399e964015511779b1130ea5889fa257c48457bd3446e31", + "https://deno.land/std@0.201.0/yaml/_type/timestamp.ts": "706ea80a76a73e48efaeb400ace087da1f927647b53ad6f754f4e06d51af087f", + "https://deno.land/std@0.201.0/yaml/_type/undefined.ts": "94a316ca450597ccbc6750cbd79097ad0d5f3a019797eed3c841a040c29540ba", + "https://deno.land/std@0.201.0/yaml/_utils.ts": "26b311f0d42a7ce025060bd6320a68b50e52fd24a839581eb31734cd48e20393", + "https://deno.land/std@0.201.0/yaml/parse.ts": "1fbbda572bf3fff578b6482c0d8b85097a38de3176bf3ab2ca70c25fb0c960ef", + "https://deno.land/std@0.201.0/yaml/schema.ts": "96908b78dc50c340074b93fc1598d5e7e2fe59103f89ff81e5a49b2dedf77a67", + "https://deno.land/std@0.201.0/yaml/schema/core.ts": "fa406f18ceedc87a50e28bb90ec7a4c09eebb337f94ef17468349794fa828639", + "https://deno.land/std@0.201.0/yaml/schema/default.ts": "0047e80ae8a4a93293bc4c557ae8a546aabd46bb7165b9d9b940d57b4d88bde9", + "https://deno.land/std@0.201.0/yaml/schema/extended.ts": "0784416bf062d20a1626b53c03380e265b3e39b9409afb9f4cb7d659fd71e60d", + "https://deno.land/std@0.201.0/yaml/schema/failsafe.ts": "d219ab5febc43f770917d8ec37735a4b1ad671149846cbdcade767832b42b92b", + "https://deno.land/std@0.201.0/yaml/schema/json.ts": "5f41dd7c2f1ad545ef6238633ce9ee3d444dfc5a18101e1768bd5504bf90e5e5", + "https://deno.land/std@0.201.0/yaml/schema/mod.ts": "4472e827bab5025e92bc2eb2eeefa70ecbefc64b2799b765c69af84822efef32", + "https://deno.land/std@0.201.0/yaml/type.ts": "1aabb8e0a3f4229ce0a3526256f68826d9bdf65a36c8a3890ead8011fcba7670", + "https://deno.land/x/asynciter@0.0.18/asynciter.ts": "8b0a25e426e0c747dadb15123c450e676b389ac24b480fb075a61f971ebdc673", + "https://deno.land/x/asynciter@0.0.18/collect.ts": "dea80ad4df11603912cad276a211671d67539dbcf7e627de99d11b2dd90a66fe", + "https://deno.land/x/asynciter@0.0.18/concurrent-map.ts": "8503926d0801981d2041127f5966cb34878ee54ca21a1a85e1e0727950311eaf", + "https://deno.land/x/asynciter@0.0.18/filter.ts": "a82a1a1bc952d62b5f45048887382d9d05bdcf4f5f29b876e50607b66a83e866", + "https://deno.land/x/asynciter@0.0.18/first.ts": "cf5e9924b4aecc98ff5358e260cca5aadba052d060b7d33793749e84169b8aa4", + "https://deno.land/x/asynciter@0.0.18/flatten.ts": "354be48cd754e5277b237c4dfb4ce98f177b40f3975b671ba70603a4c3d52a2e", + "https://deno.land/x/asynciter@0.0.18/for-each.ts": "213a0aa26439edc20fbf6350c3f0ccb38187a0b41875fa0e973a3eaf154aeae1", + "https://deno.land/x/asynciter@0.0.18/map.ts": "862688e7ad18d96011aab9be0bf98cea98ac26fe2a8872373bceb6cbb9fea89e", + "https://deno.land/x/asynciter@0.0.18/mod.ts": "03c709ac8604e86af0f6277bafef611aa317d9f5cf2e54b97671354e0c9f22d5", + "https://deno.land/x/asynciter@0.0.18/reduce.ts": "e3a7bbb52626f445c502eee237c5f5f71c8a220b614e2cf93276c23386964737" } } diff --git a/doc/astro.config.ts b/doc/astro.config.ts index c938795de70d..d2a43dc738ff 100644 --- a/doc/astro.config.ts +++ b/doc/astro.config.ts @@ -40,7 +40,7 @@ export default defineConfig({ navbar: { json: { label: "JSON", - link: "/json/explanation/json_style", + link: "/json/tutorial/modding", translations: { "ko-KR": "JSON 모딩" }, items: docModes("json"), }, @@ -52,7 +52,7 @@ export default defineConfig({ }, dev: { label: "Engine", - link: "/dev/guides/building/building", + link: "/dev/guides/building/cmake", translations: { "ko-KR": "게임 엔진" }, items: docModes("dev"), }, diff --git a/doc/remark.ts b/doc/remark.ts index a05848b28290..3984d371c5c0 100644 --- a/doc/remark.ts +++ b/doc/remark.ts @@ -15,7 +15,7 @@ const removeSuffix = (url: string) => url.replace(suffix, "") export const fixRelativeLinks = () => (tree: Root) => visit(tree, "link", (node) => { - node.url = relativeUrl(removeSuffix(node.url)) + node.url = relativeUrl(removeSuffix(node.url)).toLowerCase() }) /** diff --git a/doc/src/content/docs/en/contributing/CONTRIBUTING.md b/doc/src/content/docs/en/contributing/CONTRIBUTING.md index f2ef8f52fc65..ecf9a87699ce 100644 --- a/doc/src/content/docs/en/contributing/CONTRIBUTING.md +++ b/doc/src/content/docs/en/contributing/CONTRIBUTING.md @@ -72,14 +72,12 @@ For more information: - [For maintainers](../i18n/guides/maintain) ## Documentation - -

- - -

+ ### Doxygen Comments @@ -95,6 +93,8 @@ Use the following template for commenting classes: * Lengthy description with many words. (optional) */ class foo { + +} ``` Use the following template for commenting functions: @@ -225,7 +225,7 @@ to explain the problem your PR is solving in full detail. ### All PRs should have a `"Summary"` line Summary is a one-line description of your change that will be extracted and added to the project -changelog at +changelog at https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/data/changelog.txt The format is: `SUMMARY: Category "description"` @@ -234,14 +234,14 @@ Performance, Infrastructure, Build, I18N. Example: `SUMMARY: Content "Adds new mutation category 'Mouse'"` -See the [Changelog Guidelines](./changelog.md) for explanations of the categories. +See the [Changelog Guidelines](./changelog) for explanations of the categories. ### Closing issues using keywords One more thing: when marking your PR as closing, fixing, or resolving issues, please include this somewhere in the description: -``` +```md - {keyword} #{issue} ``` @@ -264,11 +264,11 @@ slightly faster. ### closing multiple issues at once -``` +```md - {keyword} #{issue}, {keyword} #{issue} ``` -See for more. +See https://help.github.com/articles/closing-issues-using-keywords for more. ## Tooling support diff --git a/doc/img/contributing-doxy1.png b/doc/src/content/docs/en/contributing/img/contributing-doxy1.png similarity index 100% rename from doc/img/contributing-doxy1.png rename to doc/src/content/docs/en/contributing/img/contributing-doxy1.png diff --git a/doc/img/contributing-doxy2.png b/doc/src/content/docs/en/contributing/img/contributing-doxy2.png similarity index 100% rename from doc/img/contributing-doxy2.png rename to doc/src/content/docs/en/contributing/img/contributing-doxy2.png diff --git a/doc/img/readme-bug1.png b/doc/src/content/docs/en/contributing/img/readme-bug1.png similarity index 100% rename from doc/img/readme-bug1.png rename to doc/src/content/docs/en/contributing/img/readme-bug1.png diff --git a/doc/img/readme-bug2.png b/doc/src/content/docs/en/contributing/img/readme-bug2.png similarity index 100% rename from doc/img/readme-bug2.png rename to doc/src/content/docs/en/contributing/img/readme-bug2.png diff --git a/doc/img/readme-bug3.png b/doc/src/content/docs/en/contributing/img/readme-bug3.png similarity index 100% rename from doc/img/readme-bug3.png rename to doc/src/content/docs/en/contributing/img/readme-bug3.png diff --git a/doc/img/readme-bug4.png b/doc/src/content/docs/en/contributing/img/readme-bug4.png similarity index 100% rename from doc/img/readme-bug4.png rename to doc/src/content/docs/en/contributing/img/readme-bug4.png diff --git a/doc/img/readme-title.png b/doc/src/content/docs/en/contributing/img/readme-title.png similarity index 100% rename from doc/img/readme-title.png rename to doc/src/content/docs/en/contributing/img/readme-title.png diff --git a/doc/src/content/docs/en/index.mdx b/doc/src/content/docs/en/index.mdx index 68986b01d553..064e00ff983f 100644 --- a/doc/src/content/docs/en/index.mdx +++ b/doc/src/content/docs/en/index.mdx @@ -8,7 +8,7 @@ hero: file: ../../../assets/icon.svg actions: - text: Read the Guide - link: ./dev/guides/building/cmake + link: ./json/tutorial/modding icon: right-arrow variant: primary - text: Join the official Discord @@ -22,7 +22,7 @@ import { Card, CardGrid } from '@astrojs/starlight/components' - Mod the game using [JSON](json/reference/loading_order) and [Lua](./lua/guides/modding). + Mod the game using [JSON](json/tutorial/modding) and [Lua](lua/guides/modding). Translate the [base game](i18n/tutorial/transifex) and [custom mods](i18n/guides/mods). diff --git a/doc/src/content/docs/en/json/reference/JSON_INFO.md b/doc/src/content/docs/en/json/reference/JSON_INFO.md index 8f2884f20a04..18f79f38cf21 100644 --- a/doc/src/content/docs/en/json/reference/JSON_INFO.md +++ b/doc/src/content/docs/en/json/reference/JSON_INFO.md @@ -24,7 +24,7 @@ that's working you should be able to easily jump to the definition of any entity positioning your cursor over an id and hitting the appropriate key combination. - In Vim, this feature exists by default, and you can jump to a definition using - [`\^\]`](http://vimdoc.sourceforge.net/htmldoc/tagsrch.html#tagsrch.txt). + [`^\]`](http://vimdoc.sourceforge.net/htmldoc/tagsrch.html#tagsrch.txt). - In Notepad++ go to "Plugins" -> "Plugins Admin" and enable the "TagLEET" plugin. Then select any id and press Alt+Space to open the references window. diff --git a/doc/src/content/docs/en/json/reference/VEHICLES_JSON.md b/doc/src/content/docs/en/json/reference/VEHICLES_JSON.md index c0179767ce0c..77319dac0463 100644 --- a/doc/src/content/docs/en/json/reference/VEHICLES_JSON.md +++ b/doc/src/content/docs/en/json/reference/VEHICLES_JSON.md @@ -1,5 +1,5 @@ --- -title: Vehicle prototypes JSON file contents +title: Vehicle prototypes --- Vehicle prototypes are used to spawn stock vehicles. After a vehicle has been spawned, it is saved diff --git a/doc/src/content/docs/en/json/reference/creatures/BASECAMP.md b/doc/src/content/docs/en/json/reference/creatures/BASECAMP.md index ac7d3a335456..d3d6a61ae109 100644 --- a/doc/src/content/docs/en/json/reference/creatures/BASECAMP.md +++ b/doc/src/content/docs/en/json/reference/creatures/BASECAMP.md @@ -6,7 +6,7 @@ Basecamps leverage many existing aspects of JSON data such as recipes and mapgen to be familiar with those: - [JSON info](../JSON_INFO) has information on common fields for recipes -- [mapgen](../map/mapgen), see section 3 about `update_mapgen` +- [mapgen](../../reference/map/mapgen), see section 3 about `update_mapgen` # Adding alternate basecamp upgrade paths diff --git a/doc/src/content/docs/en/json/reference/creatures/MARTIALART_JSON.md b/doc/src/content/docs/en/json/reference/creatures/MARTIALART_JSON.md index 332e460af3e3..136090c48e8d 100644 --- a/doc/src/content/docs/en/json/reference/creatures/MARTIALART_JSON.md +++ b/doc/src/content/docs/en/json/reference/creatures/MARTIALART_JSON.md @@ -1,5 +1,5 @@ --- -title: Martial arts and techniques JSON file contents +title: Martial arts & techniques --- ### Martial arts diff --git a/doc/src/content/docs/en/json/guides/GUIDE_COMESTIBLES.md b/doc/src/content/docs/en/json/reference/items/comestibles_file_location.md similarity index 98% rename from doc/src/content/docs/en/json/guides/GUIDE_COMESTIBLES.md rename to doc/src/content/docs/en/json/reference/items/comestibles_file_location.md index baf1a3b8e15f..e1854e4d7a8f 100644 --- a/doc/src/content/docs/en/json/guides/GUIDE_COMESTIBLES.md +++ b/doc/src/content/docs/en/json/reference/items/comestibles_file_location.md @@ -1,5 +1,5 @@ --- -title: Guide to add Comestibles +title: File location for Comestibles --- There are a large number of files in `json/items/comestibles`, and this guide will help you decide diff --git a/doc/src/content/docs/en/json/reference/map/MAPGEN.md b/doc/src/content/docs/en/json/reference/map/mapgen.md similarity index 100% rename from doc/src/content/docs/en/json/reference/map/MAPGEN.md rename to doc/src/content/docs/en/json/reference/map/mapgen.md diff --git a/doc/src/content/docs/ko/contributing/CONTRIBUTING.md b/doc/src/content/docs/ko/contributing/CONTRIBUTING.md index 2d2662268797..9f363e8535f4 100644 --- a/doc/src/content/docs/ko/contributing/CONTRIBUTING.md +++ b/doc/src/content/docs/ko/contributing/CONTRIBUTING.md @@ -76,8 +76,8 @@ title: 기여하기 ## 공식 문서

- - + +

자동 생성된 문서를 [깃허브 페이지](https://cataclysmbnteam.github.io/Cataclysm-BN)에서 읽을 수 diff --git a/tools/front_matter.ts b/tools/front_matter.ts new file mode 100644 index 000000000000..cd0cadb6116a --- /dev/null +++ b/tools/front_matter.ts @@ -0,0 +1,41 @@ +/** + * Converts first heading into frontmatter. + */ + +import * as frontmatter from "https://deno.land/std@0.201.0/front_matter/yaml.ts" +import { walk } from "https://deno.land/std@0.201.0/fs/walk.ts" +import { asynciter } from "https://deno.land/x/asynciter@0.0.18/mod.ts" + +export const consumeFirstHeading = (lines: string[]): { heading: string; lines: string[] } => { + // consume all empty lines with regex + const spaces = lines.findIndex((line) => !line.match(/^\s*$/)) ?? 0 + // split into frontmatter and content + + const [frontmatter, ...content] = lines.slice(spaces) + return { heading: frontmatter.replace(/^#+\s*/, ""), lines: content } +} + +export const toFrontmatter = (text: string): string => { + if (frontmatter.test(text)) { + return text + } + + const lines = text.split("\n") + + const { heading, lines: content } = consumeFirstHeading(lines) + return /*md*/ `\ +--- +title: ${heading} +--- +${content.join("\n")} +` +} + +if (import.meta.main) { + await asynciter(walk("doc/src/content", { exts: ["md"], includeDirs: false })) + .map(({ path }) => path) + .concurrentUnorderedMap(async (path) => ({ path, text: await Deno.readTextFile(path) })) + .filter(({ text }) => !frontmatter.test(text)) + .concurrentUnorderedMap(({ path, text }) => Deno.writeTextFile(path, toFrontmatter(text))) + .collect() +} diff --git a/tools/front_matter_test.ts b/tools/front_matter_test.ts new file mode 100644 index 000000000000..895d9c134fd5 --- /dev/null +++ b/tools/front_matter_test.ts @@ -0,0 +1,40 @@ +import { assertEquals } from "https://deno.land/std@0.201.0/assert/assert_equals.ts" +import { consumeFirstHeading, toFrontmatter } from "./front_matter.ts" + +const input = /*md*/ ` + +## Foo asdf + +bar + +### baz + +qux +` +const output = /*md*/ `\ +--- +title: Foo asdf +--- + +bar + +### baz + +qux + +` +Deno.test("first heading is found and consumed", () => { + const result = consumeFirstHeading(input.split("\n")) + assertEquals(result, { + heading: "Foo asdf", + lines: ["", "bar", "", "### baz", "", "qux", ""], + }) +}) +Deno.test("first heading is converted to frontmatter", () => { + const result = toFrontmatter(input) + assertEquals(result, output) +}) +Deno.test("function is idempotent", () => { + const result = toFrontmatter(output) + assertEquals(result, output) +})