Merge branch 'prism-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 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
diff --git a/examples/prism-apacheconf.html b/examples/prism-apacheconf.html
new file mode 100644
index 0000000..29ac4ad
--- /dev/null
+++ b/examples/prism-apacheconf.html
@@ -0,0 +1,57 @@
+<h1>Apache Configuration</h1>
+<p>To use this language, use the class "language-apacheconf".</p>
+
+<h2>Comments</h2>
+<pre><code># This is a comment
+# <VirtualHost *:80>
+</code></pre>
+
+<h2>Directives</h2>
+<pre><code><Files .htaccess>
+ Order allow,deny
+ Deny from all
+</Files>
+</code></pre>
+
+<h2>Variables</h2>
+<pre><code>RewriteCond %{REQUEST_FILENAME}.php -f</code></pre>
+
+<h2>Regex</h2>
+<pre><code>^(.*)$
+!^www\.</code></pre>
+
+<h2>Directive flags</h2>
+<pre><code>[NC]
+[RC=301,L]</code></pre>
+
+<h2>Strings</h2>
+<pre><code>AuthName "Fichiers réservés"</code></pre>
+
+<h2>Full example</h2>
+<pre><code>## BASIC PASSWORD PROTECTION
+AuthType basic
+AuthName "prompt"
+AuthUserFile /.htpasswd
+AuthGroupFile /dev/null
+Require valid-user
+
+## ALLOW FROM IP OR VALID PASSWORD
+Require valid-user
+Allow from 192.168.1.23
+Satisfy Any
+
+## PROTECT FILES
+Order Allow,Deny
+Deny from all
+
+## REQUIRE SUBDOMAIN
+RewriteCond %{HTTP_HOST} !^$
+RewriteCond %{HTTP_HOST} !^subdomain\.domain\.tld$ [NC]
+RewriteRule ^/(.*)$ http://subdomain.domain.tld/$1 [L,R=301]
+
+ErrorDocument 403 http://www.example.com/logo.gif
+ErrorDocument 403 /images/you_bad_hotlinker.gif
+
+## REDIRECT UPLOADS
+RewriteCond %{REQUEST_METHOD} ^(PUT|POST)$ [NC]
+RewriteRule ^(.*)$ /cgi-bin/form-upload-processor.cgi?p=$1 [L,QSA]</code></pre>
\ No newline at end of file
diff --git a/examples/prism-applescript.html b/examples/prism-applescript.html
new file mode 100644
index 0000000..7365cb1
--- /dev/null
+++ b/examples/prism-applescript.html
@@ -0,0 +1,42 @@
+<h1>AppleScript</h1>
+<p>To use this language, use the class "language-applescript".</p>
+
+<h2>Comments</h2>
+<pre><code>-- Single line comment
+#!/usr/bin/osascript
+(* Here is
+a block
+comment *)</code></pre>
+
+<h2>Strings</h2>
+<pre><code>"foo \"bar\" baz"</code></pre>
+
+<h2>Operators</h2>
+<pre><code>a ≠ b
+12 + 2 * 5
+"DUMPtruck" is equal to "dumptruck"
+"zebra" comes after "aardvark"
+{ "this", "is", 2, "cool" } starts with "this"
+{ "is", 2} is contained by { "this", "is", 2, "cool" }
+set docRef to a reference to the first document
+</code></pre>
+
+<h2>Classes and units</h2>
+<pre><code>tell application "Finder"
+text 1 thru 5 of "Bring me the mouse."
+set averageTemp to 63 as degrees Fahrenheit
+set circleArea to (pi * 7 * 7) as square yards
+</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>Nested block comments</h3>
+<pre><code>(* Nested block
+ (* comments
+ are *)
+not supported *)</code></pre>
\ No newline at end of file
diff --git a/examples/prism-dart.html b/examples/prism-dart.html
new file mode 100644
index 0000000..3995802
--- /dev/null
+++ b/examples/prism-dart.html
@@ -0,0 +1,72 @@
+<h1>Dart</h1>
+<p>To use this language, use the class "language-dart".</p>
+
+<h2>Comments</h2>
+<pre><code>// Single line comment
+/// Documentation single line comment
+/* Block comment
+on several lines */
+/** Multi-line
+doc comment */</code></pre>
+
+<h2>Annotations</h2>
+<pre><code>@todo('seth', 'make this do something')
+@deprecated // Metadata; makes Dart Editor warn about using activate().</code></pre>
+
+<h2>Numbers</h2>
+<pre><code>var x = 1;
+var hex = 0xDEADBEEF;
+var bigInt = 346534658346524376592384765923749587398457294759347029438709349347;
+var y = 1.1;
+var exponents = 1.42e5;
+</code></pre>
+
+<h2>Strings</h2>
+<pre><code>var s1 = 'Single quotes work well for string literals.';
+var s2 = "Double quotes work just as well.";
+var s3 = 'It\'s easy to escape the string delimiter.';
+var s4 = "It's even easier to just use the other string delimiter.";
+var s1 = '''
+You can create
+multi-line strings like this one.
+''';
+var s2 = """This is also a
+multi-line string.""";
+var s = r"In a raw string, even \n isn't special.";</code></pre>
+
+<h2>Full example</h2>
+<pre><code>class Logger {
+ final String name;
+ bool mute = false;
+
+ // _cache is library-private, thanks to the _ in front of its name.
+ static final Map<String, Logger> _cache = <String, Logger>{};
+
+ factory Logger(String name) {
+ if (_cache.containsKey(name)) {
+ return _cache[name];
+ } else {
+ final logger = new Logger._internal(name);
+ _cache[name] = logger;
+ return logger;
+ }
+ }
+
+ Logger._internal(this.name);
+
+ void log(String msg) {
+ if (!mute) {
+ print(msg);
+ }
+ }
+}</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>
\ No newline at end of file
diff --git a/examples/prism-erlang.html b/examples/prism-erlang.html
new file mode 100644
index 0000000..c02b60f
--- /dev/null
+++ b/examples/prism-erlang.html
@@ -0,0 +1,60 @@
+<h1>Erlang</h1>
+<p>To use this language, use the class "language-erlang".</p>
+
+<h2>Comments</h2>
+<pre><code>% This is a comment
+%% coding: utf-8</code></pre>
+
+<h2>Strings</h2>
+<pre><code>"foo \"bar\" baz"</code></pre>
+
+<h2>Numbers</h2>
+<pre><code>42.
+$A.
+$\n.
+2#101.
+16#1f.
+2.3.
+2.3e3.
+2.3e-3.</code></pre>
+
+<h2>Functions</h2>
+<pre><code>P = spawn(m, loop, []).
+io:format("I am ~p~n", [self()]).
+'weird function'().
+</code></pre>
+
+<h2>Variables</h2>
+<pre><code>P = {adam,24,{july,29}}.
+M1 = #{name=>adam,age=>24,date=>{july,29}}.
+M2 = maps:update(age,25,M1).
+io:format("{~p,~p}: ~p~n", [?MODULE,?LINE,X]).</code></pre>
+
+<h2>Operators</h2>
+<pre><code>1==1.0.
+1=:=1.0.
+1 > a.
++1.
+-1.
+1+1.
+4/2.
+5 div 2.
+5 rem 2.
+2#10 band 2#01.
+2#10 bor 2#01.
+a + 10.
+1 bsl (1 bsl 64).
+not true.
+true and false.
+true xor false.
+true or garbage.</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";</code></pre>
\ No newline at end of file
diff --git a/examples/prism-fortran.html b/examples/prism-fortran.html
new file mode 100644
index 0000000..12e9c20
--- /dev/null
+++ b/examples/prism-fortran.html
@@ -0,0 +1,84 @@
+<h1>Fortran</h1>
+<p>To use this language, use the class "language-fortran".</p>
+
+<h2>Comments</h2>
+<pre><code>! This is a comment</code></pre>
+
+<h2>Strings</h2>
+<pre><code>"foo 'bar' baz"
+'foo ''bar'' baz'
+''
+ITALICS_'This is in italics'
+"test &
+ ! Some "tricky comment" here
+ &test"</code></pre>
+
+<h2>Numbers</h2>
+<pre><code>473
++56
+-101
+21_2
+21_SHORT
+1976354279568241_8
+B'01110'
+B"010"
+O'047'
+O"642"
+Z'F41A'
+Z"00BC"
+-12.78
++1.6E3
+2.1
+-16.E4_8
+0.45E-4
+10.93E7_QUAD
+.123
+3E4</code></pre>
+
+<h2>Full example</h2>
+<pre><code>MODULE MOD1
+TYPE INITIALIZED_TYPE
+ INTEGER :: I = 1 ! Default initialization
+END TYPE INITIALIZED_TYPE
+SAVE :: SAVED1, SAVED2
+INTEGER :: SAVED1, UNSAVED1
+TYPE(INITIALIZED_TYPE) :: SAVED2, UNSAVED2
+ALLOCATABLE :: SAVED1(:), SAVED2(:), UNSAVED1(:), UNSAVED2(:)
+END MODULE MOD1
+
+PROGRAM MAIN
+CALL SUB1 ! The values returned by the ALLOCATED intrinsic calls
+ ! in the PRINT statement are:
+ ! .FALSE., .FALSE., .FALSE., and .FALSE.
+ ! Module MOD1 is used, and its variables are allocated.
+ ! After return from the subroutine, whether the variables
+ ! which were not specified with the SAVE attribute
+ ! retain their allocation status is processor dependent.
+CALL SUB1 ! The values returned by the first two ALLOCATED intrinsic
+ ! calls in the PRINT statement are:
+ ! .TRUE., .TRUE.
+ ! The values returned by the second two ALLOCATED
+ ! intrinsic calls in the PRINT statement are
+ ! processor dependent and each could be either
+ ! .TRUE. or .FALSE.
+CONTAINS
+ SUBROUTINE SUB1
+ USE MOD1 ! Brings in saved and not saved variables.
+ PRINT *, ALLOCATED(SAVED1), ALLOCATED(SAVED2), &
+ ALLOCATED(UNSAVED1), ALLOCATED(UNSAVED2)
+ IF (.NOT. ALLOCATED(SAVED1)) ALLOCATE(SAVED1(10))
+ IF (.NOT. ALLOCATED(SAVED2)) ALLOCATE(SAVED2(10))
+ IF (.NOT. ALLOCATED(UNSAVED1)) ALLOCATE(UNSAVED1(10))
+ IF (.NOT. ALLOCATED(UNSAVED2)) ALLOCATE(UNSAVED2(10))
+ END SUBROUTINE SUB1
+END PROGRAM MAIN</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>Commented string</h3>
+<pre><code>! This "string" should not be highlighted</code></pre>
\ No newline at end of file