Commit 9550230b038237cdd86d9017f012afc18ab685b3

Golmote 2014-12-21T21:20:31

Merge branch 'prism-examples'

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
+# &lt;VirtualHost *:80>
+</code></pre>
+
+<h2>Directives</h2>
+<pre><code>&lt;Files .htaccess>
+	Order allow,deny
+	Deny from all
+&lt;/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&lt;String, Logger> _cache = &lt;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