Implemented an inline rst reference. Ref #75.
This commit is contained in:
parent
b71a08fa21
commit
bb494f0b65
2 changed files with 121 additions and 4 deletions
84
forms.tmpl
84
forms.tmpl
|
|
@ -166,7 +166,8 @@
|
||||||
</div>
|
</div>
|
||||||
#end proc
|
#end proc
|
||||||
#
|
#
|
||||||
#
|
#proc genMarkHelp(): string
|
||||||
|
#end proc
|
||||||
#proc genFormPost(c: var TForumData, action: string,
|
#proc genFormPost(c: var TForumData, action: string,
|
||||||
# topText, title, content: string, isEdit: bool): string =
|
# topText, title, content: string, isEdit: bool): string =
|
||||||
# result = ""
|
# result = ""
|
||||||
|
|
@ -202,10 +203,11 @@
|
||||||
</div>
|
</div>
|
||||||
#end if
|
#end if
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<input type="submit" name="previewBtn" value="Preview" />
|
<input type="submit" name="previewBtn" value="Preview" />
|
||||||
<input type="submit" name="postBtn" value="Submit" />
|
<input type="submit" name="postBtn" value="Submit" />
|
||||||
|
|
||||||
<a href="http://nim-lang.org/rst.html">Syntax Cheatsheet</a>
|
${genMarkHelp()}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
#end proc
|
#end proc
|
||||||
|
|
@ -397,3 +399,81 @@
|
||||||
<input type="submit" value="Email me">
|
<input type="submit" value="Email me">
|
||||||
</form>
|
</form>
|
||||||
#end proc
|
#end proc
|
||||||
|
#proc genMarkHelp(): string =
|
||||||
|
#result = ""
|
||||||
|
<div id="markhelp">
|
||||||
|
<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://nim-lang.org/rst.html">this link</a> for a more detailed help reference.</p>
|
||||||
|
<table class="rst">
|
||||||
|
<tbody>
|
||||||
|
<tr class="markheading">
|
||||||
|
<td><em>you type:</em>
|
||||||
|
</td>
|
||||||
|
<td><em>you see:</em>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>*italics*</td>
|
||||||
|
<td><em>italics</em>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>**bold**</td>
|
||||||
|
<td><b>bold</b>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>`nim! <http://nim-lang.org>`_</td>
|
||||||
|
<td><a href="http://nim-lang.org">nim!</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>* item 1
|
||||||
|
<br>* item 2
|
||||||
|
<br>* item 3</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>item 1</li>
|
||||||
|
<li>item 2</li>
|
||||||
|
<li>item 3</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>> quoted text</td>
|
||||||
|
<td>
|
||||||
|
<blockquote>quoted text</blockquote>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>The forum supports the Github Markdown syntax
|
||||||
|
<br>for code listings:
|
||||||
|
<br>
|
||||||
|
<br>```nim
|
||||||
|
<br>if 1 * 2 < 3:
|
||||||
|
<br><span class="spaces"> </span>echo "hello, world!"
|
||||||
|
<br>```
|
||||||
|
<br>
|
||||||
|
</td>
|
||||||
|
<td>The forum supports the Github Markdown syntax
|
||||||
|
<br>for code listings:
|
||||||
|
<br>
|
||||||
|
<pre class="listing">
|
||||||
|
<span class="Keyword">if</span> <span class="DecNumber">1</span><span class=
|
||||||
|
"Operator">*</span><span class="DecNumber">2</span> <span class=
|
||||||
|
"Operator"><</span> <span class="DecNumber">3</span><span class=
|
||||||
|
"Punctuation">:</span>
|
||||||
|
<span class="Identifier">echo</span> <span class=
|
||||||
|
"StringLit">"hello, world!"</span>
|
||||||
|
</pre>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>A horizontal rule can be created<br/>----<br/>but it needs text after it</td>
|
||||||
|
<td>A horizontal rule can be created<hr/>but it needs text after it</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
#end proc
|
||||||
|
|
@ -287,7 +287,7 @@ pre .EscapeSequence
|
||||||
#talk-thread > div > .author > div > .name { }
|
#talk-thread > div > .author > div > .name { }
|
||||||
#talk-thread > div > .author > div > .date { font-size: 8pt; color: white; }
|
#talk-thread > div > .author > div > .date { font-size: 8pt; color: white; }
|
||||||
#talk-thread > div > .topic { width:85%; padding-bottom:10px; margin-left: 15%; }
|
#talk-thread > div > .topic { width:85%; padding-bottom:10px; margin-left: 15%; }
|
||||||
#talk-thread > div > .topic pre {
|
#talk-thread > div > .topic pre, #markhelp pre.listing {
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
margin:0;
|
margin:0;
|
||||||
padding:15px 10px;
|
padding:15px 10px;
|
||||||
|
|
@ -299,7 +299,8 @@ pre .EscapeSequence
|
||||||
margin-bottom: 10pt;
|
margin-bottom: 10pt;
|
||||||
font-family: "DejaVu Sans Mono", monospace;
|
font-family: "DejaVu Sans Mono", monospace;
|
||||||
}
|
}
|
||||||
#talk-thread > div > .topic a, #talk-thread > div > .topic a:visited
|
#talk-thread > div > .topic a, #talk-thread > div > .topic a:visited,
|
||||||
|
#markhelp a, #markhelp a:visited
|
||||||
{
|
{
|
||||||
color: #3680C9;
|
color: #3680C9;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
@ -669,3 +670,39 @@ img.rssfeed {
|
||||||
float: right;
|
float: right;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#markhelp {
|
||||||
|
width: 80%;
|
||||||
|
background-color: #cbcfd6;
|
||||||
|
padding: 2pt 10pt;
|
||||||
|
margin-top: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
#markhelp .markheading {
|
||||||
|
background-color: #6fa1ff;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#markhelp table.rst {
|
||||||
|
width: 100%;
|
||||||
|
margin: 10px 0px;
|
||||||
|
font-size: 12pt;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
#markhelp table tr, #markhelp table td {
|
||||||
|
width: 50%;
|
||||||
|
border: 1px solid #7d7d7d;
|
||||||
|
}
|
||||||
|
|
||||||
|
#markhelp table td {
|
||||||
|
padding:4px 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
padding: 0px 8px;
|
||||||
|
margin: 10px 0px;
|
||||||
|
border-left: 2px solid rgb(61, 61, 61);
|
||||||
|
color: rgb(109, 109, 109);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue