evennia/docs/3.x/api/evennia.commands.default.help.html
2023-12-21 00:12:31 +01:00

554 lines
No EOL
39 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>evennia.commands.default.help &#8212; Evennia 3.x documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="evennia.commands.default.muxcommand" href="evennia.commands.default.muxcommand.html" />
<link rel="prev" title="evennia.commands.default.general" href="evennia.commands.default.general.html" />
</head><body>
<div class="admonition important">
<p class="first admonition-title">Note</p>
<p class="last">You are reading an old version of the Evennia documentation. <a href="https://www.evennia.com/docs/latest/index.html">The latest version is here</a></p>.
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.commands.default.muxcommand.html" title="evennia.commands.default.muxcommand"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="evennia.commands.default.general.html" title="evennia.commands.default.general"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 3.x</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.commands.html" >evennia.commands</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.commands.default.html" accesskey="U">evennia.commands.default</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.commands.default.help</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<h4>Previous topic</h4>
<p class="topless"><a href="evennia.commands.default.general.html"
title="previous chapter">evennia.commands.default.general</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="evennia.commands.default.muxcommand.html"
title="next chapter">evennia.commands.default.muxcommand</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.commands.default.help.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com/docs/latest/index.html">Documentation Top</a> </li>
<li><a href="https://www.evennia.com">Evennia Home</a> </li>
<li><a href="https://github.com/evennia/evennia">Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
</div>
</div>
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.commands.default.help">
<span id="evennia-commands-default-help"></span><h1>evennia.commands.default.help<a class="headerlink" href="#module-evennia.commands.default.help" title="Permalink to this headline"></a></h1>
<p>The help command. The basic idea is that help texts for commands are best
written by those that write the commands - the developers. So command-help is
all auto-loaded and searched from the current command set. The normal,
database-tied help system is used for collaborative creation of other help
topics such as RP help or game-world aides. Help entries can also be created
outside the game in modules given by <strong>**settings.FILE_HELP_ENTRY_MODULES**</strong>.</p>
<dl class="py class">
<dt id="evennia.commands.default.help.CmdHelp">
<em class="property">class </em><code class="sig-prename descclassname">evennia.commands.default.help.</code><code class="sig-name descname">CmdHelp</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.muxcommand.html#evennia.commands.default.muxcommand.MuxCommand" title="evennia.commands.default.muxcommand.MuxCommand"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.muxcommand.MuxCommand</span></code></a></p>
<p>Get help.</p>
<dl class="simple">
<dt>Usage:</dt><dd><p>help
help &lt;topic, command or category&gt;
help &lt;topic&gt;/&lt;subtopic&gt;
help &lt;topic&gt;/&lt;subtopic&gt;/&lt;subsubtopic&gt;</p>
</dd>
</dl>
<p>Use the help command alone to see an index of all help topics, organized
by category. Some big topics may offer additional sub-topics.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.key">
<code class="sig-name descname">key</code><em class="property"> = 'help'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['?']</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.locks">
<code class="sig-name descname">locks</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.locks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.arg_regex">
<code class="sig-name descname">arg_regex</code><em class="property"> = re.compile('\\s|$', re.IGNORECASE)</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.arg_regex" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.return_cmdset">
<code class="sig-name descname">return_cmdset</code><em class="property"> = True</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.return_cmdset" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.help_more">
<code class="sig-name descname">help_more</code><em class="property"> = True</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.help_more" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.index_type_separator_clr">
<code class="sig-name descname">index_type_separator_clr</code><em class="property"> = '|w'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.index_type_separator_clr" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.index_category_clr">
<code class="sig-name descname">index_category_clr</code><em class="property"> = '|W'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.index_category_clr" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.index_topic_clr">
<code class="sig-name descname">index_topic_clr</code><em class="property"> = '|G'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.index_topic_clr" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.suggestion_cutoff">
<code class="sig-name descname">suggestion_cutoff</code><em class="property"> = 0.6</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.suggestion_cutoff" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.suggestion_maxnum">
<code class="sig-name descname">suggestion_maxnum</code><em class="property"> = 5</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.suggestion_maxnum" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.subtopic_separator_char">
<code class="sig-name descname">subtopic_separator_char</code><em class="property"> = '/'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.subtopic_separator_char" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.clickable_topics">
<code class="sig-name descname">clickable_topics</code><em class="property"> = True</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.clickable_topics" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.msg_help">
<code class="sig-name descname">msg_help</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">text</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.msg_help"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.msg_help" title="Permalink to this definition"></a></dt>
<dd><p>messages text to the caller, adding an extra oob argument to indicate
that this is a help command result and could be rendered in a separate
help window.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.format_help_entry">
<code class="sig-name descname">format_help_entry</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">topic</span><span class="o">=</span><span class="default_value">''</span></em>, <em class="sig-param"><span class="n">help_text</span><span class="o">=</span><span class="default_value">''</span></em>, <em class="sig-param"><span class="n">aliases</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">suggested</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">subtopics</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">click_topics</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.format_help_entry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.format_help_entry" title="Permalink to this definition"></a></dt>
<dd><p>This visually formats the help entry.
This method can be overridden to customize the way a help
entry is displayed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>title</strong> (<em>str</em><em>, </em><em>optional</em>) The title of the help entry.</p></li>
<li><p><strong>help_text</strong> (<em>str</em><em>, </em><em>optional</em>) Text of the help entry.</p></li>
<li><p><strong>aliases</strong> (<em>list</em><em>, </em><em>optional</em>) List of help-aliases (displayed in header).</p></li>
<li><p><strong>suggested</strong> (<em>list</em><em>, </em><em>optional</em>) Strings suggested reading (based on title).</p></li>
<li><p><strong>subtopics</strong> (<em>list</em><em>, </em><em>optional</em>) A list of strings - the subcategories available
for this entry.</p></li>
<li><p><strong>click_topics</strong> (<em>bool</em><em>, </em><em>optional</em>) Should help topics be clickable. Default is True.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>help_message (str)</em> Help entry formated for console.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.format_help_index">
<code class="sig-name descname">format_help_index</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cmd_help_dict</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">db_help_dict</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">title_lone_category</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">click_topics</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.format_help_index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.format_help_index" title="Permalink to this definition"></a></dt>
<dd><p>Output a category-ordered g for displaying the main help, grouped by
category.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmd_help_dict</strong> (<em>dict</em>) A dict <strong>{“category”: [topic, topic, …]}</strong> for
command-based help.</p></li>
<li><p><strong>db_help_dict</strong> (<em>dict</em>) A dict <strong>{“category”: [topic, topic], …]}</strong> for
database-based help.</p></li>
<li><p><strong>title_lone_category</strong> (<em>bool</em><em>, </em><em>optional</em>) If a lone category should
be titled with the category name or not. While pointless in a
general index, the title should probably show when explicitly
listing the category itself.</p></li>
<li><p><strong>click_topics</strong> (<em>bool</em><em>, </em><em>optional</em>) If help-topics are clickable or not
(for webclient or telnet clients with MXP support).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>str</em> The help index organized into a grid.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>The input are the pre-loaded help files for commands and database-helpfiles
respectively. You can override this method to return a custom display of the list of
commands and topics.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.can_read_topic">
<code class="sig-name descname">can_read_topic</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cmd_or_topic</span></em>, <em class="sig-param"><span class="n">caller</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.can_read_topic"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.can_read_topic" title="Permalink to this definition"></a></dt>
<dd><p>Helper method. If this return True, the given help topic
be viewable in the help listing. Note that even if this returns False,
the entry will still be visible in the help index unless <strong>should_list_topic</strong>
is also returning False.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmd_or_topic</strong> (<a class="reference internal" href="evennia.commands.command.html#evennia.commands.command.Command" title="evennia.commands.command.Command"><em>Command</em></a><em>, </em><a class="reference internal" href="evennia.help.models.html#evennia.help.models.HelpEntry" title="evennia.help.models.HelpEntry"><em>HelpEntry</em></a><em> or </em><a class="reference internal" href="evennia.help.filehelp.html#evennia.help.filehelp.FileHelpEntry" title="evennia.help.filehelp.FileHelpEntry"><em>FileHelpEntry</em></a>) The topic/command to test.</p></li>
<li><p><strong>caller</strong> the caller checking for access.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>bool</em> If command can be viewed or not.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>This uses the read lock. If no read lock is defined, the topic is assumed readable
by all.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.can_list_topic">
<code class="sig-name descname">can_list_topic</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cmd_or_topic</span></em>, <em class="sig-param"><span class="n">caller</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.can_list_topic"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.can_list_topic" title="Permalink to this definition"></a></dt>
<dd><p>Should the specified command appear in the help table?</p>
<p>This method only checks whether a specified command should appear in the table of
topics/commands. The command can be used by the caller (see the should_show_help method)
and the command will still be available, for instance, if a character type help name of the
command. However, if you return False, the specified command will not appear in the table.
This is sometimes useful to “hide” commands in the table, but still access them through the
help system.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmd_or_topic</strong> (<a class="reference internal" href="evennia.commands.command.html#evennia.commands.command.Command" title="evennia.commands.command.Command"><em>Command</em></a><em>, </em><a class="reference internal" href="evennia.help.models.html#evennia.help.models.HelpEntry" title="evennia.help.models.HelpEntry"><em>HelpEntry</em></a><em> or </em><a class="reference internal" href="evennia.help.filehelp.html#evennia.help.filehelp.FileHelpEntry" title="evennia.help.filehelp.FileHelpEntry"><em>FileHelpEntry</em></a>) The topic/command to test.</p></li>
<li><p><strong>caller</strong> the caller checking for access.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>bool</em> If command should be listed or not.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>The <strong>.auto_help</strong> propery is checked for commands. For all help entries,
the view lock will be checked, and if no such lock is defined, the read
lock will be used. If neither lock is defined, the help entry is assumed to be
accessible to all.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.collect_topics">
<code class="sig-name descname">collect_topics</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">caller</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'list'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.collect_topics"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.collect_topics" title="Permalink to this definition"></a></dt>
<dd><p>Collect help topics from all sources (cmd/db/file).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>caller</strong> (<em>Object</em><em> or </em><em>Account</em>) The user of the Command.</p></li>
<li><p><strong>mode</strong> (<em>str</em>) One of list or query, where the first means we are collecting to view
the help index and the second because of wanting to search for a specific help
entry/cmd to read. This determines which access should be checked.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><p><em>tuple</em> A tuple of three dicts containing the different types of help entries
in the order cmd-help, db-help, file-help:</p>
<blockquote>
<div><p><strong>({key: cmd,…}, {key: dbentry,…}, {key: fileentry,…}</strong></p>
</div></blockquote>
</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.do_search">
<code class="sig-name descname">do_search</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">query</span></em>, <em class="sig-param"><span class="n">entries</span></em>, <em class="sig-param"><span class="n">search_fields</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.do_search"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.do_search" title="Permalink to this definition"></a></dt>
<dd><p>Perform a help-query search, default using Lunr search engine.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>query</strong> (<em>str</em>) The help entry to search for.</p></li>
<li><p><strong>entries</strong> (<em>list</em>) All possibilities. A mix of commands, HelpEntries and FileHelpEntries.</p></li>
<li><p><strong>search_fields</strong> (<em>list</em>) A list of dicts defining how Lunr will find the
search data on the elements. If not given, will use a default.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>tuple</em> A tuple (match, suggestions).</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.parse">
<code class="sig-name descname">parse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.parse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.parse" title="Permalink to this definition"></a></dt>
<dd><p>input is a string containing the command or topic to match.</p>
<p>The allowed syntax is</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">help</span> <span class="o">&lt;</span><span class="n">topic</span><span class="o">&gt;</span><span class="p">[</span><span class="o">/&lt;</span><span class="n">subtopic</span><span class="o">&gt;</span><span class="p">[</span><span class="o">/&lt;</span><span class="n">subtopic</span><span class="o">&gt;</span><span class="p">[</span><span class="o">/...</span><span class="p">]]]</span>
</pre></div>
</div>
<p>The database/command query is always for <strong>&lt;topic&gt;</strong>, and any subtopics
is then parsed from there. If a <strong>&lt;topic&gt;</strong> has spaces in it, it is
always matched before assuming the space begins a subtopic.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.strip_cmd_prefix">
<code class="sig-name descname">strip_cmd_prefix</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">all_keys</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.strip_cmd_prefix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.strip_cmd_prefix" title="Permalink to this definition"></a></dt>
<dd><p>Conditional strip of a command prefix, such as &#64; in &#64;desc. By default
this will be hidden unless there is a duplicate without the prefix
in the full command set (such as &#64;open and open).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key</strong> (<em>str</em>) Command key to analyze.</p></li>
<li><p><strong>all_cmds</strong> (<em>list</em>) All command-keys (and potentially aliases).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>str</em> Potentially modified key to use in help display.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.func">
<code class="sig-name descname">func</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.func" title="Permalink to this definition"></a></dt>
<dd><p>Run the dynamic help entry creator.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.help_category">
<code class="sig-name descname">help_category</code><em class="property"> = 'general'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.help_category" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.lock_storage">
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'no_prefix': ' ?', 'tags': '', 'text': &quot;\n Get help.\n\n Usage:\n help\n help &lt;topic, command or category&gt;\n help &lt;topic&gt;/&lt;subtopic&gt;\n help &lt;topic&gt;/&lt;subtopic&gt;/&lt;subsubtopic&gt; ...\n\n Use the 'help' command alone to see an index of all help topics, organized\n by category. Some big topics may offer additional sub-topics.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="evennia.commands.default.help.CmdSetHelp">
<em class="property">class </em><code class="sig-prename descclassname">evennia.commands.default.help.</code><code class="sig-name descname">CmdSetHelp</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdSetHelp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.commands.default.help.CmdHelp" title="evennia.commands.default.help.CmdHelp"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.help.CmdHelp</span></code></a></p>
<p>Edit the help database.</p>
<dl class="simple">
<dt>Usage:</dt><dd><p>sethelp[/switches] &lt;topic&gt;[[;alias;alias][,category[,locks]] [= &lt;text&gt;]</p>
</dd>
<dt>Switches:</dt><dd><p>edit - open a line editor to edit the topics help text.
replace - overwrite existing help topic.
append - add text to the end of existing topic with a newline between.
extend - as append, but dont add a newline.
delete - remove help topic.</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>sethelp lore = In the beginning was …
sethelp/append pickpocketing,Thievery = This steals …
sethelp/replace pickpocketing, ,attr(is_thief) = This steals …
sethelp/edit thievery</p>
<p>If not assigning a category, the <strong>settings.DEFAULT_HELP_CATEGORY</strong> category
will be used. If no lockstring is specified, everyone will be able to read
the help entry. Sub-topics are embedded in the help text.</p>
<p>Note that this cannot modify command-help entries - these are modified
in-code, outside the game.</p>
<p>Subtopics helps to break up a long help entry into sub-sections. Users can
access subtopics with <a href="#id1"><span class="problematic" id="id2">|</span></a>whelp topic/subtopic/…|n Subtopics are created and
stored together with the main topic.</p>
<p>To start adding subtopics, add the text # SUBTOPICS on a new line at the
end of your help text. After this you can now add any number of subtopics,
each starting with ## &lt;subtopic-name&gt; on a line, followed by the
help-text of that subtopic.
Use ### &lt;subsub-name&gt; to add a sub-subtopic and so on. Max depth is 5. A
subtopics title is case-insensitive and can consist of multiple words -
the user will be able to enter a partial match to access it.</p>
<p>For example:</p>
<div class="line-block">
<div class="line">Main help text for &lt;topic&gt;</div>
<div class="line"><br /></div>
<div class="line"># SUBTOPICS</div>
<div class="line"><br /></div>
<div class="line">## about</div>
<div class="line"><br /></div>
<div class="line">Text for the &lt;topic&gt;/about subtopic</div>
<div class="line"><br /></div>
<div class="line">### more about-info</div>
<div class="line"><br /></div>
<div class="line">Text for the &lt;topic&gt;/about/more about-info sub-subtopic</div>
<div class="line"><br /></div>
<div class="line">## extra</div>
<div class="line"><br /></div>
<div class="line">Text for the &lt;topic&gt;/extra subtopic</div>
</div>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.key">
<code class="sig-name descname">key</code><em class="property"> = 'sethelp'</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = []</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.switch_options">
<code class="sig-name descname">switch_options</code><em class="property"> = ('edit', 'replace', 'append', 'extend', 'delete')</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.switch_options" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.locks">
<code class="sig-name descname">locks</code><em class="property"> = 'cmd:perm(Helper)'</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.locks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.help_category">
<code class="sig-name descname">help_category</code><em class="property"> = 'building'</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.help_category" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.arg_regex">
<code class="sig-name descname">arg_regex</code><em class="property"> = None</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.arg_regex" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdSetHelp.parse">
<code class="sig-name descname">parse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdSetHelp.parse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.parse" title="Permalink to this definition"></a></dt>
<dd><p>We want to use the default parser rather than the CmdHelp.parse</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdSetHelp.func">
<code class="sig-name descname">func</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdSetHelp.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.func" title="Permalink to this definition"></a></dt>
<dd><p>Implement the function</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.lock_storage">
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(Helper)'</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'sethelp', 'no_prefix': ' ', 'tags': '', 'text': &quot;\n Edit the help database.\n\n Usage:\n sethelp[/switches] &lt;topic&gt;[[;alias;alias][,category[,locks]] [= &lt;text&gt;]\n\n Switches:\n edit - open a line editor to edit the topic's help text.\n replace - overwrite existing help topic.\n append - add text to the end of existing topic with a newline between.\n extend - as append, but don't add a newline.\n delete - remove help topic.\n\n Examples:\n sethelp lore = In the beginning was ...\n sethelp/append pickpocketing,Thievery = This steals ...\n sethelp/replace pickpocketing, ,attr(is_thief) = This steals ...\n sethelp/edit thievery\n\n If not assigning a category, the `settings.DEFAULT_HELP_CATEGORY` category\n will be used. If no lockstring is specified, everyone will be able to read\n the help entry. Sub-topics are embedded in the help text.\n\n Note that this cannot modify command-help entries - these are modified\n in-code, outside the game.\n\n # SUBTOPICS\n\n ## Adding subtopics\n\n Subtopics helps to break up a long help entry into sub-sections. Users can\n access subtopics with |whelp topic/subtopic/...|n Subtopics are created and\n stored together with the main topic.\n\n To start adding subtopics, add the text '# SUBTOPICS' on a new line at the\n end of your help text. After this you can now add any number of subtopics,\n each starting with '## &lt;subtopic-name&gt;' on a line, followed by the\n help-text of that subtopic.\n Use '### &lt;subsub-name&gt;' to add a sub-subtopic and so on. Max depth is 5. A\n subtopic's title is case-insensitive and can consist of multiple words -\n the user will be able to enter a partial match to access it.\n\n For example:\n\n | Main help text for &lt;topic&gt;\n |\n | # SUBTOPICS\n |\n | ## about\n |\n | Text for the '&lt;topic&gt;/about' subtopic'\n |\n | ### more about-info\n |\n | Text for the '&lt;topic&gt;/about/more about-info sub-subtopic\n |\n | ## extra\n |\n | Text for the '&lt;topic&gt;/extra' subtopic\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
</div>
</div>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="evennia.commands.default.muxcommand.html" title="evennia.commands.default.muxcommand"
>next</a> |</li>
<li class="right" >
<a href="evennia.commands.default.general.html" title="evennia.commands.default.general"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 3.x</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> &#187;</li>
<li class="nav-item nav-item-4"><a href="evennia.commands.html" >evennia.commands</a> &#187;</li>
<li class="nav-item nav-item-5"><a href="evennia.commands.default.html" >evennia.commands.default</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.commands.default.help</a></li>
</ul>
</div>
<div class="admonition important">
<p class="first admonition-title">Note</p>
<p class="last">You are reading an old version of the Evennia documentation. <a href="https://www.evennia.com/docs/latest/index.html">The latest version is here</a></p>.
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2023, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>