Browse Source

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
rubenwardy 1 year ago
parent
commit
b1786e88ac

+ 1 - 1
.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

+ 4 - 4
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}")
 

+ 0 - 0
doc/builtin_entities.txt → doc/builtin_entities.md


+ 1 - 1
doc/client_lua_api.txt → 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.
 

+ 0 - 0
doc/lua_api.txt → doc/lua_api.md


+ 4 - 4
doc/menu_lua_api.txt → 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)`

+ 2 - 2
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

+ 2 - 2
doc/texture_packs.txt → 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
 

+ 1 - 1
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_.-"

+ 2 - 2
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<bool>(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());

+ 3 - 3
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