evennia/docs/1.0-dev/Contributing-Docs.html
2020-06-15 21:52:33 +02:00

779 lines
No EOL
46 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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Evennia docs &#8212; Evennia 1.0-dev 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" />
</head><body>
<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="nav-item nav-item-0"><a href="index.html">Evennia 1.0-dev documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="evennia-docs">
<h1>Evennia docs<a class="headerlink" href="#evennia-docs" title="Permalink to this headline"></a></h1>
<p>Documentation for the Evennia MUD creation system.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>WARNING: This system is still WIP and many things are bound to change!</p>
</div>
<p>The live documentation is (or will in the future be) available at
<a class="reference external" href="https://evennia.github.io/evennia/latest">https://evennia.github.io/evennia/latest</a>.</p>
<div class="section" id="editing-the-docs">
<h2>Editing the docs<a class="headerlink" href="#editing-the-docs" title="Permalink to this headline"></a></h2>
<p>The documentation source files are <code class="docutils literal notranslate"><span class="pre">*.md</span></code> (Markdown) files found in <code class="docutils literal notranslate"><span class="pre">evennia/docs/source/</span></code>.
Markdown files are simple text files that can be edited with a normal text editor. They can also
contain raw HTML directives (but that is very rarely needed). They primarly use
the <a class="reference external" href="https://spec.commonmark.org/current/">Markdown</a> syntax. See <a class="reference external" href="#Editing-syntax">the syntax section below</a> for more help.</p>
<blockquote>
<div><p>Note: Dont edit the files in <code class="docutils literal notranslate"><span class="pre">source/api/</span></code>. These are auto-generated and your changes
will be lost.</p>
</div></blockquote>
<div class="section" id="contributing-to-docs">
<h3>Contributing to docs<a class="headerlink" href="#contributing-to-docs" title="Permalink to this headline"></a></h3>
<p>Contributing to the docs is is like <a class="reference internal" href="Contributing.html"><span class="doc">contributing to the rest of Evennia</span></a>:
Check out the branch of Evennia you want to edit the documentation for. Create your
own work-branch, make your changes to files in <code class="docutils literal notranslate"><span class="pre">evennia/docs/source/</span></code> and make a PR for it!</p>
</div>
</div>
<div class="section" id="building-the-docs-locally">
<h2>Building the docs locally<a class="headerlink" href="#building-the-docs-locally" title="Permalink to this headline"></a></h2>
<p>The sources in <code class="docutils literal notranslate"><span class="pre">evennia/docs/source/</span></code> are built into a pretty documentation using
the <a class="reference external" href="https://www.sphinx-doc.org/en/master/">Sphinx</a> static generator system. To do so locally you need to either
use a system with <code class="docutils literal notranslate"><span class="pre">make</span></code> (Linux/Unix/Mac or <a class="reference external" href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">Windows-WSL</a>). Lacking that, you could
in principle also run the sphinx build-commands manually - read the <code class="docutils literal notranslate"><span class="pre">evennia/docs/Makefile</span></code> to see
which commands are run by <code class="docutils literal notranslate"><span class="pre">make</span></code>.</p>
<p>You dont necessarily <em>have</em> to build the docs locally to contribute. But
building them allows you to check for yourself that syntax is correct and that
your change comes out looking as you expected.</p>
<div class="section" id="building-only-the-main-documentation">
<h3>Building only the main documentation<a class="headerlink" href="#building-only-the-main-documentation" title="Permalink to this headline"></a></h3>
<p>If you only want to build the main documentation pages (not the API auto-docs),
you dont need to install Evennia itself, only the documentation resources.
All is done in your terminal/console.</p>
<ul>
<li><p>(Optional, but recommended): Activate a virtualenv with Python 3.7.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cd</span></code> to into the <code class="docutils literal notranslate"><span class="pre">evennia/docs</span></code> folder.</p></li>
<li><p>Install the documentation-build requirements:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">install</span>
<span class="ow">or</span>
<span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">r</span> <span class="n">requirements</span><span class="o">.</span><span class="n">txt</span>
</pre></div>
</div>
</li>
<li><p>Next, build the html-based documentation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">quick</span>
</pre></div>
</div>
</li>
<li><p>The html-based documentation will appear in the new
folder <code class="docutils literal notranslate"><span class="pre">evennia/docs/build/html/</span></code>. Note any errors from files you have edited.</p></li>
<li><p>Use a web browser to open <code class="docutils literal notranslate"><span class="pre">file://&lt;path-to-folder&gt;/evennia/docs/build/html/index.html</span></code> and view
the docs. Note that you will get errors if clicking a link to the auto-docs, because you didnt
build them!</p></li>
</ul>
</div>
<div class="section" id="building-the-main-documentation-and-api-docs">
<h3>Building the main documentation and API docs<a class="headerlink" href="#building-the-main-documentation-and-api-docs" title="Permalink to this headline"></a></h3>
<p>The full documentation includes both the doc pages and the API documentation
generated from the Evennia source. For this you must install Evennia and
initialize a new game with a default database (you dont need to have it
running)</p>
<ul>
<li><p>Follow the normal <a class="reference internal" href="Getting-Started.html"><span class="doc">Evennia Getting-Started instructions</span></a>
to install Evennia into a virtualenv. Get back here once everything is installed but
before creating a new game.</p></li>
<li><p>Make sure you <code class="docutils literal notranslate"><span class="pre">cd</span></code> to the folder <em>containing</em> your <code class="docutils literal notranslate"><span class="pre">evennia/</span></code> repo (so two levels
up from <code class="docutils literal notranslate"><span class="pre">evennia/docs/</span></code>).</p></li>
<li><p>Create a new game folder called exactly <code class="docutils literal notranslate"><span class="pre">gamedir</span></code> at the same level as your <code class="docutils literal notranslate"><span class="pre">evennia</span></code>
repo with</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">evennia</span> <span class="o">--</span><span class="n">init</span> <span class="n">gamedir</span>
</pre></div>
</div>
</li>
<li><p>Then <code class="docutils literal notranslate"><span class="pre">cd</span></code> into it and create a new, empty database. You dont need to start the game
or do any further changes.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">evennia</span> <span class="n">migrate</span>
</pre></div>
</div>
</li>
<li><p>This is how the structure should look at this point:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">(</span><span class="n">top</span><span class="p">)</span>
<span class="o">|</span>
<span class="o">-----</span> <span class="n">evennia</span><span class="o">/</span> <span class="p">(</span><span class="n">the</span> <span class="n">top</span><span class="o">-</span><span class="n">level</span> <span class="n">folder</span><span class="p">,</span> <span class="n">containing</span> <span class="n">docs</span><span class="o">/</span><span class="p">)</span>
<span class="o">|</span>
<span class="o">-----</span> <span class="n">gamedir</span><span class="o">/</span>
</pre></div>
</div>
</li>
</ul>
<p>If you are already working on a game, you may of course have your real game folder there as
well. We wont touch that.</p>
<ul>
<li><p>Make sure you are still in your virtualenv, then go to <code class="docutils literal notranslate"><span class="pre">evennia/docs/</span></code> and
install the doc-building requirements:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">install</span>
<span class="ow">or</span>
<span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">r</span> <span class="n">requirements</span><span class="o">.</span><span class="n">txt</span>
</pre></div>
</div>
</li>
<li><p>Finally, build the full documentation, including the auto-docs:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">local</span>
</pre></div>
</div>
</li>
<li><p>The rendered files will appear in a new folder <code class="docutils literal notranslate"><span class="pre">evennia/docs/build/html/</span></code>.
Note any errors from files you have edited.</p></li>
<li><p>Point your web browser to <code class="docutils literal notranslate"><span class="pre">file://&lt;path-to-folder&gt;/evennia/docs/build/html/index.html</span></code> to
view the full docs.</p></li>
</ul>
<div class="section" id="building-with-another-gamedir">
<h4>Building with another gamedir<a class="headerlink" href="#building-with-another-gamedir" title="Permalink to this headline"></a></h4>
<p>If you for some reason want to use another location of your <code class="docutils literal notranslate"><span class="pre">gamedir/</span></code>, or want it
named something else (maybe you already use the name gamedir for your development …),
you can do so by setting the <code class="docutils literal notranslate"><span class="pre">EVGAMEDIR</span></code> environment variable to the absolute path
of your alternative game dir. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">EVGAMEDIR</span><span class="o">=/</span><span class="n">my</span><span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">mygamedir</span> <span class="n">make</span> <span class="n">local</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="building-for-release">
<h3>Building for release<a class="headerlink" href="#building-for-release" title="Permalink to this headline"></a></h3>
<p>The full Evennia documentation contains docs from many Evennia
versions, old and new. This is done by pulling documentation from Evennias old release
branches and building them all so readers can choose which one to view. Only
specific official Evennia branches will be built, so you cant use this to
build your own testing branch.</p>
<ul>
<li><p>All local changes must have been committed to git first, since the versioned
docs are built by looking at the git tree.</p></li>
<li><p>To build for local checking, run (<code class="docutils literal notranslate"><span class="pre">mv</span></code> stands for “multi-version”):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">mv</span><span class="o">-</span><span class="n">local</span>
</pre></div>
</div>
</li>
</ul>
<p>This is as close to the real version as you can get locally. The different versions
will be found under <code class="docutils literal notranslate"><span class="pre">evennia/docs/build</span></code>. During deploy a symlink <code class="docutils literal notranslate"><span class="pre">latest</span></code> will point
to the latest version of the docs.</p>
<div class="section" id="release">
<h4>Release<a class="headerlink" href="#release" title="Permalink to this headline"></a></h4>
<p>Releasing the official docs requires git-push access the the Evennia <code class="docutils literal notranslate"><span class="pre">gh-pages</span></code> branch
on <code class="docutils literal notranslate"><span class="pre">github</span></code>. So there is no risk of you releasing your local changes accidentally.</p>
<ul>
<li><p>To deploy docs in two steps</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">mv</span><span class="o">-</span><span class="n">local</span>
<span class="n">make</span> <span class="n">deploy</span>
</pre></div>
</div>
</li>
<li><p>If you know what you are doing you can also do build + deploy in one step:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">release</span>
</pre></div>
</div>
</li>
</ul>
<p>After deployment finishes, the updated live documentation will be
available at https://evennia.github.io/evennia/latest/.</p>
</div>
</div>
</div>
</div>
<div class="section" id="editing-syntax">
<h1>Editing syntax<a class="headerlink" href="#editing-syntax" title="Permalink to this headline"></a></h1>
<p>The format used for Evennias docs is <a class="reference external" href="https://commonmark.org/help/">Markdown</a> (Commonmark). While markdown supports a
few alternative forms for some of these, we try to stick to the below forms for consistency.</p>
<div class="section" id="italic-bold">
<h2>Italic/Bold<a class="headerlink" href="#italic-bold" title="Permalink to this headline"></a></h2>
<p>We generally use underscores for italics and double-asterisks for bold:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">_Italic</span> <span class="pre">text_</span></code> - <em>Italic text</em></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">**Bold</span> <span class="pre">Text**</span></code> - <strong>Bold text</strong></p></li>
</ul>
</div>
<div class="section" id="headings">
<h2>Headings<a class="headerlink" href="#headings" title="Permalink to this headline"></a></h2>
<p>We use <code class="docutils literal notranslate"><span class="pre">#</span></code> to indicate sections/headings. The more <code class="docutils literal notranslate"><span class="pre">#</span></code> the more of a sub-heading it is (will get smaller
and smaller font).</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">#</span> <span class="pre">Heading</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">##</span> <span class="pre">SubHeading</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">##</span> <span class="pre">SubSubHeading</span></code></p></li>
</ul>
<blockquote>
<div><p>Dont reuse the same heading/subheading name over and over in the same document. While Markdown does not prevent
it, it makes it impossible to link to those duplicates properly (see next section).</p>
</div></blockquote>
</div>
<div class="section" id="lists">
<h2>Lists<a class="headerlink" href="#lists" title="Permalink to this headline"></a></h2>
<p>One can create both bullet-point lists and numbered lists:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span> <span class="n">first</span> <span class="n">bulletpoint</span>
<span class="o">-</span> <span class="n">second</span> <span class="n">bulletpoint</span>
<span class="o">-</span> <span class="n">third</span> <span class="n">bulletpoint</span>
</pre></div>
</div>
<ul class="simple">
<li><p>first bulletpoint</p></li>
<li><p>second bulletpoint</p></li>
<li><p>third bulletpoint</p></li>
</ul>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mf">1.</span> <span class="n">Numbered</span> <span class="n">point</span> <span class="n">one</span>
<span class="mf">2.</span> <span class="n">Numbered</span> <span class="n">point</span> <span class="n">two</span>
<span class="mf">3.</span> <span class="n">Numbered</span> <span class="n">point</span> <span class="n">three</span>
</pre></div>
</div>
<ol class="simple">
<li><p>Numbered point one</p></li>
<li><p>Numbered point two</p></li>
<li><p>Numbered point three</p></li>
</ol>
</div>
<div class="section" id="notes">
<h2>Notes<a class="headerlink" href="#notes" title="Permalink to this headline"></a></h2>
<p>A note can be used to enphasise important things. Its added by starting one or more lines with <code class="docutils literal notranslate"><span class="pre">&gt;</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&gt;</span> <span class="n">Note</span><span class="p">:</span> <span class="n">This</span> <span class="ow">is</span> <span class="n">an</span> <span class="n">important</span>
<span class="o">&gt;</span> <span class="n">thing</span> <span class="n">to</span> <span class="n">remember</span><span class="o">.</span>
</pre></div>
</div>
<blockquote>
<div><p>Note: This is an important
thing to remember.</p>
</div></blockquote>
</div>
<div class="section" id="links">
<h2>Links<a class="headerlink" href="#links" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[linktext](url_or_ref)</span></code> - gives a clickable link <a class="reference external" href="#Links">linktext</a>.</p></li>
</ul>
<p>The <code class="docutils literal notranslate"><span class="pre">url_or_ref</span></code> can either be a full <code class="docutils literal notranslate"><span class="pre">http://...</span></code> url or an internal <em>reference</em>. For example, use
<code class="docutils literal notranslate"><span class="pre">[my</span> <span class="pre">document](My-Document)</span></code> to link to the document <code class="docutils literal notranslate"><span class="pre">evennia/docs/source/My-Document.md</span></code>. Avoid using
full <code class="docutils literal notranslate"><span class="pre">http://</span></code> linking unless really referring to an external resource.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[linktext](ref#heading-name)</span></code></p></li>
</ul>
<p>You can point to sub-sections (headings) in a document by using a single <code class="docutils literal notranslate"><span class="pre">#</span></code> and the name of the
heading, replacing spaces with dashes. So to refer to a heading <code class="docutils literal notranslate"><span class="pre">##</span> <span class="pre">Cool</span> <span class="pre">Stuff</span></code> inside <code class="docutils literal notranslate"><span class="pre">My-Document</span></code>
would be a link <code class="docutils literal notranslate"><span class="pre">[cool</span> <span class="pre">stuff](My-Document#Cool-Stuff)</span></code>.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[linktext][linkref]</span></code> - refer to a reference defined later in the document.</p></li>
</ul>
<p>Urls can get long and if you are using the same url in many places it can get a little cluttered. So you can also put
the url as a footnote at the end of your document
and refer to it by putting your reference within square brackets <code class="docutils literal notranslate"><span class="pre">[</span> <span class="pre">]</span></code>. Heres an example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">This</span> <span class="ow">is</span> <span class="n">a</span> <span class="p">[</span><span class="n">clickable</span> <span class="n">link</span><span class="p">][</span><span class="n">mylink</span><span class="p">]</span><span class="o">.</span> <span class="n">This</span> <span class="ow">is</span> <span class="p">[</span><span class="n">another</span> <span class="n">link</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span>
<span class="o">...</span>
<span class="p">[</span><span class="n">mylink</span><span class="p">]:</span> <span class="n">http</span><span class="p">:</span><span class="o">//...</span>
<span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="n">My</span><span class="o">-</span><span class="n">Document</span>
</pre></div>
</div>
<div class="section" id="special-references">
<h3>Special references<a class="headerlink" href="#special-references" title="Permalink to this headline"></a></h3>
<p>The Evennia documentation supports some special reference shortcuts in links:</p>
<div class="section" id="github-online-repository">
<h4>Github online repository<a class="headerlink" href="#github-online-repository" title="Permalink to this headline"></a></h4>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">github:</span></code> - a shortcut for the full path to the Evennia repository on github. This will refer to
the <code class="docutils literal notranslate"><span class="pre">master</span></code> branch by default:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="n">link</span> <span class="n">to</span> <span class="n">objects</span><span class="o">.</span><span class="n">py</span><span class="p">](</span><span class="n">github</span><span class="p">:</span><span class="n">evennia</span><span class="o">/</span><span class="n">objects</span><span class="o">/</span><span class="n">objects</span><span class="o">.</span><span class="n">py</span><span class="p">)</span>
</pre></div>
</div>
<p>This will remap to https://github.com/evennia/evennia/blob/master/evennia/objects/objects.py.</p>
</li>
<li><p>To refer to the <code class="docutils literal notranslate"><span class="pre">develop</span></code> branch, start the url with <code class="docutils literal notranslate"><span class="pre">develop/</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="n">link</span> <span class="n">to</span> <span class="n">objects</span><span class="o">.</span><span class="n">py</span><span class="p">](</span><span class="n">github</span><span class="p">:</span><span class="n">develop</span><span class="o">/</span><span class="n">evennia</span><span class="o">/</span><span class="n">objects</span><span class="o">/</span><span class="n">objects</span><span class="o">.</span><span class="n">py</span><span class="p">)</span>
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="api">
<h4>API<a class="headerlink" href="#api" title="Permalink to this headline"></a></h4>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">api:</span></code> - references a path in the api documentation. This is specified as a Python-path:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="n">link</span> <span class="n">to</span> <span class="n">api</span> <span class="k">for</span> <span class="n">objects</span><span class="o">.</span><span class="n">py</span><span class="p">](</span><span class="n">api</span><span class="p">:</span><span class="n">evennia</span><span class="o">.</span><span class="n">objects</span><span class="p">)</span>
</pre></div>
</div>
<p>This will create a link to the auto-generated <code class="docutils literal notranslate"><span class="pre">evennia/source/api/evennia.objects.rst</span></code> document.</p>
<p>Since api-docs are generated alongside the documentation, this will always be the api docs for the
current version/branch of the docs.</p>
</li>
</ul>
</div>
<div class="section" id="bug-reports-feature-request">
<h4>Bug reports/feature request<a class="headerlink" href="#bug-reports-feature-request" title="Permalink to this headline"></a></h4>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">issue</span></code>, <code class="docutils literal notranslate"><span class="pre">bug-report</span></code>, <code class="docutils literal notranslate"><span class="pre">feature-request</span></code> - links to the same github issue select page.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> If you find a problem, make a [bug report](issue)!
</pre></div>
</div>
<p>This will generate a link to https://github.com/evennia/evennia/issues/new/choose.</p>
</li>
</ul>
<blockquote>
<div><p>For some reason these particular shortcuts gives a warning during documentation compilation. This
can be ignored.</p>
</div></blockquote>
</div>
</div>
</div>
<div class="section" id="verbatim-text">
<h2>Verbatim text<a class="headerlink" href="#verbatim-text" title="Permalink to this headline"></a></h2>
<p>Its common to want to mark something to be displayed verbatim - just as written - without any
Markdown parsing. In running text, this is done using backticks (`), like `verbatim text` becomes <code class="docutils literal notranslate"><span class="pre">verbatim</span> <span class="pre">text</span></code>.</p>
<p>If you want to put the verbatim text on its own line, you can do so easily by simply indenting
it 4 spaces (add empty lines on each side for readability too):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">This</span> <span class="ow">is</span> <span class="n">normal</span> <span class="n">text</span>
<span class="n">This</span> <span class="ow">is</span> <span class="n">verbatim</span> <span class="n">text</span>
<span class="n">This</span> <span class="ow">is</span> <span class="n">normal</span> <span class="n">text</span>
</pre></div>
</div>
<p>Another way is to use triple-backticks:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```
Everything within these backticks will be verbatim.
```
</pre></div>
</div>
</div>
<div class="section" id="code-blocks">
<h2>Code blocks<a class="headerlink" href="#code-blocks" title="Permalink to this headline"></a></h2>
<p>A special case is code examples - we want them to get code-highlighting for readability. This is done by using
the triple-backticks and specify which language we use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```python
def a_python_func(x):
return x * x
```
</pre></div>
</div>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4</pre></div></td><td class="code"><div class="highlight"><pre><span></span>
<span class="k">def</span> <span class="nf">a_python_func</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
<span class="k">return</span> <span class="n">x</span> <span class="o">*</span> <span class="n">x</span>
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="rest-blocks">
<h2>ReST blocks<a class="headerlink" href="#rest-blocks" title="Permalink to this headline"></a></h2>
<p>Markdown is easy to read and use. But while it does most of what we need, there are some things its
not quite as expressive as it needs to be. For this we need to fall back to the <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html">ReST</a> markup
language which the documentation system uses under the hood. This is done by specifying <code class="docutils literal notranslate"><span class="pre">eval_rst</span></code> as
the name of the <code class="docutils literal notranslate"><span class="pre">language</span></code> of a literal block:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```eval_rst
This will be evaluated as ReST.
```
</pre></div>
</div>
<p>There is also a short-hand form for starting a <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restruturedtext/directives.html">ReST directive</a> without need for <code class="docutils literal notranslate"><span class="pre">eval_rst</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```directive:: possible-option
Content that *must* be indented for it to be included in the directive.
New lines are ignored except if separated by an empty line.
```
</pre></div>
</div>
<p>See below for examples of this.</p>
<div class="section" id="note">
<h3>Note<a class="headerlink" href="#note" title="Permalink to this headline"></a></h3>
<p>This kind of note may pop even more than a normal <code class="docutils literal notranslate"><span class="pre">&gt;</span> <span class="pre">note</span></code>. It may however also make the test
feel more busy, so use with care.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```note::
Remember that ...
```
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Remember that …</p>
</div>
</div>
<div class="section" id="important">
<h3>Important<a class="headerlink" href="#important" title="Permalink to this headline"></a></h3>
<p>This is for particularly important and visible notes.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```important::
This is important because it is!
```
</pre></div>
</div>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>This is important because it is!</p>
</div>
</div>
<div class="section" id="warning">
<h3>Warning<a class="headerlink" href="#warning" title="Permalink to this headline"></a></h3>
<p>A warning block is used to draw attention to particularly dangerous things, or features easy to
mess up.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```warning::
Be careful about this ...
```
</pre></div>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Be careful about this …</p>
</div>
</div>
<div class="section" id="version-changes-and-deprecations">
<h3>Version changes and deprecations<a class="headerlink" href="#version-changes-and-deprecations" title="Permalink to this headline"></a></h3>
<p>These will show up as one-line warnings that suggest an added, changed or deprecated
feature beginning with particular version.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```versionadded:: 1.0
```
</pre></div>
</div>
<div class="versionadded">
<p><span class="versionmodified added">New in version 1.0.</span></p>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```versionchanged:: 1.0
How the feature changed with this version.
```
</pre></div>
</div>
<div class="versionchanged">
<p><span class="versionmodified changed">Changed in version 1.0: </span>How the feature changed with this version.</p>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```deprecated:: 1.0
```
</pre></div>
</div>
<div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 1.0.</span></p>
</div>
</div>
<div class="section" id="sidebar">
<h3>Sidebar<a class="headerlink" href="#sidebar" title="Permalink to this headline"></a></h3>
<p>This will display an informative sidebar that floats to the side of regular content. This is useful
for example to remind the reader of some concept relevant to the text.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```sidebar:: Things to remember
- There can be bullet lists
- in here.
Headers:
with indented blocks like this
Will end up:
as full sub-headings in the sidebar.
```
</pre></div>
</div>
<div class="sidebar">
<p class="sidebar-title">Things to remember</p>
<ul class="simple">
<li><p>There can be bullet lists</p></li>
<li><p>in here.</p></li>
</ul>
<dl class="simple">
<dt>Headers:</dt><dd><p>with indented blocks like this</p>
</dd>
<dt>Will end up:</dt><dd><p>as full sub-headings in the sidebar.</p>
</dd>
</dl>
</div>
<p>Remember that for ReST-directives, the content within the triple-backticks <em>must</em> be indented to
some degree or the content will just appear outside of the directive as regular text.</p>
<p>If wanting to make sure to have the next header appear on a row of its own, one can embed
a plain HTML string in the markdown like so:</p>
<div class="highlight-html notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">&lt;</span><span class="nt">div</span> <span class="na">style</span><span class="o">=</span><span class="s">&quot;clear: right;&quot;</span><span class="p">&gt;&lt;/</span><span class="nt">div</span><span class="p">&gt;</span>
</pre></div>
</td></tr></table></div>
<div style="clear: right;"></div></div>
<div class="section" id="tables">
<h3>Tables<a class="headerlink" href="#tables" title="Permalink to this headline"></a></h3>
<p>A table is specified using <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#tables">ReST table syntax</a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```eval_rst
===== ===== =======
A B A and B
===== ===== =======
False False False
True False False
False True False
True True True
===== ===== =======
```
</pre></div>
</div>
<table class="docutils align-default">
<colgroup>
<col style="width: 29%" />
<col style="width: 29%" />
<col style="width: 41%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>A</p></th>
<th class="head"><p>B</p></th>
<th class="head"><p>A and B</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>False</p></td>
<td><p>False</p></td>
<td><p>False</p></td>
</tr>
<tr class="row-odd"><td><p>True</p></td>
<td><p>False</p></td>
<td><p>False</p></td>
</tr>
<tr class="row-even"><td><p>False</p></td>
<td><p>True</p></td>
<td><p>False</p></td>
</tr>
<tr class="row-odd"><td><p>True</p></td>
<td><p>True</p></td>
<td><p>True</p></td>
</tr>
</tbody>
</table>
<p>or the more flexible but verbose</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```eval_rst
+------------------------+------------+----------+----------+
| Header row, column 3 | Header 2 | Header 3 | Header 4 |
| (header rows optional) | | | |
+========================+============+==========+==========+
| body row 1, column 1 | column 2 | column 3 | column 4 |
+------------------------+------------+----------+----------+
| body row 2 | ... | ... | |
+------------------------+------------+----------+----------+
```
</pre></div>
</div>
<table class="docutils align-default">
<colgroup>
<col style="width: 43%" />
<col style="width: 21%" />
<col style="width: 18%" />
<col style="width: 18%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Header row, column 3
(header rows optional)</p></th>
<th class="head"><p>Header 2</p></th>
<th class="head"><p>Header 3</p></th>
<th class="head"><p>Header 4</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>body row 1, column 1</p></td>
<td><p>column 2</p></td>
<td><p>column 3</p></td>
<td><p>column 4</p></td>
</tr>
<tr class="row-odd"><td><p>body row 2</p></td>
<td><p></p></td>
<td><p></p></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="a-more-flexible-code-block">
<h3>A more flexible code block<a class="headerlink" href="#a-more-flexible-code-block" title="Permalink to this headline"></a></h3>
<p>The regular Markdown codeblock is usually enough but for more direct control over the style, one
can also specify the code block explicitly in <code class="docutils literal notranslate"><span class="pre">ReST</span></code>.
for more flexibility. It also provides a link to the code block, identified by its name.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>```code-block:: python
:linenos:
:emphasize-lines: 1-2,8
:caption: An example code block
:name: A full code block example
from evennia import Command
class CmdEcho(Command):
&quot;&quot;&quot;
Usage: echo &lt;arg&gt;
&quot;&quot;&quot;
key = &quot;echo&quot;
def func(self):
self.caller.msg(self.args.strip())
```
</pre></div>
</div>
<div class="literal-block-wrapper docutils container" id="a-full-code-block-example">
<div class="code-block-caption"><span class="caption-text">An example code block</span><a class="headerlink" href="#a-full-code-block-example" title="Permalink to this code"></a></div>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4
5
6
7
8</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">Command</span>
<span class="k">class</span> <span class="nc">CmdEcho</span><span class="p">(</span><span class="n">Command</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Usage: echo &lt;arg&gt;</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="hll"> <span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;echo&quot;</span>
</span><span class="hll"> <span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
</span> <span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">strip</span><span class="p">())</span>
</pre></div>
</td></tr></table></div>
</div>
<p>Here, <code class="docutils literal notranslate"><span class="pre">:linenos:</span></code> turns on line-numbers and <code class="docutils literal notranslate"><span class="pre">:emphasize-lines:</span></code> allows for emphasizing certain lines
in a different color. The <code class="docutils literal notranslate"><span class="pre">:caption:</span></code> shows an instructive text and <code class="docutils literal notranslate"><span class="pre">:name:</span></code> is used to reference this
block through the link that will appear (so it should be unique for a give document).</p>
<blockquote>
<div><p>The default markdown syntax will actually generate a code-block ReST instruction like this
automatically for us behind the scenes. The automatic generation cant know things like emphasize-lines
or caption since thats not a part of the Markdown specification.</p>
</div></blockquote>
</div>
</div>
</div>
<div class="section" id="technical">
<h1>Technical<a class="headerlink" href="#technical" title="Permalink to this headline"></a></h1>
<p>Evennia leverages <a class="reference external" href="https://www.sphinx-doc.org/en/master/">Sphinx</a> with the <a class="reference external" href="https://recommonmark.readthedocs.io/en/latest/index.html">recommonmark</a> extension, which allows us to write our
docs in light-weight Markdown (more specifically <a class="reference external" href="https://spec.commonmark.org/current/">CommonMark</a>, like on github) rather than ReST.
The recommonmark extension however also allows us to use ReST selectively in the places were it is more
expressive than the simpler (but much easier) Markdown.</p>
<p>For <a class="reference external" href="http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#module-sphinx.ext.autodoc">autodoc-generation</a> generation, we use the sphinx-<a class="reference external" href="http://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html">napoleon</a> extension
to understand our friendly Google-style docstrings used in classes and functions etc.</p>
</div>
</div>
</div>
</div>
<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>
<p><h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Evennia docs</a><ul>
<li><a class="reference internal" href="#editing-the-docs">Editing the docs</a><ul>
<li><a class="reference internal" href="#contributing-to-docs">Contributing to docs</a></li>
</ul>
</li>
<li><a class="reference internal" href="#building-the-docs-locally">Building the docs locally</a><ul>
<li><a class="reference internal" href="#building-only-the-main-documentation">Building only the main documentation</a></li>
<li><a class="reference internal" href="#building-the-main-documentation-and-api-docs">Building the main documentation and API docs</a><ul>
<li><a class="reference internal" href="#building-with-another-gamedir">Building with another gamedir</a></li>
</ul>
</li>
<li><a class="reference internal" href="#building-for-release">Building for release</a><ul>
<li><a class="reference internal" href="#release">Release</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#editing-syntax">Editing syntax</a><ul>
<li><a class="reference internal" href="#italic-bold">Italic/Bold</a></li>
<li><a class="reference internal" href="#headings">Headings</a></li>
<li><a class="reference internal" href="#lists">Lists</a></li>
<li><a class="reference internal" href="#notes">Notes</a></li>
<li><a class="reference internal" href="#links">Links</a><ul>
<li><a class="reference internal" href="#special-references">Special references</a><ul>
<li><a class="reference internal" href="#github-online-repository">Github online repository</a></li>
<li><a class="reference internal" href="#api">API</a></li>
<li><a class="reference internal" href="#bug-reports-feature-request">Bug reports/feature request</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#verbatim-text">Verbatim text</a></li>
<li><a class="reference internal" href="#code-blocks">Code blocks</a></li>
<li><a class="reference internal" href="#rest-blocks">ReST blocks</a><ul>
<li><a class="reference internal" href="#note">Note</a></li>
<li><a class="reference internal" href="#important">Important</a></li>
<li><a class="reference internal" href="#warning">Warning</a></li>
<li><a class="reference internal" href="#version-changes-and-deprecations">Version changes and deprecations</a></li>
<li><a class="reference internal" href="#sidebar">Sidebar</a></li>
<li><a class="reference internal" href="#tables">Tables</a></li>
<li><a class="reference internal" href="#a-more-flexible-code-block">A more flexible code block</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#technical">Technical</a></li>
</ul>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="_sources/Contributing-Docs.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div>
<h3>Versions</h3>
<ul>
<li><a href="Contributing-Docs.html">1.0-dev (develop branch)</a></li>
<li><a href="../0.9.1/index.html">0.9.1 (master branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></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="nav-item nav-item-0"><a href="index.html">Evennia 1.0-dev documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.4.4.
</div>
</body>
</html>