From b1786e88ac8921d9c4f0cfe366fdf7e2c965984c Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 18 Jun 2022 14:09:33 +0100 Subject: [PATCH] Use .md extension for markdown files Linking to line numbers is brittle, linking to sections/headings is better. If you still want to link to a line number, you can append ?plain=1 to GitHub's URL --- .github/CONTRIBUTING.md | 2 +- CMakeLists.txt | 8 ++++---- doc/{builtin_entities.txt => builtin_entities.md} | 0 doc/{client_lua_api.txt => client_lua_api.md} | 2 +- doc/{lua_api.txt => lua_api.md} | 0 doc/{menu_lua_api.txt => menu_lua_api.md} | 8 ++++---- doc/mkdocs/build.sh | 4 ++-- doc/{texture_packs.txt => texture_packs.md} | 4 ++-- src/network/networkprotocol.h | 2 +- src/script/lua_api/l_object.cpp | 4 ++-- util/bump_version.sh | 6 +++--- 11 files changed, 20 insertions(+), 20 deletions(-) rename doc/{builtin_entities.txt => builtin_entities.md} (100%) rename doc/{client_lua_api.txt => client_lua_api.md} (99%) rename doc/{lua_api.txt => lua_api.md} (100%) rename doc/{menu_lua_api.txt => menu_lua_api.md} (98%) rename doc/{texture_packs.txt => texture_packs.md} (99%) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c9e8e89aa..0bfae18a0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -30,7 +30,7 @@ Contributions are welcome! Here's how you can help: 3. Start coding! - Refer to the - [Lua API](https://github.com/minetest/minetest/blob/master/doc/lua_api.txt), + [Lua API](https://github.com/minetest/minetest/blob/master/doc/lua_api.md), [Developer Wiki](http://dev.minetest.net/Main_Page) and other [documentation](https://github.com/minetest/minetest/tree/master/doc). - Follow the [C/C++](http://dev.minetest.net/Code_style_guidelines) and diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ab60111c..798173079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,10 +267,10 @@ if(BUILD_CLIENT) endif() install(FILES "README.md" DESTINATION "${DOCDIR}" COMPONENT "Docs") -install(FILES "doc/lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs") -install(FILES "doc/client_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs") -install(FILES "doc/menu_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs") -install(FILES "doc/texture_packs.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs") +install(FILES "doc/lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs") +install(FILES "doc/client_lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs") +install(FILES "doc/menu_lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs") +install(FILES "doc/texture_packs.md" DESTINATION "${DOCDIR}" COMPONENT "Docs") install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs") install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}") diff --git a/doc/builtin_entities.txt b/doc/builtin_entities.md similarity index 100% rename from doc/builtin_entities.txt rename to doc/builtin_entities.md diff --git a/doc/client_lua_api.txt b/doc/client_lua_api.md similarity index 99% rename from doc/client_lua_api.txt rename to doc/client_lua_api.md index 53d8867d3..57049893d 100644 --- a/doc/client_lua_api.txt +++ b/doc/client_lua_api.md @@ -947,7 +947,7 @@ Setting-related --------------- * `minetest.settings`: Settings object containing all of the settings from the - main config file (`minetest.conf`). Check lua_api.txt for class reference. + main config file (`minetest.conf`). Check lua_api.md for class reference. * `minetest.setting_get_pos(name)`: Loads a setting from the main settings and parses it as a position (in the format `(1,2,3)`). Returns a position or nil. diff --git a/doc/lua_api.txt b/doc/lua_api.md similarity index 100% rename from doc/lua_api.txt rename to doc/lua_api.md diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.md similarity index 98% rename from doc/menu_lua_api.txt rename to doc/menu_lua_api.md index e4c5cd359..8ebef3d00 100644 --- a/doc/menu_lua_api.txt +++ b/doc/menu_lua_api.md @@ -5,7 +5,7 @@ Introduction ------------- The main menu is defined as a formspec by Lua in `builtin/mainmenu/` -Description of formspec language to show your menu is in `lua_api.txt` +Description of formspec language to show your menu is in `lua_api.md` Callbacks @@ -77,7 +77,7 @@ Filesystem * `destination` folder to extract to * returns true/false * `core.sound_play(spec, looped)` -> handle - * `spec` = `SimpleSoundSpec` (see `lua_api.txt`) + * `spec` = `SimpleSoundSpec` (see `lua_api.md`) * `looped` = bool * `core.sound_stop(handle)` * `core.get_video_drivers()` @@ -338,7 +338,7 @@ Settings * `core.settings:save()` -> nil, save all settings to config file For a complete list of methods of the `Settings` object see -[lua_api.txt](https://github.com/minetest/minetest/blob/master/doc/lua_api.txt) +[lua_api.md](https://github.com/minetest/minetest/blob/master/doc/lua_api.md) Worlds @@ -371,7 +371,7 @@ Helpers * `fgettext(string, ...)` -> string * same as `fgettext_ne()`, but calls `core.formspec_escape` before returning result * `core.parse_json(string[, nullvalue])` -> something (possible in async calls) - * see `core.parse_json` (`lua_api.txt`) + * see `core.parse_json` (`lua_api.md`) * `dump(obj, dumped={})` * Return object serialized as a string * `string:split(separator)` diff --git a/doc/mkdocs/build.sh b/doc/mkdocs/build.sh index f4d946874..33e28acee 100755 --- a/doc/mkdocs/build.sh +++ b/doc/mkdocs/build.sh @@ -4,8 +4,8 @@ MARKDOWN_FILE=$(pip show markdown | awk '/Location/ { print $2 }')/markdown/extensions/codehilite.py patch -N -r - $MARKDOWN_FILE lua_highlight.patch || true -# Split lua_api.txt on top level headings -cat ../lua_api.txt | csplit -sz -f docs/section - '/^=/-1' '{*}' +# Split lua_api.md on top level headings +cat ../lua_api.md | csplit -sz -f docs/section - '/^=/-1' '{*}' cat > mkdocs.yml << EOF site_name: Minetest API Documentation diff --git a/doc/texture_packs.txt b/doc/texture_packs.md similarity index 99% rename from doc/texture_packs.txt rename to doc/texture_packs.md index 841d6de1c..2e595449e 100644 --- a/doc/texture_packs.txt +++ b/doc/texture_packs.md @@ -51,7 +51,7 @@ unsure, just test your texture pack in-game. Texture modifiers ----------------- -See lua_api.txt for texture modifiers +See lua_api.md for texture modifiers Special textures ---------------- @@ -209,7 +209,7 @@ Here are targets you can choose from: Nodes support all targets, but other items only support 'inventory' and 'wield'. -¹ : `N` is an integer [0,255]. Sets align_style = "world" and scale = N on the tile, refer to lua_api.txt for details. +¹ : `N` is an integer [0,255]. Sets align_style = "world" and scale = N on the tile, refer to lua_api.md for details. ### Using the special targets diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h index 7275d8130..ba526b98d 100644 --- a/src/network/networkprotocol.h +++ b/src/network/networkprotocol.h @@ -236,7 +236,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define PASSWORD_SIZE 28 // Maximum password length. Allows for // base64-encoded SHA-1 (27+\0). -// See also formspec [Version History] in doc/lua_api.txt +// See also formspec [Version History] in doc/lua_api.md #define FORMSPEC_API_VERSION 6 #define TEXTURENAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-" diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 11819c0e7..01b1ddeaa 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -1805,7 +1805,7 @@ int ObjectRef::l_set_sky(lua_State *L) } } else { // Handle old set_sky calls, and log deprecated: - log_deprecated(L, "Deprecated call to set_sky, please check lua_api.txt"); + log_deprecated(L, "Deprecated call to set_sky, please check lua_api.md"); // Fix sun, moon and stars showing when classic textured skyboxes are used SunParams sun_params = player->getSunParams(); @@ -1898,7 +1898,7 @@ int ObjectRef::l_get_sky(lua_State *L) // handle the deprecated version if (!readParam(L, 2, false)) { - log_deprecated(L, "Deprecated call to get_sky, please check lua_api.txt"); + log_deprecated(L, "Deprecated call to get_sky, please check lua_api.md"); push_ARGB8(L, skybox_params.bgcolor); lua_pushlstring(L, skybox_params.type.c_str(), skybox_params.type.size()); diff --git a/util/bump_version.sh b/util/bump_version.sh index 909e94a1b..c31cbf673 100755 --- a/util/bump_version.sh +++ b/util/bump_version.sh @@ -139,10 +139,10 @@ write_new_version() { sed -i -re "s/set\(\"versionPatch\", [0-9]+\)/set(\"versionPatch\", $NEXT_VERSION_PATCH)/" android/build.gradle # Update doc versions - sed -i -re '1s/[0-9]+\.[0-9]+\.[0-9]+/'"$NEXT_VERSION"'/g' doc/menu_lua_api.txt - sed -i -re '1s/[0-9]+\.[0-9]+\.[0-9]+/'"$NEXT_VERSION"'/g' doc/client_lua_api.txt + sed -i -re '1s/[0-9]+\.[0-9]+\.[0-9]+/'"$NEXT_VERSION"'/g' doc/menu_lua_api.md + sed -i -re '1s/[0-9]+\.[0-9]+\.[0-9]+/'"$NEXT_VERSION"'/g' doc/client_lua_api.md - git add -f CMakeLists.txt android/build.gradle doc/menu_lua_api.txt doc/client_lua_api.txt + git add -f CMakeLists.txt android/build.gradle doc/menu_lua_api.md doc/client_lua_api.md } ## Create release commit and tag