Commit efff8bb08cc478cc478f34d56f50f6852c2048c5

Golmote 2014-12-23T08:55:24

Merge branch 'prism-examples'

diff --git a/examples/prism-haml.html b/examples/prism-haml.html
new file mode 100644
index 0000000..fe7220d
--- /dev/null
+++ b/examples/prism-haml.html
@@ -0,0 +1,82 @@
+<h1>Haml</h1>
+<p>To use this language, use the class "language-haml".</p>
+
+<h2>Comments</h2>
+<pre><code>
+/ This is comment
+    on multiple lines
+/ This is a comment
+but this is not
+-# This is another comment
+    on multiple lines</code></pre>
+
+<h2>Doctype</h2>
+<pre><code>!!! XML
+!!!
+!!! 5</code></pre>
+
+<h2>Tags</h2>
+<pre><code>%div
+	%span
+%span(class="widget_#{@widget.number}")
+%div{:id => [@item.type, @item.number], :class => [@item.type, @item.urgency]}
+%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"}
+%html{html_attrs('fr-fr')}
+%div[@user, :greeting]
+%img
+%pre><
+  foo
+  bar
+%img
+</code></pre>
+
+<h2>Markup</h2>
+<pre><code>%p
+  &lt;div id="blah">Blah!&lt;/div></code></pre>
+
+<h2>Inline Ruby</h2>
+<pre><code>= ['hi', 'there', 'reader!'].join " "
+- foo = "hello"
+= link_to_remote "Add to cart",
+    :url => { :action => "add", :id => product.id },
+    :update => { :success => "cart", :failure => "error" }
+~ "Foo\n&lt;pre>Bar\nBaz&lt;/pre>"
+%p
+  - case 2
+  - when 1
+    = "1!"
+  - when 2
+    = "2?"
+  - when 3
+    = "3."
+- (42...47).each do |i|
+  %p= i
+%p See, I can count!
+</code></pre>
+
+<h2>Filters</h2>
+
+<pre><code>%head
+	:css
+		#content: {
+			background: url('img/background.jpg');
+		}
+		div {
+			color: #333;
+		}
+	:javascript
+		(function() {
+			var test = "Do you like Prism?";
+			if(confirm(test)) {
+				do_something_great();
+			}
+		}());
+%body
+</code></pre>
+
+<p>Filters require the desired language to be loaded.
+On this page, check CoffeeScript <strong>before</strong> checking Haml should make
+the example below work properly.</p>
+<pre><code>script
+  :coffee
+    console.log 'This is coffee script'</code></pre>
\ No newline at end of file
diff --git a/examples/prism-handlebars.html b/examples/prism-handlebars.html
new file mode 100644
index 0000000..dc67ceb
--- /dev/null
+++ b/examples/prism-handlebars.html
@@ -0,0 +1,39 @@
+<h1>Handlebars</h1>
+<p>To use this language, use the class "language-handlebars".</p>
+
+<h2>Comments</h2>
+<pre><code>{{! This is a comment with &lt;p>some markup&lt;/p> in it }}</code></pre>
+
+<h2>Variables</h2>
+<pre><code>&lt;p>{{ text }}&lt;/p>
+&lt;h1>{{article.title}}&lt;/h1>
+{{{ triple_slash_is_supported }}}
+{{articles.[10].[#comments]}}</code></pre>
+
+<h2>Strings, numbers and booleans</h2>
+<pre><code>{{{link "See more..." story.url}}}
+{{ true }}
+{{ custom_helper 42 href="somepage.html" false }}</code></pre>
+
+<h2>Block helpers</h2>
+<pre><code>&lt;div class="body">
+	{{#bold}}{{body}}{{/bold}}
+&lt;/div>
+{{#with story}}
+	&lt;div class="intro">{{{intro}}}&lt;/div>
+	&lt;div class="body">{{{body}}}&lt;/div>
+{{/with}}
+&lt;div class="{{#if test}}foo{{else}}bar{{/if}}">&lt;/div>
+{{#list array}}
+  {{@index}}. {{title}}
+{{/list}}</code></pre>
+
+<h2>Known failures</h2>
+<p>There are certain edge cases where Prism will fail.
+	There are always such cases in every regex-based syntax highlighter.
+	However, Prism dares to be open and honest about them.
+	If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
+</p>
+
+<h3>Handlebars tag in the middle of an HTML tag</h3>
+<pre><code>&lt;div{{#if test}} class="test"{{/if}}>&lt;/div></code></pre>
\ No newline at end of file
diff --git a/examples/prism-ini.html b/examples/prism-ini.html
new file mode 100644
index 0000000..d404e42
--- /dev/null
+++ b/examples/prism-ini.html
@@ -0,0 +1,13 @@
+<h1>Ini</h1>
+<p>To use this language, use the class "language-ini".</p>
+
+<h2>Comments</h2>
+<pre><code>; This is a comment</code></pre>
+
+<h2>Section title</h2>
+<pre><code>[owner]
+[database]</code></pre>
+
+<h2>Properties</h2>
+<pre><code>name=prism
+file="somefile.txt"</code></pre>
\ No newline at end of file
diff --git a/examples/prism-latex.html b/examples/prism-latex.html
new file mode 100644
index 0000000..4d8769f
--- /dev/null
+++ b/examples/prism-latex.html
@@ -0,0 +1,15 @@
+<h1>LaTeX</h1>
+<p>To use this language, use the class "language-latex".</p>
+
+<h2>Comments</h2>
+<pre><code>% This is a comment</code></pre>
+
+<h2>Commands</h2>
+<pre><code>\begin{document}
+\documentstyle[twoside,epsfig]{article}
+\usepackage{epsfig,multicol}</code></pre>
+
+<h2>Math mode</h2>
+<pre><code>$\alpha$
+H$_{2}$O
+45$^{\circ}$C</code></pre>
\ No newline at end of file
diff --git a/examples/prism-php.html b/examples/prism-php.html
new file mode 100644
index 0000000..764e89e
--- /dev/null
+++ b/examples/prism-php.html
@@ -0,0 +1,66 @@
+<h1>PHP</h1>
+<p>To use this language, use the class "language-php".</p>
+
+<h2>Comments</h2>
+<pre><code>// Single line comment
+/* Multi-line
+comment */</code></pre>
+
+<h2>Strings</h2>
+<pre><code>'foo \'bar\' baz'
+"foo \"bar\" baz"</code></pre>
+
+<h2>Variables</h2>
+<pre><code>$some_var = 5;
+$otherVar = "Some text";
+$null = null;
+$false = FaLsE;</code></pre>
+
+<h2>Functions</h2>
+<pre><code>$json = json_encode($my_object);
+$array1 = array("a" => "green", "red", "blue", "red");
+$array2 = array("b" => "green", "yellow", "red");
+$result = array_diff($array1, $array2);</code></pre>
+
+<h2>Constants</h2>
+<pre><code>define('MAXSIZE', 42);
+echo MAXSIZE;
+json_decode($json, false, 512, JSON_BIGINT_AS_STRING)</code></pre>
+
+<h2>PHP 5.3+ support</h2>
+<pre><code>namespace my\name;
+$c = new \my\name\MyClass;
+$arr = [1,2,3];
+trait ezcReflectionReturnInfo {
+    function getReturnType() { /*1*/ }
+    function getReturnDescription() { /*2*/ }
+}
+function gen_one_to_three() {
+    for ($i = 1; $i <= 3; $i++) {
+        // Note that $i is preserved between yields.
+        yield $i;
+    }
+}</code></pre>
+
+<h2>PHP embedded in HTML</h2>
+<pre><code>&lt;div class="&lt;?php echo $a ? 'foo' : 'bar'; ?>">
+&lt;?php if($var &lt; 42) {
+    echo "Something";
+} else {
+    echo "Something else";
+} ?>
+&lt;/div></code></pre>
+
+<h2>Known failures</h2>
+<p>There are certain edge cases where Prism will fail.
+	There are always such cases in every regex-based syntax highlighter.
+	However, Prism dares to be open and honest about them.
+	If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
+</p>
+
+<h3>Comment-like substrings</h3>
+<pre><code>"foo /* bar */ baz"; "foo // bar";</code></pre>
+
+<h3>A less-than sign and a greater-than sign on the same line</h3>
+<pre><code>if($a < $b && $b > $c) {}</code></pre>
+