diff --git a/content/help/@help.toml b/content/help/@help.toml new file mode 100644 index 0000000..4a40e6a --- /dev/null +++ b/content/help/@help.toml @@ -0,0 +1,31 @@ +name = "@help" +title = "help system administration" +admin = true +body = """ + the help system stores topics as TOML files in content/help/. + each topic has a name, title, optional admin flag, and body text. + + commands + @help list all help topics + @help create create a new topic (guided) + @help create create a new topic with the given name + @help edit edit an existing topic + @help remove remove a topic + + creating topics + @help create walks you through each field: + name the topic name (what players type after 'help') + title short description shown in listings + admin only whether only admins can view it + body the help text (opens in the editor) + + editing topics + @help edit shows current values for each field. + press enter to keep the current value. + the editor opens with the existing body text. + + files + topics are stored in content/help/.toml + they can also be edited directly with any text editor. + changes are loaded at server startup. +""" diff --git a/tests/test_help_topics.py b/tests/test_help_topics.py index f6611b2..e42ff82 100644 --- a/tests/test_help_topics.py +++ b/tests/test_help_topics.py @@ -251,3 +251,13 @@ async def test_at_help_remove_prompts_confirmation(admin_player): await commands.dispatch(admin_player, "@help remove combat") output = "".join(c[0][0] for c in admin_player.writer.write.call_args_list) assert "y/n" in output.lower() or "confirm" in output.lower() + + +def test_at_help_toml_loads_from_content(): + from pathlib import Path + + help_dir = Path(__file__).resolve().parents[1] / "content" / "help" + if help_dir.exists(): + topics = load_help_topics(help_dir) + assert "@help" in topics + assert topics["@help"].admin is True