Commit 00068402acb94104df0ebf6987e34c4cfa39ce65

Golmote 2014-12-22T08:59:49

Added bash, Jade, Less, SQL and Twig examples

diff --git a/examples/prism-bash.html b/examples/prism-bash.html
new file mode 100644
index 0000000..c92f8b1
--- /dev/null
+++ b/examples/prism-bash.html
@@ -0,0 +1,36 @@
+<h1>Bash</h1>
+<p>To use this language, use the class "language-bash".</p>
+
+<h2>Shebang</h2>
+<pre><code>#!/bin/bash
+#!/bin/sh</code></pre>
+
+<h2>Comments</h2>
+<pre><code># This is a comment</code></pre>
+
+<h2>Strings</h2>
+<pre><code>STRING="Hello World"
+'Single and
+multi-line strings are supported.'
+"Single and
+multi-line strings are supported."</code></pre>
+
+<h2>Variables</h2>
+<pre><code>echo $STRING
+args=("$@")
+echo ${args[0]} ${args[1]} ${args[2]}</code></pre>
+
+<h2>Keywords</h2>
+<pre><code>for (( i=0;i<$ELEMENTS;i++)); do
+	echo ${ARRAY[${i}]}
+done
+while read LINE; do
+    ARRAY[$count]=$LINE
+    ((count++))
+done
+if [ -d $directory ]; then
+	echo "Directory exists"
+else
+	echo "Directory does not exists"
+fi
+</code></pre>
\ No newline at end of file
diff --git a/examples/prism-jade.html b/examples/prism-jade.html
new file mode 100644
index 0000000..1b68125
--- /dev/null
+++ b/examples/prism-jade.html
@@ -0,0 +1,88 @@
+<h1>Jade</h1>
+<p>To use this language, use the class "language-jade".</p>
+
+<h2>Comments</h2>
+<pre><code>// Some
+  multiline
+  comment !
+
+// This is a comment
+But this is not</code></pre>
+
+<h2>Doctype</h2>
+<pre><code>doctype html
+doctype 1.1
+doctype html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"</code></pre>
+
+<h2>Tags</h2>
+<pre><code>ul
+  li Item A
+  li Item B
+  li Item C
+foo(bar='baz')/
+input(type='checkbox', checked=true.toString())
+#content
+div#foo(data-bar="foo")&attributes({'data-foo': 'bar'})</code></pre>
+
+<h2>Markup</h2>
+<pre><code>&lt;div class="foo bar">&lt;/div></code></pre>
+
+<h2>Flow control</h2>
+<pre><code>#user
+  if user.description
+    p.description= user.description
+  else if authorised
+    p.description.
+      User has no description,
+      why not add one...
+  else
+    p.description User has no description
+ul
+  each val in [1, 2, 3, 4, 5]
+    li= val
+case friends
+  when 0
+    p you have no friends
+  when 1
+    p you have a friend
+  default
+    p you have #{friends} friends
+</code></pre>
+
+<h2>Inline JavaScript</h2>
+<pre><code>script alert('test');
+script(type="text/javascript").
+  alert('foo');
+  alert('bar');
+- var classes = ['foo', 'bar', 'baz']
+- for (var x = 0; x < 3; x++)
+  li item
+</code></pre>
+
+<h2>Keywords</h2>
+<pre><code>include ./includes/head.jade
+extends ./layout.jade
+block content
+append head</code></pre>
+
+<h2>Mixins</h2>
+<pre><code>mixin list
+  ul
+    li foo
+    li bar
+    li baz
++list
+mixin pet(name)
+  li.pet= name
+ul
+  +pet('cat')
+  +pet('dog')
+</code></pre>
+
+<h2>Filters</h2>
+<p>Filters require the desired language to be loaded.
+On this page, check CoffeeScript <strong>before</strong> checking Jade 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-less.html b/examples/prism-less.html
new file mode 100644
index 0000000..c84bc68
--- /dev/null
+++ b/examples/prism-less.html
@@ -0,0 +1,73 @@
+<h1>Less</h1>
+<p>To use this language, use the class "language-less".</p>
+
+<h2>Comments</h2>
+<pre><code>// Single line comment
+/* Multi-line
+comment */</code></pre>
+
+<h2>Variables</h2>
+<pre><code>@nice-blue: #5B83AD;
+@light-blue: @nice-blue + #111;</code></pre>
+
+<h2>At-rules</h2>
+<pre><code>@media screen and (min-width: 320px) {}</code></pre>
+
+<h2>Mixins</h2>
+<pre><code>.bordered {
+  border-top: dotted 1px black;
+  border-bottom: solid 2px black;
+}
+#menu a {
+  .bordered;
+}
+#header a {
+  color: orange;
+  #bundle > .button;
+}</code></pre>
+
+<h2>Mixins with parameters</h2>
+<pre><code>.foo (@bg: #f5f5f5, @color: #900) {
+  background: @bg;
+  color: @color;
+}
+.bar {
+  .foo();
+}
+.class1 {
+  .mixin(@margin: 20px; @color: #33acfe);
+}
+.class2 {
+  .mixin(#efca44; @padding: 40px);
+}</code></pre>
+
+<h2>Interpolation</h2>
+<pre><code>@mySelector: banner;
+.@{mySelector} {
+  font-weight: bold;
+}
+@property: color;
+.widget {
+  @{property}: #0ee;
+  background-@{property}: #999;
+}</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>At-rules looking like variables</h3>
+<pre><code>@import "some file.less";</code></pre>
+
+<h3>At-rules containing interpolation</h3>
+<pre><code>@import "@{themes}/tidal-wave.less";</code></pre>
+
+<h3>extend is not highlighted consistently</h3>
+<pre><code>nav ul {
+  &:extend(.inline);
+  background: blue;
+}
+.a:extend(.b) {}</code></pre>
\ No newline at end of file
diff --git a/examples/prism-sql.html b/examples/prism-sql.html
new file mode 100644
index 0000000..f26706e
--- /dev/null
+++ b/examples/prism-sql.html
@@ -0,0 +1,37 @@
+<h1>SQL</h1>
+<p>To use this language, use the class "language-sql".</p>
+
+<h2>Comments</h2>
+<pre><code># Single line comment
+-- Single line comment
+// Single line comment
+/* Multi-line
+comment */</code></pre>
+
+<h2>Strings</h2>
+<pre><code>"foo \"bar\" baz"
+'foo \'bar\' baz'
+"Multi-line strings
+are supported"
+'Multi-line strings
+are supported'</code></pre>
+
+<h2>Variables</h2>
+<pre><code>SET @variable = 1;
+SET @$_ = 2;
+SET @"quoted-variable" = 3;
+SET @'quoted-variable' = 3;
+SET @`quoted-variable` = 3;</code></pre>
+
+<h2>Operators</h2>
+<pre><code>SELECT 1 && 1;
+SELECT 1 OR NULL;
+SELECT 5 & ~1;
+SELECT 2 BETWEEN 1 AND 3;</code></pre>
+
+<h2>Functions and keywords</h2>
+<pre><code>SELECT COUNT(*) AS cpt,
+FROM `table`
+LEFT JOIN `other_table` AS t
+WHERE `somecol` IS NOT NULL
+ORDER BY t.other_col DESC</code></pre>
diff --git a/examples/prism-twig.html b/examples/prism-twig.html
new file mode 100644
index 0000000..4ed93bf
--- /dev/null
+++ b/examples/prism-twig.html
@@ -0,0 +1,30 @@
+<h1>Twig</h1>
+<p>To use this language, use the class "language-twig".</p>
+
+<h2>Comments</h2>
+<pre><code>{# Some comment
+on multiple lines
+with &lt;html>&lt;/html>
+inside #}</code></pre>
+
+<h2>Keywords</h2>
+<pre><code>{% if foo %} bar {% endif %}
+{% for key, value in arr if value %} {{ do_something() }} {% endfor %}
+{% include 'header.html' %}
+{% include 'template.html' with {'foo': 'bar'} %}</code></pre>
+
+<h2>Operators</h2>
+<pre><code>{{ not a }}
+{{ 20 // 7 }}
+{{ b b-and c }}
+{% if phone matches '/^[\\d\\.]+$/' %} ... {% endif %}</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>Tag containing Twig is not highlighted</h3>
+<pre><code>&lt;div{% if foo %} class="bar"{% endif %}>&lt;/div></code></pre>
\ No newline at end of file