From 639b208f808e6f87478f5ad5cd2727a0b12062ec Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Tue, 26 May 2015 18:24:14 +0100
Subject: [PATCH] Updated the help page to add the new syntax

---
 index.php             | 19 ++++++++++++++++---
 module_index.json     |  4 ++--
 modules/page-help.php | 17 +++++++++++++++--
 3 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/index.php b/index.php
index 322320e..03072ba 100644
--- a/index.php
+++ b/index.php
@@ -509,6 +509,7 @@ class Slimdown {
 		'/\r\n/' => "\n",											// new line normalisation
 		'/(#+)(.*)/' => 'self::header',								// headers
 		'/(\*)(.*?)\1/' => '<strong>\2</strong>',					// bold
+		'/(_)(.*?)\1/' => '<em>\2</em>',							// emphasis
 		
 		// todo test these
 		'/!\[(.*)\]\(([^\s]+)\s(\d+.+)\s(left|right)\)/' => '<img src="\2" alt="\1" style="max-width: \3; float: \4;" />',		// images with size
@@ -516,7 +517,6 @@ class Slimdown {
 		'/!\[(.*)\]\((.*)\)/' => '<img src="\2" alt="\1" />',		// basic images
 		// todo end
 		
-		'/(_)(.*?)\1/' => '<em>\2</em>',							// emphasis
 		'/\[\[([a-zA-Z0-9\_\- ]+)\|([a-zA-Z0-9\_\- ]+)\]\]/' => '<a href=\'index.php?page=\1\'>\2</a>',	//internal links with display text
 		'/\[\[([a-zA-Z0-9\_\- ]+)\]\]/' => '<a href=\'index.php?page=\1\'>\1</a>',	//internal links
 		'/\[([^\[]+)\]\(([^\)]+)\)/' => '<a href=\'\2\' target=\'_blank\'>\1</a>',	// links
@@ -864,7 +864,7 @@ register_module([
 
 register_module([
 	"name" => "Help page",
-	"version" => "0.5",
+	"version" => "0.6",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Adds the help action. You really want this one.",
 	"id" => "page-help",
@@ -885,20 +885,33 @@ register_module([
 		<tr><th>Type This</th><th>To get this</th>
 		<tr><td><code>_italics_</code></td><td><em>italics</em></td></tr>
 		<tr><td><code>*bold*</code></td><td><strong>bold</strong></td></tr>
+		<tr><td><code>~~Strikethrough~~</code></td><td><del>Strikethough</del></td></tr>
+		<tr><td><code>`code`</code></td><td><code>code</code></td></tr>
 		<tr><td><code># Heading</code></td><td><h2>Heading</h2></td></tr>
 		<tr><td><code>## Sub Heading</code></td><td><h3>Sub Heading</h3></td></tr>
 		<tr><td><code>[[Internal Link]]</code></td><td><a href='index.php?page=Internal Link'>Internal Link</a></td></tr>
 		<tr><td><code>[[Display Text|Internal Link]]</code></td><td><a href='index.php?page=Internal Link'>Display Text</a></td></tr>
 		<tr><td><code>[Display text](//google.com/)</code></td><td><a href='//google.com/'>Display Text</a></td></tr>
-		<tr><td><code>~~Strikethrough~~</code></td><td><del>Strikethough</del></td></tr>
 		<tr><td><code>&gt; Blockquote<br />&gt; Some text</code></td><td><blockquote> Blockquote<br />Some text</td></tr>
+		<tr><td><code> - Apples<br /> * Oranges</code></td><td><ul><li>Apples</li><li>Oranges</li></ul></td></tr>
+		<tr><td><code>1. This is<br />2. an ordered list</code></td><td><ol><li>This is</li><li>an ordered list</li></ol></td></tr>
 		<tr><td><code>
 	---
 	</code></td><td><hr /></td></tr>
 		<tr><tds><code> - One
  - Two
  - Three</code></td><td><ul><li>One</li><li>Two</li><li>Three</li></ul></td></tr>
+		<tr><td><code>![Alt text](//starbeamrainbowlabs.com/favicon-small.png)</code></td><td><img src='//starbeamrainbowlabs.com/favicon-small.png' alt='Alt text' /></td></code>
 	</table>
+	
+	<p>In addition, the following extra syntax is supported for images:</p>
+	
+	<pre><code>Size the image to at most 250 pixels wide:
+![Alt text](//starbeamrainbowlabs.com/favicon-small.png 250px)
+
+Size the image to at most 120px wide and have it float at the right ahnd size of the page:
+![Alt text](//starbeamrainbowlabs.com/favicon-small.png 120px right)</code></pre>
+	
 	<h2>Administrator Actions</h2>
 	<p>By default, the <code>delete</code> and <code>move</code> actions are shown on the nav bar. These can be used by administrators to delete or move pages.</p>
 	<p>The other thing admininistrators can do is update the wiki (provided they know the site's secret). This page can be found here: <a href='?action=update'>Update $settings->sitename</a>.</p>
diff --git a/module_index.json b/module_index.json
index a7e596d..661af08 100644
--- a/module_index.json
+++ b/module_index.json
@@ -33,11 +33,11 @@
     },
     {
         "name": "Help page",
-        "version": "0.5",
+        "version": "0.6",
         "author": "Starbeamrainbowlabs",
         "description": "Adds the help action. You really want this one.",
         "id": "page-help",
-        "lastupdate": 1432497592
+        "lastupdate": 1432661040
     },
     {
         "name": "Page list",
diff --git a/modules/page-help.php b/modules/page-help.php
index 9084812..70ff9cd 100644
--- a/modules/page-help.php
+++ b/modules/page-help.php
@@ -1,7 +1,7 @@
 <?php
 register_module([
 	"name" => "Help page",
-	"version" => "0.5",
+	"version" => "0.6",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Adds the help action. You really want this one.",
 	"id" => "page-help",
@@ -22,20 +22,33 @@ register_module([
 		<tr><th>Type This</th><th>To get this</th>
 		<tr><td><code>_italics_</code></td><td><em>italics</em></td></tr>
 		<tr><td><code>*bold*</code></td><td><strong>bold</strong></td></tr>
+		<tr><td><code>~~Strikethrough~~</code></td><td><del>Strikethough</del></td></tr>
+		<tr><td><code>`code`</code></td><td><code>code</code></td></tr>
 		<tr><td><code># Heading</code></td><td><h2>Heading</h2></td></tr>
 		<tr><td><code>## Sub Heading</code></td><td><h3>Sub Heading</h3></td></tr>
 		<tr><td><code>[[Internal Link]]</code></td><td><a href='index.php?page=Internal Link'>Internal Link</a></td></tr>
 		<tr><td><code>[[Display Text|Internal Link]]</code></td><td><a href='index.php?page=Internal Link'>Display Text</a></td></tr>
 		<tr><td><code>[Display text](//google.com/)</code></td><td><a href='//google.com/'>Display Text</a></td></tr>
-		<tr><td><code>~~Strikethrough~~</code></td><td><del>Strikethough</del></td></tr>
 		<tr><td><code>&gt; Blockquote<br />&gt; Some text</code></td><td><blockquote> Blockquote<br />Some text</td></tr>
+		<tr><td><code> - Apples<br /> * Oranges</code></td><td><ul><li>Apples</li><li>Oranges</li></ul></td></tr>
+		<tr><td><code>1. This is<br />2. an ordered list</code></td><td><ol><li>This is</li><li>an ordered list</li></ol></td></tr>
 		<tr><td><code>
 	---
 	</code></td><td><hr /></td></tr>
 		<tr><tds><code> - One
  - Two
  - Three</code></td><td><ul><li>One</li><li>Two</li><li>Three</li></ul></td></tr>
+		<tr><td><code>![Alt text](//starbeamrainbowlabs.com/favicon-small.png)</code></td><td><img src='//starbeamrainbowlabs.com/favicon-small.png' alt='Alt text' /></td></code>
 	</table>
+	
+	<p>In addition, the following extra syntax is supported for images:</p>
+	
+	<pre><code>Size the image to at most 250 pixels wide:
+![Alt text](//starbeamrainbowlabs.com/favicon-small.png 250px)
+
+Size the image to at most 120px wide and have it float at the right ahnd size of the page:
+![Alt text](//starbeamrainbowlabs.com/favicon-small.png 120px right)</code></pre>
+	
 	<h2>Administrator Actions</h2>
 	<p>By default, the <code>delete</code> and <code>move</code> actions are shown on the nav bar. These can be used by administrators to delete or move pages.</p>
 	<p>The other thing admininistrators can do is update the wiki (provided they know the site's secret). This page can be found here: <a href='?action=update'>Update $settings->sitename</a>.</p>
