evennia.help.filehelp¶
The filehelp-system allows for defining help files outside of the game. These will be treated as non-command help entries and displayed in the same way as help entries created using the sethelp default command. After changing an entry on-disk you need to reload the server to have the change show in-game.
An filehelp file is a regular python modules with dicts representing each help entry. If a list HELP_ENTRY_DICTS is found in the module, this should be a list of dicts. Otherwise all top-level dicts in the module will be assumed to be a help-entry dict.
Each help-entry dict is on the form
{'key': <str>,
'category': <str>, # optional, otherwise settings.DEFAULT_HELP_CATEGORY
'aliases': <list>, # optional
'text': <str>}****
where the **category** is optional and the **text** should be formatted on the same form as other help entry-texts and contain **# subtopics** as normal.
New help-entry modules are added to the system by providing the python-path to the module to settings.FILE_HELP_ENTRY_MODULES. Note that if same-key entries are added, entries in latter modules will override that of earlier ones. Use **settings.DEFAULT_HELP_CATEGORY** to customize what category is used if not set explicitly.
An example of the contents of a module:
help_entry1 = {
"key": "The Gods", # case-insensitive, can be searched by 'gods' as well
"aliases": ['pantheon', 'religion']
"category": "Lore",
"text": '''
The gods formed the world ...
# Subtopics
## Pantheon
...
### God of love
...
### God of war
...
'''
}
HELP_ENTRY_DICTS = [
help_entry1,
...
]
-
class
evennia.help.filehelp.FileHelpEntry(key: str, aliases: list, help_category: str, entrytext: str)[source]¶ Bases:
objectRepresents a help entry read from file. This mimics the api of the database-bound HelpEntry so that they can be used interchangeably in the help command.
-
key: str¶
-
aliases: list¶
-
help_category: str¶
-
entrytext: str¶
-
property
search_index_entry¶ Property for easily retaining a search index entry for this object.
-
__init__(key: str, aliases: list, help_category: str, entrytext: str) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
evennia.help.filehelp.FileHelpStorageHandler(help_file_modules=['world.help_entries'])[source]¶ Bases:
objectThis reads and stores help entries for quick access. By default it reads modules from settings.FILE_HELP_ENTRY_MODULES.
Note that this is not meant to any searching/lookup - that is all handled by the help command.