Merge pull request #108 from stisa/fix-#102

Use rst.txt as help file - Fix #102
This commit is contained in:
Dominik Picheta 2017-10-23 19:29:16 +01:00 • committed by GitHub
commit 42d38de17a
4 changed files with 42 additions and 22 deletions

View file

@ -485,7 +485,7 @@
<div id="markhelp"> <div id="markhelp">
<p>nimforum uses a slightly-customized version of <p>nimforum uses a slightly-customized version of
<a href="http://www.sphinx-doc.org/en/stable/rest.html">reStructuredText</a> for formatting. See below for some basics, or check <a href="http://www.sphinx-doc.org/en/stable/rest.html">reStructuredText</a> for formatting. See below for some basics, or check
<a href="http://nim-lang.org/rst.html">this link</a> for a more detailed help reference.</p> <a href="/rst">this link</a> for a more detailed help reference.</p>
<table class="rst"> <table class="rst">
<tbody> <tbody>
<tr class="markheading"> <tr class="markheading">

View file

@ -1346,6 +1346,8 @@ routes:
resp genMain(c, page) resp genMain(c, page)
get "/search-help": get "/search-help":
textPage "static/search-help" textPage "static/search-help"
get "/rst":
textPage "static/rst"
when isMainModule: when isMainModule:
randomize() randomize()

View file

@ -9,7 +9,19 @@ body {
font: 13pt Helvetica,Arial,sans-serif; font: 13pt Helvetica,Arial,sans-serif;
background:#152534 url("/images/bg.png") no-repeat fixed center top; } background:#152534 url("/images/bg.png") no-repeat fixed center top; }
pre { color: #F5F5F5;} pre {
color: #F5F5F5;
overflow:auto;
margin:0;
padding:15px 10px;
font-size:10pt;
font-style:normal;
line-height:14pt;
background:rgba(0,0,0,.75);
border-left:8px solid rgba(0,0,0,.3);
margin-bottom: 10pt;
font-family: "DejaVu Sans Mono", monospace;
}
pre, pre * { cursor:text; } pre, pre * { cursor:text; }
pre .Comment { color:#6D6D6D; font-style:italic; } pre .Comment { color:#6D6D6D; font-style:italic; }
pre .Keyword { color:#43A8CF; font-weight:bold; } pre .Keyword { color:#43A8CF; font-weight:bold; }

View file

@ -1,9 +1,8 @@
=========================================================================== reStructuredText cheat sheet
reStructuredText cheat sheet
=========================================================================== ===========================================================================
This is a cheat sheet for the *reStructuredText* dialect as implemented by This is a cheat sheet for the *reStructuredText* dialect as implemented by
Nimrod's documentation generator which has been reused for this forum. :-) Nim's documentation generator which has been reused for this forum.
See also the See also the
`official RST cheat sheet <http://docutils.sourceforge.net/docs/user/rst/cheatsheet.txt>`_ `official RST cheat sheet <http://docutils.sourceforge.net/docs/user/rst/cheatsheet.txt>`_
@ -14,7 +13,7 @@ Elements of **markdown** are also supported.
Inline elements Inline elements
=============== ---------------
Ordinary text may contain *inline elements*: Ordinary text may contain *inline elements*:
@ -30,24 +29,24 @@ Plain text Result
=============================== ============================================ =============================== ============================================
Links Links
===== -----
Links are either direct URLs like ``http://nimrod-lang.org`` or written like Links are either direct URLs like ``https://nim-lang.org`` or written like
this:: this::
`Nimrod <http://nimrod-lang.org>`_ `Nim <https://nim-lang.org>`_
Or like this:: Or like this::
`<http://nimrod-lang.org>`_ `<https://nim-lang.org>`_
Code blocks Code blocks
=========== -----------
are done this way:: are done this way::
.. code-block:: nimrod .. code-block:: nim
if x == "abc": if x == "abc":
echo "xyz" echo "xyz"
@ -55,25 +54,25 @@ are done this way::
Is rendered as: Is rendered as:
.. code-block:: nimrod .. code-block:: nim
if x == "abc": if x == "abc":
echo "xyz" echo "xyz"
Except Nimrod, the programming languages C, C++, Java and C# have highlighting Except Nim, the programming languages C, C++, Java and C# have highlighting
support. support.
An alternative github-like syntax is also supported. This has the advantage An alternative github-like syntax is also supported. This has the advantage
that no excessive indentation is needed:: that no excessive indentation is needed::
```nimrod ```nim
if x == "abc": if x == "abc":
echo "xyz"``` echo "xyz"```
Is rendered as: Is rendered as:
.. code-block:: nimrod .. code-block:: nim
if x == "abc": if x == "abc":
echo "xyz" echo "xyz"
@ -81,7 +80,7 @@ Is rendered as:
Literal blocks Literal blocks
============== --------------
Are introduced by '::' and a newline. The block is indicated by indentation: Are introduced by '::' and a newline. The block is indicated by indentation:
@ -98,7 +97,7 @@ Is rendered as::
Bullet lists Bullet lists
============ ------------
look like this:: look like this::
@ -123,7 +122,7 @@ Is rendered as:
Enumerated lists Enumerated lists
================ ----------------
are written like this:: are written like this::
@ -143,7 +142,7 @@ Is rendered as:
Quoting someone Quoting someone
=============== ---------------
quotes are just:: quotes are just::
@ -160,7 +159,7 @@ Is rendered as:
Definition lists Definition lists
================ ----------------
are written like this:: are written like this::
@ -190,7 +189,7 @@ how
Tables Tables
====== ------
Only *simple tables* are supported. They are of the form:: Only *simple tables* are supported. They are of the form::
@ -218,3 +217,10 @@ Cell 4 Cell 5; any Cell 6
multiple lines multiple lines
Cell 7 Cell 8 Cell 9 Cell 7 Cell 8 Cell 9
================== =============== =================== ================== =============== ===================
Images
------
```
.. image:: path/to/img.png
```