Added bash, Jade, Less, SQL and Twig examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
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><div class="foo bar"></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 <html></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><div{% if foo %} class="bar"{% endif %}></div></code></pre>
\ No newline at end of file