Build mod summary list automatically

Instead of maintaining the short description of each sub-mod
manually in a giant README file, distribute the short descriptions
into each relevant mod, and then build the README listings
automatically at deploy time.

This should:
- Make it harder to forget to add/remove mods in the list
- Prevent them from being out of alphabetical order
- Ensure each mod has a description for in-menu use
This commit is contained in:
Aaron Suen 2023-06-20 07:30:35 -04:00
parent 6f292ea869
commit d32a2c856c
40 changed files with 93 additions and 41 deletions

1
.cdb-readme-post.md Normal file
View File

@ -0,0 +1 @@

1
.cdb-readme-pre.md Normal file
View File

@ -0,0 +1 @@
The following mods have no special dependencies:

1
.cdb-readme-sock.md Normal file
View File

@ -0,0 +1 @@
The following mods require **LuaSockets** to be installed on the host system, and the mod to be added to the `secure.trusted_mods` setting:

View File

@ -1,6 +1,10 @@
-- LUALOCALS < ---------------------------------------------------------
local dofile
= dofile
local dofile, io, ipairs, string, table
= dofile, io, ipairs, string, table
local io_open, io_popen, string_gsub, string_match, table_concat,
table_sort
= io.open, io.popen, string.gsub, string.match, table.concat,
table.sort
-- LUALOCALS > ---------------------------------------------------------
-- luacheck: push
@ -9,7 +13,7 @@ local dofile
readtext = readtext or function() end
readbinary = readbinary or function() end
return {
local metadata = {
pkg = "szutilpack",
version = dofile("./version.lua"),
type = "mod",
@ -27,10 +31,56 @@ return {
content_warnings = {},
license = "MIT",
media_license = "MIT",
long_description = readtext('README.md'),
repo = "https://gitlab.com/sztest/szutilpack",
maintainers = {"Warr1024"},
screenshots = {readbinary('.cdbscreen.png')}
}
local function exist(file)
local f = io_open(file, "rb")
if f then f:close() end
return f ~= nil
end
local mods = {}
do
local f = io_popen("ls -A -1 .")
while true do
local l = f:read("*line")
if not l then break end
if exist(l .. "/mod.conf") then
mods[#mods + 1] = l
end
end
table_sort(mods)
end
local parts = {
readtext("README.md"),
"",
readtext(".cdb-readme-pre.md"),
""
}
local function scanmods(reqsock)
for _, m in ipairs(mods) do
if reqsock == exist(m .. "/.requires-luasockets") then
local conf = readtext(m .. "/mod.conf")
local desc = string_match(conf, "description%s*=%s*(.-)\n")
parts[#parts + 1] = "- `" .. m .. "`: " .. desc
end
end
end
scanmods(false)
parts[#parts + 1] = ""
parts[#parts + 1] = readtext(".cdb-readme-sock.md")
parts[#parts + 1] = ""
scanmods(true)
parts[#parts + 1] = ""
parts[#parts + 1] = readtext(".cdb-readme-post.md")
metadata.long_description = string_gsub(table_concat(parts, "\n"), "\n\n+", "\n\n")
return metadata
-- luacheck: pop

2
.gitattributes vendored
View File

@ -1,2 +1,4 @@
version.lua export-subst
src export-ignore
TODO export-ignore
.* export-ignore

View File

@ -1,39 +1,3 @@
A collection of miscellaneous mods for minetest providing "utility" functonality: management features, bug workarounds, and libraries for other mods. Each mod includes an individual README file with details on its use.
A collection of miscellaneous mods for Minetest providing "utility" functionality: management features, bug workarounds, and libraries for other mods. Each mod includes an individual README file with details on its use.
Each mod in the pack is effectively independent, with minimal or no dependencies (including on any assumed underlying game) and they can be enabled/disabled individually. Mods are distributed as a single pack because they have a single shared maintenance/release cycle.
The following mods have no special dependencies:
- `szutil_admin`: Alternative to the "admin" command that lists moderation team members.
- `szutil_chatsounds`: Configurable beep notifications for in-game chat.
- `szutil_cinecam`: Configure a player as a camera for unattended livestreaming.
- `szutil_clocksync`: Synchronize in-game clock smoothly with real-time clock so users can log in at predictable times of day.
- `szutil_controlhud`: Togglable on-screen input control HUD, useful for demo recording.
- `szutil_fixhack`: Fix lighting and fluid bugs automatically and continuously in background.
- `szutil_givemenu`: Menu-driven searchable version of the /give command.
- `szutil_idlekick`: Automatically kick idle players after a timeout.
- `szutil_lag`: Simple command to set server lag level.
- `szutil_lagometer`: Optional on-screen server performance meter HUD.
- `szutil_logtrace`: Allow privileged players to monitor server debug trace in chat.
- `szutil_maplimitfx`: Display particle visual at hard map boundaries.
- `szutil_motd`: Display a formspec MOTD to players on login, only if updated since the last view.
- `szutil_motdagree`: Players must accept the MOTD via chat command to get privs.
- `szutil_namehud`: A simple togglable HUD showing the names of all online players.
- `szutil_nowonline`: Periodically display cumulative list of online players, for chat bridges.
- `szutil_nukeplayer`: Adds a /nuke_player command to completely destroy a player account.
- `szutil_pruneplayers`: Automatically clean out old unused players.
- `szutil_restart`: Externally-triggerable server restarts with countdown/warnings.
- `szutil_revokeme`: Fixes missing /revokeme admin command.
- `szutil_roles`: Manage privs via special privs that represent groups of other privs.
- `szutil_runas`: Run a command as another user with password auth.
- `szutil_stealth`: Make a player as close to completely invisble to players as possible, for moderation or spectation use.
- `szutil_suadmin`: Change admin access to be based on a /su (password) command, instead of by player name.
- `szutil_telecode`: Teleportation by opaque codes that can be shared, saved, and published.
- `szutil_usagesurvey`: Collect usage statistics per-mapblock on how each is being used (e.g. for pruning lightly-used portions of the map).
- `szutil_watch`: Allow privileged players to attach to and spectate other players.
- `szutil_xplevel`: Grant players privs based on "experience" accumulated by playing.
The following mods require **LuaSockets** to be installed on the host system, and the mod to be added to the `secure.trusted_mods` setting:
- `szutil_chatsocket`: Expose in-game chat stream as a unix-domain socket for arbitrary chat integrations.
- `szutil_consocket`: Expose an admin console as a unix-domain socket for clientless admin via ssh.

View File

@ -1,2 +1,3 @@
name = szutil_admin
description = Alternative to the "admin" command that lists moderation team members
supported_games = *

View File

@ -0,0 +1 @@
yes

View File

@ -1,2 +1,3 @@
name = szutil_chatsocket
description = Expose in-game chat stream as a unix-domain socket for arbitrary chat integrations
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_chatsounds
description = Configurable beep notifications for in-game chat
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_cinecam
description = Configure a player as a camera for unattended livestreaming
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_clocksync
description = Synchronize in-game clock smoothly with real-time clock so users can log in at predictable times of day
supported_games = *

View File

@ -0,0 +1 @@
yes

View File

@ -1,2 +1,3 @@
name = szutil_consocket
description = Togglable on-screen input control HUD, useful for demo recording
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_controlhud
description = Togglable on-screen input control HUD, useful for demo recording
supported_games = *

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -1,2 +1,3 @@
name = szutil_fixhack
description = Fix lighting and fluid bugs automatically and continuously in background
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_givemenu
description = Menu-driven searchable version of the /give command
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_idlekick
description = Automatically kick idle players after a timeout
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_lag
description = Simple command to set server lag level
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_lagometer
description = Optional on-screen server performance meter HUD
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_logtrace
description = Allow privileged players to monitor server log trace in chat
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_maplimitfx
description = Display particle visual at hard map boundaries
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_motd
description = Display a formspec MOTD to players on login, only if updated since the last view
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_motdagree
description = Players must accept the MOTD via chat command to get privs
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_namehud
description = Simple togglable HUD showing the names of all online players
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_nowonline
description = Periodically announce cumulative list of online players, for chat bridges
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_nukeplayer
description = Adds a /nuke_player command to completely destroy a player account
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_offlinepos
description = Access player positions when offline, support teleports and waypoint HUDs
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_pruneplayers
description = Automatically clean out old unused players
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_restart
description = Externally-triggerable server restarts with countdown/warnings
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_revokeme
description = Fixes missing /revokeme admin command
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_roles
description = Manage privs via special privs that represent groups of other privs
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_runas
description = Run a command as another user with password auth
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_stealth
description = Make a player as close to completely invisible to players as possible, for moderation or spectation use
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_suadmin
description = Change admin access to be based on a /su (password) command, instead of by player name
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_telecode
description = Teleportation by opaque codes that can be shared, saved, and published
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_usagesurvey
description = Collect usage statistics per-mapblock on how each is being used
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_watch
description = Allow privileged/invited players to attach to and spectate other players
supported_games = *

View File

@ -1,2 +1,3 @@
name = szutil_xplevel
description = Grant players privs based on "experience" accumulated by playing
supported_games = *