summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShaun McCance <shaunm@redhat.com>2016-01-03 12:33:26 -0500
committerShaun McCance <shaunm@redhat.com>2016-01-03 12:33:26 -0500
commitff740f6c5e64a7ac213b7b3b9f7f47cb0c080e23 (patch)
tree9c629a4140c348778d9e7443964ce56b062d82de /test
parentb28bc251ba9d0f223673dacec2b5fa993fc73693 (diff)
downloadyelp-xsl-ff740f6c5e64a7ac213b7b3b9f7f47cb0c080e23.tar.gz
Switch to highlight.js and revamp color stylesheet
Switching from the dead jQuery.syntax to the actively maintained highlight.js for syntax highlighting. highlight.js doesn't require jQuery, doesn't break inline markup, and has nicely namespaced class names that avoid clashes with classes used elsewhere in these stylesheets. Previously, we included the JavaScript for syntax highlighting, but didn't provide any CSS to specify colors, leaving a large chunk of work to users to get syntax highlighting visible. This is because the colors defined in color.xsl weren't useful as text colors. This commit introduces a new color system which includes background, foreground, and accent shades for six colors, as well as multiple shades of gray. Many of these colors can now be automatically computed, thanks to color algorithms built into the XSLT.
Diffstat (limited to 'test')
-rw-r--r--test/syntax/Makefile11
-rw-r--r--test/syntax/code/actionscript24
-rw-r--r--test/syntax/code/apache19
-rw-r--r--test/syntax/code/asciidoc65
-rw-r--r--test/syntax/code/bash30
-rw-r--r--test/syntax/code/clojure18
-rw-r--r--test/syntax/code/cmake19
-rw-r--r--test/syntax/code/cpp15
-rw-r--r--test/syntax/code/cs38
-rw-r--r--test/syntax/code/css25
-rw-r--r--test/syntax/code/d44
-rw-r--r--test/syntax/code/diff30
-rw-r--r--test/syntax/code/django16
-rw-r--r--test/syntax/code/dockerfile48
-rw-r--r--test/syntax/code/dos24
-rw-r--r--test/syntax/code/erb10
-rw-r--r--test/syntax/code/fsharp48
-rw-r--r--test/syntax/code/go34
-rw-r--r--test/syntax/code/haml14
-rw-r--r--test/syntax/code/haskell38
-rw-r--r--test/syntax/code/http6
-rw-r--r--test/syntax/code/ini12
-rw-r--r--test/syntax/code/java35
-rw-r--r--test/syntax/code/javascript37
-rw-r--r--test/syntax/code/json12
-rw-r--r--test/syntax/code/lisp22
-rw-r--r--test/syntax/code/lua32
-rw-r--r--test/syntax/code/makefile13
-rw-r--r--test/syntax/code/markdown22
-rw-r--r--test/syntax/code/matlab45
-rw-r--r--test/syntax/code/nginx47
-rw-r--r--test/syntax/code/objectivec43
-rw-r--r--test/syntax/code/perl41
-rw-r--r--test/syntax/code/php52
-rw-r--r--test/syntax/code/python12
-rw-r--r--test/syntax/code/r68
-rw-r--r--test/syntax/code/ruby28
-rw-r--r--test/syntax/code/rust55
-rw-r--r--test/syntax/code/scala44
-rw-r--r--test/syntax/code/scheme28
-rw-r--r--test/syntax/code/smalltalk39
-rw-r--r--test/syntax/code/tcl26
-rw-r--r--test/syntax/code/tex17
-rw-r--r--test/syntax/code/vala46
-rw-r--r--test/syntax/code/xml24
-rw-r--r--test/syntax/code/xquery20
-rw-r--r--test/syntax/code/yaml39
-rw-r--r--test/syntax/dita.dita614
-rw-r--r--test/syntax/docbook.docbook517
-rw-r--r--test/syntax/mallard.page713
50 files changed, 3279 insertions, 0 deletions
diff --git a/test/syntax/Makefile b/test/syntax/Makefile
new file mode 100644
index 00000000..975a897d
--- /dev/null
+++ b/test/syntax/Makefile
@@ -0,0 +1,11 @@
+highlight.pack.js:
+ cp ../../js/highlight.pack.js .
+
+mallard: highlight.pack.js
+ xsltproc --xinclude ../../xslt/mallard/html/mal2html.xsl mallard.page
+
+docbook: highlight.pack.js
+ xsltproc --xinclude --param db.chunk.max_depth 0 ../../xslt/docbook/html/db2html.xsl docbook.docbook
+
+dita: highlight.pack.js
+ xsltproc --xinclude ../../xslt/dita/html/dita2html.xsl dita.dita
diff --git a/test/syntax/code/actionscript b/test/syntax/code/actionscript
new file mode 100644
index 00000000..9c35adf9
--- /dev/null
+++ b/test/syntax/code/actionscript
@@ -0,0 +1,24 @@
+package org.example.dummy {
+ import org.dummy.*;
+
+ /*define package inline interface*/
+ public interface IFooBarzable {
+ public function foo(... pairs):Array;
+ }
+
+ public class FooBar implements IFooBarzable {
+ static private var cnt:uint = 0;
+ private var bar:String;
+
+ //constructor
+ public function TestBar(bar:String):void {
+ bar = bar;
+ ++cnt;
+ }
+
+ public function foo(... pairs):Array {
+ pairs.push(bar);
+ return pairs;
+ }
+ }
+}
diff --git a/test/syntax/code/apache b/test/syntax/code/apache
new file mode 100644
index 00000000..3bf2af4f
--- /dev/null
+++ b/test/syntax/code/apache
@@ -0,0 +1,19 @@
+# rewrite`s rules for wordpress pretty url
+LoadModule rewrite_module modules/mod_rewrite.so
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule . index.php [NC,L]
+
+ExpiresActive On
+ExpiresByType application/x-javascript "access plus 1 days"
+
+Order Deny,Allow
+Allow from All
+
+<Location /maps/>
+ RewriteMap map txt:map.txt
+ RewriteMap lower int:tolower
+ RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
+ RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
+ RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
+</Location>
diff --git a/test/syntax/code/asciidoc b/test/syntax/code/asciidoc
new file mode 100644
index 00000000..bfeb895e
--- /dev/null
+++ b/test/syntax/code/asciidoc
@@ -0,0 +1,65 @@
+Hello, World!
+============
+Author Name, <author@domain.foo>
+
+you can write text http://example.com[with links], optionally
+using an explicit link:http://example.com[link prefix].
+
+* single quotes around a phrase place 'emphasis'
+** alternatively, you can put underlines around a phrase to add _emphasis_
+* astericks around a phrase make the text *bold*
+* pluses around a phrase make it +monospaced+
+* `smart' quotes using a leading backtick and trailing single quote
+** use two of each for double ``smart'' quotes
+
+- escape characters are supported
+- you can escape a quote inside emphasized text like 'here\'s johnny!'
+
+term:: definition
+ another term:: another definition
+
+// this is just a comment
+
+Let's make a break.
+
+'''
+
+////
+we'll be right with you
+
+after this brief interruption.
+////
+
+== We're back!
+
+Want to see a image::images/tiger.png[Tiger]?
+
+.Nested highlighting
+++++
+<this_is inline="xml"></this_is>
+++++
+
+____
+asciidoc is so powerful.
+____
+
+another quote:
+
+[quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes]
+____
+When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
+____
+
+Getting Literal
+---------------
+
+ want to get literal? prefix a line with a space.
+
+....
+I'll join that party, too.
+....
+
+. one thing (yeah!)
+. two thing `i can write code`, and `more` wipee!
+
+NOTE: AsciiDoc is quite cool, you should try it.
diff --git a/test/syntax/code/bash b/test/syntax/code/bash
new file mode 100644
index 00000000..b2654812
--- /dev/null
+++ b/test/syntax/code/bash
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+###### BEGIN CONFIG
+ACCEPTED_HOSTS="/root/.hag_accepted.conf"
+BE_VERBOSE=false
+###### END CONFIG
+
+if [ "$UID" -ne 0 ]
+then
+ echo "Superuser rights is required"
+ echo 'Printing the # sign'
+ exit 2
+fi
+
+if test $# -eq 0
+then
+elif test [ $1 == 'start' ]
+else
+fi
+
+genApacheConf(){
+ if [[ "$2" = "www" ]]
+ then
+ full_domain=$1
+ else
+ full_domain=$2.$1
+ fi
+ host_root="${APACHE_HOME_DIR}$1/$2/$(title)"
+ echo -e "# Host $1/$2 :"
+}
diff --git a/test/syntax/code/clojure b/test/syntax/code/clojure
new file mode 100644
index 00000000..ebce2352
--- /dev/null
+++ b/test/syntax/code/clojure
@@ -0,0 +1,18 @@
+; Comment
+
+(def
+ ^{:macro true
+ :added "1.0"}
+ let (fn* let [&form &env & decl] (cons 'let* decl)))
+
+(def ^:dynamic chunk-size 17)
+
+(defn next-chunk [rdr]
+ (let [buf (char-array chunk-size)
+ s (.read rdr buf)]
+ (when (pos? s)
+ (java.nio.CharBuffer/wrap buf 0 s))))
+
+(defn chunk-seq [rdr]
+ (when-let [chunk (next-chunk rdr)]
+ (cons chunk (lazy-seq (chunk-seq rdr)))))
diff --git a/test/syntax/code/cmake b/test/syntax/code/cmake
new file mode 100644
index 00000000..2bbea38c
--- /dev/null
+++ b/test/syntax/code/cmake
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.8)
+project(cmake_example)
+
+# Show message on Linux platform
+if (${CMAKE_SYSTEM_NAME} MATCHES Linux)
+ message("Good choice, bro!")
+endif()
+
+# Tell CMake to run moc when necessary:
+set(CMAKE_AUTOMOC ON)
+# As moc files are generated in the binary dir,
+# tell CMake to always look for includes there:
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# Widgets finds its own dependencies.
+find_package(Qt5Widgets REQUIRED)
+
+add_executable(myproject main.cpp mainwindow.cpp)
+qt5_use_modules(myproject Widgets)
diff --git a/test/syntax/code/cpp b/test/syntax/code/cpp
new file mode 100644
index 00000000..37497ac5
--- /dev/null
+++ b/test/syntax/code/cpp
@@ -0,0 +1,15 @@
+#include <iostream>
+#define IABS(x) ((x) < 0 ? -(x) : (x))
+
+int main(int argc, char *argv[]) {
+
+ /* An annoying "Hello World" example */
+ for (auto i = 0; i < 0xFFFF; i++)
+ cout << "Hello, World!" << endl;
+
+ char c = '\n';
+ unordered_map <string, vector<string> > m;
+ m["key"] = "\\\\"; // this is an error
+
+ return -2e3 + 12l;
+}
diff --git a/test/syntax/code/cs b/test/syntax/code/cs
new file mode 100644
index 00000000..f58190a1
--- /dev/null
+++ b/test/syntax/code/cs
@@ -0,0 +1,38 @@
+using System;
+
+#pragma warning disable 414, 3021
+
+public class Program
+{
+ /// <summary>The entry point to the program.</summary>
+ public static int Main(string[] args)
+ {
+ Console.WriteLine("Hello, World!");
+ string s = @"This
+""string""
+spans
+multiple
+lines!";
+
+ dynamic x = new ExpandoObject();
+ x.MyProperty = 2;
+
+ return 0;
+ }
+}
+
+async Task<int> AccessTheWebAsync()
+{
+ // ...
+ string urlContents = await getStringTask;
+ return urlContents.Length;
+}
+
+internal static void ExceptionFilters()
+{
+ try
+ {
+ throw new Exception();
+ }
+ catch (Exception e) when (e.Message == "My error") { }
+}
diff --git a/test/syntax/code/css b/test/syntax/code/css
new file mode 100644
index 00000000..e7a102b0
--- /dev/null
+++ b/test/syntax/code/css
@@ -0,0 +1,25 @@
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+ body:first-of-type pre::after {
+ content: 'highlight: ' attr(class);
+ }
+ body {
+ background: linear-gradient(45deg, blue, red);
+ }
+}
+
+@import url('print.css');
+@page:right {
+ margin: 1cm 2cm 1.3cm 4cm;
+}
+
+@font-face {
+ font-family: Chunkfive; src: url('Chunkfive.otf');
+}
+
+div.text,
+#content,
+li[lang=ru] {
+ font: Tahoma, Chunkfive, sans-serif;
+ background: url('hatch.png') /* wtf? */; color: #F0F0F0 !important;
+ width: 100%;
+}
diff --git a/test/syntax/code/d b/test/syntax/code/d
new file mode 100644
index 00000000..92cc8d84
--- /dev/null
+++ b/test/syntax/code/d
@@ -0,0 +1,44 @@
+#!/usr/bin/rdmd
+// Computes average line length for standard input.
+import std.stdio;
+
+/+
+ this is a /+ nesting +/ comment
++/
+
+enum COMPILED_ON = __TIMESTAMP__; // special token
+
+enum character = '©';
+enum copy_valid = '&copy;';
+enum backslash_escaped = '\\';
+
+// string literals
+enum str = `hello "world"!`;
+enum multiline = r"lorem
+ipsum
+dolor"; // wysiwyg string, no escapes here allowed
+enum multiline2 = "sit
+amet
+\"adipiscing\"
+elit.";
+enum hex = x"66 6f 6f"; // same as "foo"
+
+#line 5
+
+// float literals
+enum f = [3.14f, .1, 1., 1e100, 0xc0de.01p+100];
+
+static if (something == true) {
+ import std.algorithm;
+}
+
+void main() pure nothrow @safe {
+ ulong lines = 0;
+ double sumLength = 0;
+ foreach (line; stdin.byLine()) {
+ ++lines;
+ sumLength += line.length;
+ }
+ writeln("Average line length: ",
+ lines ? sumLength / lines : 0);
+}
diff --git a/test/syntax/code/diff b/test/syntax/code/diff
new file mode 100644
index 00000000..4f4c04fe
--- /dev/null
+++ b/test/syntax/code/diff
@@ -0,0 +1,30 @@
+Index: languages/ini.js
+===================================================================
+--- languages/ini.js (revision 199)
++++ languages/ini.js (revision 200)
+@@ -1,8 +1,7 @@
+ hljs.LANGUAGES.ini =
+ {
+ case_insensitive: true,
+- defaultMode:
+- {
++ defaultMode: {
+ contains: ['comment', 'title', 'setting'],
+ illegal: '[^\\s]'
+ },
+
+*** /path/to/original timestamp
+--- /path/to/new timestamp
+***************
+*** 1,3 ****
+--- 1,9 ----
++ This is an important
++ notice! It should
++ therefore be located at
++ the beginning of this
++ document!
+
+! compress the size of the
+! changes.
+
+ It is important to spell
diff --git a/test/syntax/code/django b/test/syntax/code/django
new file mode 100644
index 00000000..150037f5
--- /dev/null
+++ b/test/syntax/code/django
@@ -0,0 +1,16 @@
+{% if articles|length %}
+{% for article in articles %}
+
+{# Striped table #}
+<tr class="{% cycle odd,even %}">
+ <td>{{ article|default:"Hi... "|escape }}</td>
+ <td {% if article.today %}class="today"{% endif %}>{{ article.date|date:'d.m.Y' }}</td>
+</tr>
+
+{% endfor %}
+{% endif %}
+
+{% comment %}
+Comments may be long and multiline.
+Markup is <em>not</em> highlighted within comments.
+{% endcomment %}
diff --git a/test/syntax/code/dockerfile b/test/syntax/code/dockerfile
new file mode 100644
index 00000000..e796dc7e
--- /dev/null
+++ b/test/syntax/code/dockerfile
@@ -0,0 +1,48 @@
+# Example instructions from https://docs.docker.com/reference/builder/
+FROM ubuntu:14.04
+
+MAINTAINER example@example.com
+
+ENV foo /bar
+WORKDIR ${foo} # WORKDIR /bar
+ADD . $foo # ADD . /bar
+COPY \$foo /quux # COPY $foo /quux
+
+RUN apt-get update && apt-get install -y software-properties-common\
+ zsh curl wget git htop\
+ unzip vim telnet
+RUN ["/bin/bash", "-c", "echo hello ${USER}"]
+
+CMD ["executable","param1","param2"]
+CMD command param1 param2
+
+EXPOSE 1337
+
+ENV myName="John Doe" myDog=Rex\ The\ Dog \
+ myCat=fluffy
+
+ENV myName John Doe
+ENV myDog Rex The Dog
+ENV myCat fluffy
+
+ADD hom* /mydir/ # adds all files starting with "hom"
+ADD hom?.txt /mydir/ # ? is replaced with any single character
+
+COPY hom* /mydir/ # adds all files starting with "hom"
+COPY hom?.txt /mydir/ # ? is replaced with any single character
+
+ENTRYPOINT ["executable", "param1", "param2"]
+ENTRYPOINT command param1 param2
+
+VOLUME ["/data"]
+
+USER daemon
+
+LABEL com.example.label-with-value="foo"
+LABEL version="1.0"
+LABEL description="This text illustrates \
+that label-values can span multiple lines."
+
+WORKDIR /path/to/workdir
+
+ONBUILD ADD . /app/src
diff --git a/test/syntax/code/dos b/test/syntax/code/dos
new file mode 100644
index 00000000..246ca3d9
--- /dev/null
+++ b/test/syntax/code/dos
@@ -0,0 +1,24 @@
+cd \
+copy a b
+ping 192.168.0.1
+@rem ping 192.168.0.1
+net stop sharedaccess
+del %tmp% /f /s /q
+del %temp% /f /s /q
+ipconfig /flushdns
+taskkill /F /IM JAVA.EXE /T
+
+cd Photoshop/Adobe Photoshop CS3/AMT/
+if exist application.sif (
+ ren application.sif _application.sif
+) else (
+ ren _application.sif application.sif
+)
+
+taskkill /F /IM proquota.exe /T
+
+sfc /SCANNOW
+
+set path = test
+
+xcopy %1\*.* %2
diff --git a/test/syntax/code/erb b/test/syntax/code/erb
new file mode 100644
index 00000000..f7ea6203
--- /dev/null
+++ b/test/syntax/code/erb
@@ -0,0 +1,10 @@
+<%# this is a comment %>
+
+<% @posts.each do |post| %>
+ <p><%= link_to post.title, post %></p>
+<% end %>
+
+<%- available_things = things.select(&:available?) -%>
+<%%- x = 1 + 2 -%%>
+<%% value = 'real string #{@value}' %%>
+<%%= available_things.inspect %%>
diff --git a/test/syntax/code/fsharp b/test/syntax/code/fsharp
new file mode 100644
index 00000000..b7a00317
--- /dev/null
+++ b/test/syntax/code/fsharp
@@ -0,0 +1,48 @@
+open System
+
+// Single line comment...
+(*
+ This is a
+ multiline comment.
+*)
+let checkList alist =
+ match alist with
+ | [] -> 0
+ | [a] -> 1
+ | [a; b] -> 2
+ | [a; b; c] -> 3
+ | _ -> failwith "List is too big!"
+
+
+let text = "Some text..."
+let text2 = @"A ""verbatim"" string..."
+let catalog = """
+Some "long" string...
+"""
+
+let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2)
+
+let fibs =
+ Async.Parallel [ for i in 0..40 -> async { return fib(i) } ]
+ |> Async.RunSynchronously
+
+type Sprocket(gears) =
+ member this.Gears : int = gears
+
+[<AbstractClass>]
+type Animal =
+ abstract Speak : unit -> unit
+
+type Widget =
+ | RedWidget
+ | GreenWidget
+
+type Point = {X: float; Y: float;}
+
+[<Measure>]
+type s
+let minutte = 60<s>
+
+type DefaultMailbox<'a>() =
+ let mutable inbox = ConcurrentQueue<'a>()
+ let awaitMsg = new AutoResetEvent(false)
diff --git a/test/syntax/code/go b/test/syntax/code/go
new file mode 100644
index 00000000..aa8663a9
--- /dev/null
+++ b/test/syntax/code/go
@@ -0,0 +1,34 @@
+package main
+
+import (
+ "fmt"
+ "os"
+)
+
+const (
+ Sunday = iota
+ numberOfDays // this constant is not exported
+)
+
+type Foo interface {
+ FooFunc(int, float32) (complex128, []int)
+}
+
+type Bar struct {
+ os.File /* multi-line
+ comment */
+ PublicData chan int
+}
+
+func main() {
+ ch := make(chan int)
+ ch <- 1
+ x, ok := <- ch
+ ok = true
+ float_var := 1.0e10
+ defer fmt.Println('\'')
+ defer fmt.Println(`exitting now\`)
+ var fv1 float64 = 0.75
+ go println(len("hello world!"))
+ return
+}
diff --git a/test/syntax/code/haml b/test/syntax/code/haml
new file mode 100644
index 00000000..fb4bab32
--- /dev/null
+++ b/test/syntax/code/haml
@@ -0,0 +1,14 @@
+!!! XML
+%html
+ %body
+ %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
+ /html comment
+ -# ignore this line
+ %ul(style='margin: 0')
+ -items.each do |i|
+ %i= i
+ = variable
+ =variable2
+ ~ variable3
+ ~variable4
+ The current year is #{DataTime.now.year}.
diff --git a/test/syntax/code/haskell b/test/syntax/code/haskell
new file mode 100644
index 00000000..acb83786
--- /dev/null
+++ b/test/syntax/code/haskell
@@ -0,0 +1,38 @@
+{-# LANGUAGE TypeSynonymInstances #-}
+module Network.UDP
+( DataPacket(..)
+, openBoundUDPPort
+, openListeningUDPPort
+, pingUDPPort
+, sendUDPPacketTo
+, recvUDPPacket
+, recvUDPPacketFrom
+) where
+
+import qualified Data.ByteString as Strict (ByteString, concat, singleton)
+import qualified Data.ByteString.Lazy as Lazy (ByteString, toChunks, fromChunks)
+import Data.ByteString.Char8 (pack, unpack)
+import Network.Socket hiding (sendTo, recv, recvFrom)
+import Network.Socket.ByteString (sendTo, recv, recvFrom)
+
+-- Type class for converting StringLike types to and from strict ByteStrings
+class DataPacket a where
+ toStrictBS :: a -> Strict.ByteString
+ fromStrictBS :: Strict.ByteString -> a
+
+instance DataPacket Strict.ByteString where
+ toStrictBS = id
+ {-# INLINE toStrictBS #-}
+ fromStrictBS = id
+ {-# INLINE fromStrictBS #-}
+
+openBoundUDPPort :: String -> Int -> IO Socket
+openBoundUDPPort uri port = do
+ s <- getUDPSocket
+ bindAddr <- inet_addr uri
+ let a = SockAddrInet (toEnum port) bindAddr
+ bindSocket s a
+ return s
+
+pingUDPPort :: Socket -> SockAddr -> IO ()
+pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return ()
diff --git a/test/syntax/code/http b/test/syntax/code/http
new file mode 100644
index 00000000..34631a1d
--- /dev/null
+++ b/test/syntax/code/http
@@ -0,0 +1,6 @@
+POST /task?id=1 HTTP/1.1
+Host: example.org
+Content-Type: application/json; charset=utf-8
+Content-Length: 19
+
+{"status": "ok", "extended": true}
diff --git a/test/syntax/code/ini b/test/syntax/code/ini
new file mode 100644
index 00000000..03a5c297
--- /dev/null
+++ b/test/syntax/code/ini
@@ -0,0 +1,12 @@
+; boilerplate
+[package]
+name = "some_name"
+authors = ["Author"]
+description = "This is \
+a description"
+
+[[lib]]
+name = ${NAME}
+default = True
+auto = no
+counter = 1_000
diff --git a/test/syntax/code/java b/test/syntax/code/java
new file mode 100644
index 00000000..7683240c
--- /dev/null
+++ b/test/syntax/code/java
@@ -0,0 +1,35 @@
+/**
+ * @author John Smith <john.smith@example.com>
+ * @version 1.0
+*/
+package l2f.gameserver.model;
+
+import java.util.ArrayList;
+
+public abstract class L2Character extends L2Object {
+ public static final Short ABNORMAL_EFFECT_BLEEDING = 0x0_0_0_1; // not sure
+
+ public void moveTo(int x, int y, int z) {
+ _ai = null;
+ _log.warning("Should not be called");
+ if (1 > 5) {
+ return;
+ }
+ }
+
+ /** Task of AI notification */
+ @SuppressWarnings( { "nls", "unqualified-field-access", "boxing" })
+ public class NotifyAITask implements Runnable {
+ private final CtrlEvent _evt;
+
+ List<String> mList = new ArrayList<String>()
+
+ public void run() {
+ try {
+ getAI().notifyEvent(_evt, _evt.class, null);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/test/syntax/code/javascript b/test/syntax/code/javascript
new file mode 100644
index 00000000..5a6bc04e
--- /dev/null
+++ b/test/syntax/code/javascript
@@ -0,0 +1,37 @@
+import {x, y} as p from 'point';
+const ANSWER = 42;
+
+class Car extends Vehicle {
+ constructor(speed, cost) {
+ super(speed);
+
+ var c = Symbol('cost');
+ this[c] = cost;
+
+ this.intro = `This is a car runs at
+ ${speed}.`;
+ }
+}
+
+for (let num of [1, 2, 3]) {
+ console.log(num + 0b111110111);
+}
+
+function $initHighlight(block, flags) {
+ try {
+ if (block.className.search(/\bno\-highlight\b/) != -1)
+ return processBlock(block.function, true, 0x0F) + ' class=""';
+ } catch (e) {
+ /* handle exception */
+ var e4x =
+ <div>Example
+ <p>1234</p></div>;
+ }
+ for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp
+ if (checkCondition(classes[i]) === undefined)
+ return /\d+[\s/]/g;
+ }
+ console.log(Array.every(classes, Boolean));
+}
+
+export $initHighlight;
diff --git a/test/syntax/code/json b/test/syntax/code/json
new file mode 100644
index 00000000..9710b228
--- /dev/null
+++ b/test/syntax/code/json
@@ -0,0 +1,12 @@
+[
+ {
+ "title": "apples",
+ "count": [12000, 20000],
+ "description": {"text": "...", "sensitive": false}
+ },
+ {
+ "title": "oranges",
+ "count": [17500, null],
+ "description": {"text": "...", "sensitive": false}
+ }
+]
diff --git a/test/syntax/code/lisp b/test/syntax/code/lisp
new file mode 100644
index 00000000..2b622087
--- /dev/null
+++ b/test/syntax/code/lisp
@@ -0,0 +1,22 @@
+#!/usr/bin/env csi
+
+(defun prompt-for-cd ()
+ "Prompts
+ for CD"
+ (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6))
+ (prompt-read "Artist" &rest)
+ (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
+ (if x (format t "yes") (format t "no" nil) ;and here comment
+ )
+ ;; second line comment
+ '(+ 1 2)
+ (defvar *lines*) ; list of all lines
+ (position-if-not #'sys::whitespacep line :start beg))
+ (quote (privet 1 2 3))
+ '(hello world)
+ (* 5 7)
+ (1 2 34 5)
+ (:use "aaaa")
+ (let ((x 10) (y 20))
+ (print (+ x y))
+ )
diff --git a/test/syntax/code/lua b/test/syntax/code/lua
new file mode 100644
index 00000000..58174ee6
--- /dev/null
+++ b/test/syntax/code/lua
@@ -0,0 +1,32 @@
+--[[
+Simple signal/slot implementation
+]]
+local signal_mt = {
+ __index = {
+ register = table.insert
+ }
+}
+function signal_mt.__index:emit(... --[[ Comment in params ]])
+ for _, slot in ipairs(self) do
+ slot(self, ...)
+ end
+end
+local function create_signal()
+ return setmetatable({}, signal_mt)
+end
+
+-- Signal test
+local signal = create_signal()
+signal:register(function(signal, ...)
+ print(...)
+end)
+signal:emit('Answer to Life, the Universe, and Everything:', 42)
+
+--[==[ [=[ [[
+Nested ]]
+multi-line ]=]
+comment ]==]
+[==[ Nested
+[=[ multi-line
+[[ string
+]] ]=] ]==]
diff --git a/test/syntax/code/makefile b/test/syntax/code/makefile
new file mode 100644
index 00000000..cd1ec79d
--- /dev/null
+++ b/test/syntax/code/makefile
@@ -0,0 +1,13 @@
+# Makefile
+
+BUILDDIR = _build
+EXTRAS ?= $(BUILDDIR)/extras
+
+.PHONY: main clean
+
+main:
+ @echo "Building main facility..."
+ build_main $(BUILDDIR)
+
+clean:
+ rm -rf $(BUILDDIR)/*
diff --git a/test/syntax/code/markdown b/test/syntax/code/markdown
new file mode 100644
index 00000000..e7f66da9
--- /dev/null
+++ b/test/syntax/code/markdown
@@ -0,0 +1,22 @@
+# hello world
+
+you can write text [with links](http://example.com) inline or [link references][1].
+
+* one _thing_ has *em*phasis
+* two __things__ are **bold**
+
+[1]: http://example.com
+
+---
+
+hello world
+===========
+
+<this_is inline="xml"></this_is>
+
+> markdown is so cool
+
+ so are code segments
+
+1. one thing (yeah!)
+2. two thing `i can write code`, and `more` wipee!
diff --git a/test/syntax/code/matlab b/test/syntax/code/matlab
new file mode 100644
index 00000000..81fa7175
--- /dev/null
+++ b/test/syntax/code/matlab
@@ -0,0 +1,45 @@
+n = 20; % number of points
+points = [random('unid', 100, n, 1), random('unid', 100, n, 1)];
+len = zeros(1, n - 1);
+points = sortrows(points);
+%% Initial set of points
+plot(points(:,1),points(:,2));
+for i = 1: n-1
+ len(i) = points(i + 1, 1) - points(i, 1);
+end
+while(max(len) > 2 * min(len))
+ [d, i] = max(len);
+ k = on_margin(points, i, d, -1);
+ m = on_margin(points, i + 1, d, 1);
+ xm = 0; ym = 0;
+%% New point
+ if(i == 1 || i + 1 == n)
+ xm = mean(points([i,i+1],1))
+ ym = mean(points([i,i+1],2))
+ else
+ [xm, ym] = dlg1(points([k, i, i + 1, m], 1), ...
+ points([k, i, i + 1, m], 2))
+ end
+
+ points = [ points(1:i, :); [xm, ym]; points(i + 1:end, :)];
+end
+
+%{
+ This is a block comment. Please ignore me.
+%}
+
+function [net] = get_fit_network(inputs, targets)
+ % Create Network
+ numHiddenNeurons = 20; % Adjust as desired
+ net = newfit(inputs,targets,numHiddenNeurons);
+ net.trainParam.goal = 0.01;
+ net.trainParam.epochs = 1000;
+ % Train and Apply Network
+ [net,tr] = train(net,inputs,targets);
+end
+
+foo_matrix = [1, 2, 3; 4, 5, 6]''';
+foo_cell = {1, 2, 3; 4, 5, 6}''.'.';
+
+cell2flatten = {1,2,3,4,5};
+flattenedcell = cat(1, cell2flatten{:});
diff --git a/test/syntax/code/nginx b/test/syntax/code/nginx
new file mode 100644
index 00000000..adf4b7e9
--- /dev/null
+++ b/test/syntax/code/nginx
@@ -0,0 +1,47 @@
+user www www;
+worker_processes 2;
+pid /var/run/nginx.pid;
+error_log /var/log/nginx.error_log debug | info | notice | warn | error | crit;
+
+events {
+ connections 2000;
+ use kqueue | rtsig | epoll | /dev/poll | select | poll;
+}
+
+http {
+ log_format main '$remote_addr - $remote_user [$time_local] '
+ '"$request" $status $bytes_sent '
+ '"$http_referer" "$http_user_agent" '
+ '"$gzip_ratio"';
+
+ send_timeout 3m;
+ client_header_buffer_size 1k;
+
+ gzip on;
+ gzip_min_length 1100;
+
+ #lingering_time 30;
+
+ server {
+ server_name one.example.com www.one.example.com;
+ access_log /var/log/nginx.access_log main;
+
+ rewrite (.*) /index.php?page=$1 break;
+
+ location / {
+ proxy_pass http://127.0.0.1/;
+ proxy_redirect off;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ charset koi8-r;
+ }
+
+ location /api/ {
+ fastcgi_pass 127.0.0.1:9000;
+ }
+
+ location ~* \.(jpg|jpeg|gif)$ {
+ root /spool/www;
+ }
+ }
+}
diff --git a/test/syntax/code/objectivec b/test/syntax/code/objectivec
new file mode 100644
index 00000000..177f2ff3
--- /dev/null
+++ b/test/syntax/code/objectivec
@@ -0,0 +1,43 @@
+#import <UIKit/UIKit.h>
+#import "Dependency.h"
+
+@protocol WorldDataSource
+@optional
+- (NSString*)worldName;
+@required
+- (BOOL)allowsToLive;
+@end
+
+@interface Test : NSObject <HelloDelegate, WorldDataSource> {
+ NSString *_greeting;
+}
+
+@property (nonatomic, readonly) NSString *greeting;
+- (IBAction) show;
+@end
+
+@implementation Test
+
+@synthesize test=_test;
+
++ (id) test {
+ return [self testWithGreeting:@"Hello, world!\nFoo bar!"];
+}
+
++ (id) testWithGreeting:(NSString*)greeting {
+ return [[[self alloc] initWithGreeting:greeting] autorelease];
+}
+
+- (id) initWithGreeting:(NSString*)greeting {
+ if ( (self = [super init]) ) {
+ _greeting = [greeting retain];
+ }
+ return self;
+}
+
+- (void) dealloc {
+ [_greeting release];
+ [super dealloc];
+}
+
+@end
diff --git a/test/syntax/code/perl b/test/syntax/code/perl
new file mode 100644
index 00000000..3b08442d
--- /dev/null
+++ b/test/syntax/code/perl
@@ -0,0 +1,41 @@
+# loads object
+sub load
+{
+ my $flds = $c->db_load($id,@_) || do {
+ Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef
+ };
+ my $o = $c->_perl_new();
+ $id12 = $id / 24 / 3600;
+ $o->{'ID'} = $id12 + 123;
+ #$o->{'SHCUT'} = $flds->{'SHCUT'};
+ my $p = $o->props;
+ my $vt;
+ $string =~ m/^sought_text$/;
+ $items = split //, 'abc';
+ $string //= "bar";
+ for my $key (keys %$p)
+ {
+ if(${$vt.'::property'}) {
+ $o->{$key . '_real'} = $flds->{$key};
+ tie $o->{$key}, 'CMSBuilder::Property', $o, $key;
+ }
+ }
+ $o->save if delete $o->{'_save_after_load'};
+
+ # GH-117
+ my $g = glob("/usr/bin/*");
+
+ return $o;
+}
+
+__DATA__
+@@ layouts/default.html.ep
+<!DOCTYPE html>
+<html>
+ <head><title><%= title %></title></head>
+ <body><%= content %></body>
+</html>
+__END__
+
+=head1 NAME
+POD till the end of file
diff --git a/test/syntax/code/php b/test/syntax/code/php
new file mode 100644
index 00000000..ec43315f
--- /dev/null
+++ b/test/syntax/code/php
@@ -0,0 +1,52 @@
+require_once 'Zend/Uri/Http.php';
+
+namespace Location\Web;
+
+interface Factory
+{
+ static function _factory();
+}
+
+abstract class URI extends BaseURI implements Factory
+{
+ abstract function test();
+
+ public static $st1 = 1;
+ const ME = "Yo";
+ var $list = NULL;
+ private $var;
+
+ /**
+ * Returns a URI
+ *
+ * @return URI
+ */
+ static public function _factory($stats = array(), $uri = 'http')
+ {
+ echo __METHOD__;
+ $uri = explode(':', $uri, 0b10);
+ $schemeSpecific = isset($uri[1]) ? $uri[1] : '';
+ $desc = 'Multi
+line description';
+
+ // Security check
+ if (!ctype_alnum($scheme)) {
+ throw new Zend_Uri_Exception('Illegal scheme');
+ }
+
+ $this->var = 0 - self::$st;
+ $this->list = list(Array("1"=> 2, 2=>self::ME, 3 => \Location\Web\URI::class));
+
+ return [
+ 'uri' => $uri,
+ 'value' => null,
+ ];
+ }
+}
+
+echo URI::ME . URI::$st1;
+
+__halt_compiler () ; datahere
+datahere
+datahere */
+datahere
diff --git a/test/syntax/code/python b/test/syntax/code/python
new file mode 100644
index 00000000..1216323c
--- /dev/null
+++ b/test/syntax/code/python
@@ -0,0 +1,12 @@
+@requires_authorization
+def somefunc(param1='', param2=0):
+ r'''A docstring'''
+ if param1 > param2: # interesting
+ print 'Gre\'ater'
+ return (param2 - param1 + 1 + 0b10l) or None
+
+class SomeClass:
+ pass
+
+>>> message = '''interpreter
+... prompt'''
diff --git a/test/syntax/code/r b/test/syntax/code/r
new file mode 100644
index 00000000..2f277478
--- /dev/null
+++ b/test/syntax/code/r
@@ -0,0 +1,68 @@
+library(ggplot2)
+
+centre <- function(x, type, ...) {
+ switch(type,
+ mean = mean(x),
+ median = median(x),
+ trimmed = mean(x, trim = .1))
+}
+
+myVar1
+myVar.2
+data$x
+foo "bar" baz
+# test "test"
+"test # test"
+
+(123) (1) (10) (0.1) (.2) (1e-7)
+(1.2e+7) (2e) (3e+10) (0x0) (0xa)
+(0xabcdef1234567890) (123L) (1L)
+(0x10L) (10000000L) (1e6L) (1.1L)
+(1e-3L) (4123.381E-10i)
+(3.) (3.E10) # BUG: .E10 should be part of number
+
+# Numbers in some different contexts
+1L
+0x40
+.234
+3.
+1L + 30
+plot(cars, xlim=20)
+plot(cars, xlim=0x20)
+foo<-30
+my.data.3 <- read() # not a number
+c(1,2,3)
+1%%2
+
+"this is a quote that spans
+multiple lines
+\"
+
+is this still a quote? it should be.
+# even still!
+
+" # now we're done.
+
+'same for
+single quotes #'
+
+# keywords
+NULL, NA, TRUE, FALSE, Inf, NaN, NA_integer_,
+NA_real_, NA_character_, NA_complex_, function,
+while, repeat, for, if, in, else, next, break,
+..., ..1, ..2
+
+# not keywords
+the quick brown fox jumped over the lazy dogs
+null na true false inf nan na_integer_ na_real_
+na_character_ na_complex_ Function While Repeat
+For If In Else Next Break .. .... "NULL" `NULL` 'NULL'
+
+# operators
++, -, *, /, %%, ^, >, >=, <, <=, ==, !=, !, &, |, ~,
+->, <-, <<-, $, :, ::
+
+# infix operator
+foo %union% bar
+%"test"%
+`"test"`
diff --git a/test/syntax/code/ruby b/test/syntax/code/ruby
new file mode 100644
index 00000000..1fb23784
--- /dev/null
+++ b/test/syntax/code/ruby
@@ -0,0 +1,28 @@
+class A < B; def self.create(object = User) object end end
+class Zebra; def inspect; "X#{2 + self.object_id}" end end
+
+module ABC::DEF
+ include Comparable
+
+ # @param test
+ # @return [String] nothing
+ def foo(test)
+ Thread.new do |blockvar|
+ ABC::DEF.reverse(:a_symbol, :'a symbol', :<=>, 'test' + ?\012)
+ answer = valid?4 && valid?CONST && ?A && ?A.ord
+ end.join
+ end
+
+ def [](index) self[index] end
+ def ==(other) other == self end
+end
+
+class Car < ActiveRecord::Base
+ has_many :wheels, class_name: 'Wheel', foreign_key: 'car_id'
+ scope :available, -> { where(available: true) }
+end
+
+hash = {1 => 'one', 2 => 'two'}
+
+2.0.0p0 :001 > ['some']
+ => ["some"]
diff --git a/test/syntax/code/rust b/test/syntax/code/rust
new file mode 100644
index 00000000..6d0fd4d4
--- /dev/null
+++ b/test/syntax/code/rust
@@ -0,0 +1,55 @@
+use std;
+
+#![warn(unstable)]
+
+/* Factorial */
+fn fac(n: int) -> int {
+ let s: str = "This is
+a multi-line string.
+
+It ends with an unescaped '\"'.";
+ let c: char = 'Ф';
+ let r: str = r##" raw string "##;
+
+ let result = 1, i = 1;
+ while i <= n { // No parens around the condition
+ result *= i;
+ i += 1;
+ }
+ ret result;
+}
+
+pure fn pure_length<T>(ls: list<T>) -> uint { /* ... */ }
+
+type t = map::hashtbl<int,str>;
+let x = id::<int>(10);
+
+// Define some modules.
+#[path = "foo.rs"]
+mod foo;
+
+impl <T> Seq<T> for [T] {
+ fn len() -> uint { vec::len(self) }
+ fn iter(b: fn(T)) {
+ for elt in self { b(elt); }
+ }
+}
+
+enum list<T> {
+ Nil;
+ Cons(T, @list<T>);
+}
+
+let a: list<int> = Cons(7, @cons(13, @nil));
+
+struct Baz<'a> {
+ baz: &'a str,
+}
+
+'h: for i in range(0,10) {
+ 'g: loop {
+ if i % 2 == 0 { continue 'h; }
+ if i == 9 { break 'h; }
+ break 'g;
+ }
+}
diff --git a/test/syntax/code/scala b/test/syntax/code/scala
new file mode 100644
index 00000000..d0de6175
--- /dev/null
+++ b/test/syntax/code/scala
@@ -0,0 +1,44 @@
+case class Person(name: String, age: Int)
+
+def absoluteValue(n: Int): Int =
+ if (n < 0) -n else n
+
+val hux = "hux"
+def mux = "mux"
+def qux: String = "qux"
+
+type ξ[A] = (A, A)
+
+trait Hist { lhs =>
+ def ⊕(rhs: Hist): Hist
+}
+
+def gsum[A: Ring](as: Seq[A]): A =
+ as.foldLeft(Ring[A].zero)(_ + _)
+
+sealed trait Compass
+case object North extends Compass
+case object South extends Compass
+case object East extends Compass
+case object West extends Compass
+
+trait Cake {
+ type T;
+ val things: Seq[T]
+
+ abstract class Spindler
+
+ def spindle(s: Spindler, ts: Seq[T], reversed: Boolean = false): Seq[T]
+}
+
+val colors = Map(
+ "red" -> 0xFF0000,
+ "turquoise" -> 0x00FFFF,
+ "black" -> 0x000000,
+ "orange" -> 0xFF8040,
+ "brown" -> 0x804000)
+
+lazy val ns = for {
+ x <- 0 until 100
+ y <- 0 until 100
+} yield (x + y) * 33.33
diff --git a/test/syntax/code/scheme b/test/syntax/code/scheme
new file mode 100644
index 00000000..b62a98cb
--- /dev/null
+++ b/test/syntax/code/scheme
@@ -0,0 +1,28 @@
+;; Calculation of Hofstadter's male and female sequences as a list of pairs
+
+(define (hofstadter-male-female n)
+(letrec ((female (lambda (n)
+ (if (= n 0)
+ 1
+ (- n (male (female (- n 1)))))))
+ (male (lambda (n)
+ (if (= n 0)
+ 0
+ (- n (female (male (- n 1))))))))
+ (let loop ((i 0))
+ (if (> i n)
+ '()
+ (cons (cons (female i)
+ (male i))
+ (loop (+ i 1)))))))
+
+(hofstadter-male-female 8)
+
+(define (find-first func lst)
+(call-with-current-continuation
+ (lambda (return-immediately)
+ (for-each (lambda (x)
+ (if (func x)
+ (return-immediately x)))
+ lst)
+ #f)))
diff --git a/test/syntax/code/smalltalk b/test/syntax/code/smalltalk
new file mode 100644
index 00000000..7c960a72
--- /dev/null
+++ b/test/syntax/code/smalltalk
@@ -0,0 +1,39 @@
+Object>>method: num
+ "comment 123"
+ | var1 var2 |
+ (1 to: num) do: [:i | |var| ^i].
+ Klass with: var1.
+ Klass new.
+ arr := #('123' 123.345 #hello Transcript var $@).
+ arr := #().
+ var2 = arr at: 3.
+ ^ self abc
+
+heapExample
+ "HeapTest new heapExample"
+ "Multiline
+ decription"
+ | n rnd array time sorted |
+ n := 5000.
+ "# of elements to sort"
+ rnd := Random new.
+ array := (1 to: n)
+ collect: [:i | rnd next].
+ "First, the heap version"
+ time := Time
+ millisecondsToRun: [sorted := Heap withAll: array.
+ 1
+ to: n
+ do: [:i |
+ sorted removeFirst.
+ sorted add: rnd next]].
+ Transcript cr; show: 'Time for Heap: ' , time printString , ' msecs'.
+ "The quicksort version"
+ time := Time
+ millisecondsToRun: [sorted := SortedCollection withAll: array.
+ 1
+ to: n
+ do: [:i |
+ sorted removeFirst.
+ sorted add: rnd next]].
+ Transcript cr; show: 'Time for SortedCollection: ' , time printString , ' msecs'
diff --git a/test/syntax/code/tcl b/test/syntax/code/tcl
new file mode 100644
index 00000000..c05db107
--- /dev/null
+++ b/test/syntax/code/tcl
@@ -0,0 +1,26 @@
+package json
+
+source helper.tcl
+# randomness verified by a die throw
+set ::rand 4
+
+proc give::recursive::count {base p} { ; # 2 mandatory params
+ while {$p > 0} {
+ set result [expr $result * $base]; incr p -1
+ }
+ return $result
+}
+
+set a 'a'; set b "bcdef"; set lst [list "item"]
+puts [llength $a$b]
+
+set ::my::tid($id) $::my::tid(def)
+lappend lst $arr($idx) $::my::arr($idx) $ar(key)
+lreplace ::my::tid($id) 4 4
+puts $::rand ${::rand} ${::AWESOME::component::variable}
+
+puts "$x + $y is\t [expr $x + $y]"
+
+proc isprime x {
+ expr {$x>1 && ![regexp {^(oo+?)\1+$} [string repeat o $x]]}
+}
diff --git a/test/syntax/code/tex b/test/syntax/code/tex
new file mode 100644
index 00000000..10b25557
--- /dev/null
+++ b/test/syntax/code/tex
@@ -0,0 +1,17 @@
+\documentclass{article}
+\usepackage[koi8-r]{inputenc}
+\hoffset=0pt
+\voffset=.3em
+\tolerance=400
+\newcommand{\eTiX}{\TeX}
+\begin{document}
+\section*{Highlight.js}
+\begin{table}[c|c]
+$\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $
+\end{table}
+Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b
+G\"otterd\"ammerung~45\%=34.
+$$
+ \int\limits_{0}^{\pi}\frac{4}{x-7}=3
+$$
+\end{document}
diff --git a/test/syntax/code/vala b/test/syntax/code/vala
new file mode 100644
index 00000000..aed04682
--- /dev/null
+++ b/test/syntax/code/vala
@@ -0,0 +1,46 @@
+using DBus;
+
+namespace Test {
+ class Foo : Object {
+ public signal void some_event (); // definition of the signal
+ public void method () {
+ some_event (); // emitting the signal (callbacks get invoked)
+ }
+ }
+}
+
+/* defining a class */
+class Track : GLib.Object, Test.Foo { /* subclassing 'GLib.Object' */
+ public double mass; /* a public field */
+ public double name { get; set; } /* a public property */
+ private bool terminated = false; /* a private field */
+ public void terminate() { /* a public method */
+ terminated = true;
+ }
+}
+
+const ALL_UPPER_CASE = "you should follow this convention";
+
+var t = new Track(); // same as: Track t = new Track();
+var s = "hello"; // same as: string s = "hello";
+var l = new List<int>(); // same as: List<int> l = new List<int>();
+var i = 10; // same as: int i = 10;
+
+
+#if (ololo)
+Regex regex = /foo/;
+#endif
+
+/*
+ * Entry point can be outside class
+ */
+void main () {
+ var long_string = """
+ Example of "verbatim string".
+ Same as in @"string" in C#
+ """
+ var foo = new Foo ();
+ foo.some_event.connect (callback_a); // connecting the callback functions
+ foo.some_event.connect (callback_b);
+ foo.method ();
+}
diff --git a/test/syntax/code/xml b/test/syntax/code/xml
new file mode 100644
index 00000000..7f002c4b
--- /dev/null
+++ b/test/syntax/code/xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<response value="ok" xml:lang="en">
+ <text>Ok</text>
+ <comment html_allowed="true"/>
+ <ns1:description><![CDATA[
+ CDATA is <not> magical.
+ ]]></ns1:description>
+ <a></a> <a/>
+</response>
+
+
+<!DOCTYPE html>
+<title>Title</title>
+
+<style>body {width: 500px;}</style>
+
+<script type="application/javascript">
+ function $init() {return true;}
+</script>
+
+<body>
+ <p checked class="title" id='title'>Title</p>
+ <!-- here goes the rest of the page -->
+</body>
diff --git a/test/syntax/code/xquery b/test/syntax/code/xquery
new file mode 100644
index 00000000..9ac5efdf
--- /dev/null
+++ b/test/syntax/code/xquery
@@ -0,0 +1,20 @@
+declare option output:method 'json';
+
+(
+let $map := map { 'R': 'red', 'G': 'green', 'B': 'blue' }
+return (
+ $map?* (: 1. returns all values; same as: map:keys($map) ! $map(.) :),
+ $map?R (: 2. returns the value associated with the key 'R'; same as: $map('R') :),
+ $map?('G','B') (: 3. returns the values associated with the key 'G' and 'B' :)
+),
+
+('A', 'B', 'C') => count(),
+
+for $country in db:open('factbook')//country
+where $country/@population > 100000000
+let $name := $country/name[1]
+for $city in $country//city[population > 1000000]
+group by $name
+return <country name='{ $name }'>{ $city/name }</country>
+
+)
diff --git a/test/syntax/code/yaml b/test/syntax/code/yaml
new file mode 100644
index 00000000..49c4939e
--- /dev/null
+++ b/test/syntax/code/yaml
@@ -0,0 +1,39 @@
+---
+# comment
+string_1: "Bar"
+string_2: 'bar'
+string_3: bar
+inline_keys_ignored: sompath/name/file.jpg
+keywords_in_yaml:
+ - true
+ - false
+ - TRUE
+ - FALSE
+ - 21
+ - 21.0
+ - !!str 123
+"quoted_key": &foobar
+ bar: foo
+ foo:
+ "foo": bar
+
+reference: *foobar
+
+multiline_1: |
+ Multiline
+ String
+multiline_2: >
+ Multiline
+ String
+multiline_3: "
+ Multiline string
+ "
+
+ansible_variables: "foo {{variable}}"
+
+array_nested:
+- a
+- b: 1
+ c: 2
+- b
+- comment
diff --git a/test/syntax/dita.dita b/test/syntax/dita.dita
new file mode 100644
index 00000000..72662ed2
--- /dev/null
+++ b/test/syntax/dita.dita
@@ -0,0 +1,614 @@
+<topic xmlns:xi="http://www.w3.org/2001/XInclude"
+ id="dita">
+
+<title>Syntax Highlighting</title>
+
+<topic id="embedded">
+<title>Embedded Markup</title>
+<body>
+<codeblock outputclass="c">
+#include &lt;stdlib.h>
+int main(char** argv) {
+ // This is a <xref href="#">link</xref>
+ /* This is <varname>replaceable text</varname> */
+ int i = 12;
+ printf("hello %s\n", world);
+}
+</codeblock>
+</body>
+</topic>
+
+<topic id="actionscript">
+ <title>ActionScript</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="actionscript"</codeph></title>
+ <codeblock outputclass="actionscript"><xi:include parse="text" href="code/actionscript"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="apache">
+ <title>Apache Config</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="apache"</codeph></title>
+ <codeblock outputclass="apache"><xi:include parse="text" href="code/apache"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="asciidoc">
+ <title>AsciiDoc</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="asciidoc"</codeph></title>
+ <codeblock outputclass="asciidoc"><xi:include parse="text" href="code/asciidoc"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="adoc"</codeph></title>
+ <codeblock outputclass="adoc"><xi:include parse="text" href="code/asciidoc"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="bash">
+ <title>Bash</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="sh"</codeph></title>
+ <codeblock outputclass="sh"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="bash"</codeph></title>
+ <codeblock outputclass="bash"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="csh"</codeph></title>
+ <codeblock outputclass="csh"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="bourne"</codeph></title>
+ <codeblock outputclass="bourne"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="c">
+ <title>C</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="c"</codeph></title>
+ <codeblock outputclass="c"><xi:include parse="text" href="code/cpp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="cs">
+ <title>C#</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="cs"</codeph></title>
+ <codeblock outputclass="cs"><xi:include parse="text" href="code/cs"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="csharp"</codeph></title>
+ <codeblock outputclass="csharp"><xi:include parse="text" href="code/cs"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="cpp">
+ <title>C++</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="cpp"</codeph></title>
+ <codeblock outputclass="cpp"><xi:include parse="text" href="code/cpp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="c++"</codeph></title>
+ <codeblock outputclass="c++"><xi:include parse="text" href="code/cpp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="clojure">
+ <title>Clojure</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="clojure"</codeph></title>
+ <codeblock outputclass="clojure"><xi:include parse="text" href="code/clojure"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="clj"</codeph></title>
+ <codeblock outputclass="clj"><xi:include parse="text" href="code/clojure"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="cmake">
+ <title>CMake</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="cmake"</codeph></title>
+ <codeblock outputclass="cmake"><xi:include parse="text" href="code/cmake"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="css">
+ <title>CSS</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="css"</codeph></title>
+ <codeblock outputclass="css"><xi:include parse="text" href="code/css"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="css21"</codeph></title>
+ <codeblock outputclass="css21"><xi:include parse="text" href="code/css"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="d">
+ <title>D</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="d"</codeph></title>
+ <codeblock outputclass="d"><xi:include parse="text" href="code/d"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="diff">
+ <title>Diff</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="diff"</codeph></title>
+ <codeblock outputclass="diff"><xi:include parse="text" href="code/diff"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="patch"</codeph></title>
+ <codeblock outputclass="patch"><xi:include parse="text" href="code/diff"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="django">
+ <title>Django</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="django"</codeph></title>
+ <codeblock outputclass="django"><xi:include parse="text" href="code/django"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="dockerfile">
+ <title>Dockerfile</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="dockerfile"</codeph></title>
+ <codeblock outputclass="dockerfile"><xi:include parse="text" href="code/dockerfile"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="dos">
+ <title>DOS Batch</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="dos"</codeph></title>
+ <codeblock outputclass="dos"><xi:include parse="text" href="code/dos"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="erb">
+ <title>Embedded Ruby</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="erb"</codeph></title>
+ <codeblock outputclass="erb"><xi:include parse="text" href="code/erb"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="fsharp">
+ <title>F#</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="fsharp"</codeph></title>
+ <codeblock outputclass="fsharp"><xi:include parse="text" href="code/fsharp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="go">
+ <title>Go</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="go"</codeph></title>
+ <codeblock outputclass="go"><xi:include parse="text" href="code/go"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="haml">
+ <title>Haml</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="haml"</codeph></title>
+ <codeblock outputclass="haml"><xi:include parse="text" href="code/haml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="haskell">
+ <title>Haskell</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="haskell"</codeph></title>
+ <codeblock outputclass="haskell"><xi:include parse="text" href="code/haskell"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="hs"</codeph></title>
+ <codeblock outputclass="hs"><xi:include parse="text" href="code/haskell"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="html">
+ <title>HTML</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="html"</codeph></title>
+ <codeblock outputclass="html"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="xhtml"</codeph></title>
+ <codeblock outputclass="xhtml"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="http">
+ <title>HTTP</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="http"</codeph></title>
+ <codeblock outputclass="http"><xi:include parse="text" href="code/http"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="ini">
+ <title>INI</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="ini"</codeph></title>
+ <codeblock outputclass="ini"><xi:include parse="text" href="code/ini"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="java">
+ <title>Java</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="java"</codeph></title>
+ <codeblock outputclass="java"><xi:include parse="text" href="code/java"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="json">
+ <title>JSON</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="json"</codeph></title>
+ <codeblock outputclass="json"><xi:include parse="text" href="code/json"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="javascript">
+ <title>JavaScript</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="javascript"</codeph></title>
+ <codeblock outputclass="javascript"><xi:include parse="text" href="code/javascript"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="js"</codeph></title>
+ <codeblock outputclass="js"><xi:include parse="text" href="code/javascript"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="LISP">
+ <title>LISP</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="lisp"</codeph></title>
+ <codeblock outputclass="lisp"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="cl"</codeph></title>
+ <codeblock outputclass="cl"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="el"</codeph></title>
+ <codeblock outputclass="el"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="lsp"</codeph></title>
+ <codeblock outputclass="lsp"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="lua">
+ <title>Lua</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="lua"</codeph></title>
+ <codeblock outputclass="lua"><xi:include parse="text" href="code/lua"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="makefile">
+ <title>Makefile</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="makefile"</codeph></title>
+ <codeblock outputclass="makefile"><xi:include parse="text" href="code/makefile"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="make"</codeph></title>
+ <codeblock outputclass="make"><xi:include parse="text" href="code/makefile"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="markdown">
+ <title>Markdown</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="markdown"</codeph></title>
+ <codeblock outputclass="markdown"><xi:include parse="text" href="code/markdown"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="md"</codeph></title>
+ <codeblock outputclass="md"><xi:include parse="text" href="code/markdown"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="matlab">
+ <title>MATLAB/Octave</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="matlab"</codeph></title>
+ <codeblock outputclass="matlab"><xi:include parse="text" href="code/matlab"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="octave"</codeph></title>
+ <codeblock outputclass="octave"><xi:include parse="text" href="code/matlab"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="nginx">
+ <title>Nginx Config</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="nginx"</codeph></title>
+ <codeblock outputclass="nginx"><xi:include parse="text" href="code/nginx"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="objectivec">
+ <title>Objective-C</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="objc"</codeph></title>
+ <codeblock outputclass="objc"><xi:include parse="text" href="code/objectivec"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="m"</codeph></title>
+ <codeblock outputclass="m"><xi:include parse="text" href="code/objectivec"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="perl">
+ <title>Perl</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="perl"</codeph></title>
+ <codeblock outputclass="perl"><xi:include parse="text" href="code/perl"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="pl"</codeph></title>
+ <codeblock outputclass="pl"><xi:include parse="text" href="code/perl"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="pm"</codeph></title>
+ <codeblock outputclass="pm"><xi:include parse="text" href="code/perl"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="php">
+ <title>PHP</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="php"</codeph></title>
+ <codeblock outputclass="php"><xi:include parse="text" href="code/php"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="python">
+ <title>Python</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="python"</codeph></title>
+ <codeblock outputclass="python"><xi:include parse="text" href="code/python"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="py"</codeph></title>
+ <codeblock outputclass="py"><xi:include parse="text" href="code/python"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="r">
+ <title>R/S</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="r"</codeph></title>
+ <codeblock outputclass="r"><xi:include parse="text" href="code/r"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="s"</codeph></title>
+ <codeblock outputclass="s"><xi:include parse="text" href="code/r"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="ruby">
+ <title>Ruby</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="ruby"</codeph></title>
+ <codeblock outputclass="ruby"><xi:include parse="text" href="code/ruby"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="rb"</codeph></title>
+ <codeblock outputclass="rb"><xi:include parse="text" href="code/ruby"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="rust">
+ <title>Rust</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="rust"</codeph></title>
+ <codeblock outputclass="rust"><xi:include parse="text" href="code/rust"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="scala">
+ <title>Scala</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="scala"</codeph></title>
+ <codeblock outputclass="scala"><xi:include parse="text" href="code/scala"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="scheme">
+ <title>Scheme</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="scheme"</codeph></title>
+ <codeblock outputclass="scheme"><xi:include parse="text" href="code/scheme"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="scm"</codeph></title>
+ <codeblock outputclass="scm"><xi:include parse="text" href="code/scheme"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="smalltalk">
+ <title>Smalltalk</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="smalltalk"</codeph></title>
+ <codeblock outputclass="smalltalk"><xi:include parse="text" href="code/smalltalk"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="tcl">
+ <title>TCL</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="tcl"</codeph></title>
+ <codeblock outputclass="tcl"><xi:include parse="text" href="code/tcl"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="tex">
+ <title>TeX</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="tex"</codeph></title>
+ <codeblock outputclass="tex"><xi:include parse="text" href="code/tex"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="latex"</codeph></title>
+ <codeblock outputclass="latex"><xi:include parse="text" href="code/tex"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="vala">
+ <title>Vala</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="vala"</codeph></title>
+ <codeblock outputclass="vala"><xi:include parse="text" href="code/vala"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="xml">
+ <title>XML</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="xml"</codeph></title>
+ <codeblock outputclass="xml"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="myxml"</codeph></title>
+ <codeblock outputclass="myxml"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="xquery">
+ <title>XQuery</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="xquery"</codeph></title>
+ <codeblock outputclass="xquery"><xi:include parse="text" href="code/xquery"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="xq"</codeph></title>
+ <codeblock outputclass="xq"><xi:include parse="text" href="code/xquery"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="yaml">
+ <title>YAML</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="yaml"</codeph></title>
+ <codeblock outputclass="yaml"><xi:include parse="text" href="code/yaml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+</topic>
+
diff --git a/test/syntax/docbook.docbook b/test/syntax/docbook.docbook
new file mode 100644
index 00000000..12d0043c
--- /dev/null
+++ b/test/syntax/docbook.docbook
@@ -0,0 +1,517 @@
+<article xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ id="docbook">
+
+<title>Syntax Highlighting</title>
+
+<section id="embedded">
+<title>Embedded Markup</title>
+<programlisting language="c">
+#include &lt;stdlib.h>
+int main(char** argv) {
+ // This is a <link xlink:href="#">link</link>
+ /* This is <replaceable>replaceable text</replaceable> */
+ int i = 12;
+ printf("hello %s\n", world);
+}
+</programlisting>
+</section>
+
+<section id="actionscript">
+ <title>ActionScript</title>
+ <example>
+ <title><code>language="actionscript"</code></title>
+ <programlisting language="actionscript"><xi:include parse="text" href="code/actionscript"/></programlisting>
+ </example>
+</section>
+
+<section id="apache">
+ <title>Apache Config</title>
+ <example>
+ <title><code>language="apache"</code></title>
+ <programlisting language="apache"><xi:include parse="text" href="code/apache"/></programlisting>
+ </example>
+</section>
+
+<section id="asciidoc">
+ <title>AsciiDoc</title>
+ <example>
+ <title><code>language="asciidoc"</code></title>
+ <programlisting language="asciidoc"><xi:include parse="text" href="code/asciidoc"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="adoc"</code></title>
+ <programlisting language="adoc"><xi:include parse="text" href="code/asciidoc"/></programlisting>
+ </example>
+</section>
+
+<section id="bash">
+ <title>Bash</title>
+ <example>
+ <title><code>language="sh"</code></title>
+ <programlisting language="sh"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="bash"</code></title>
+ <programlisting language="bash"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="csh"</code></title>
+ <programlisting language="csh"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="bourne"</code></title>
+ <programlisting language="bourne"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+</section>
+
+<section id="c">
+ <title>C</title>
+ <example>
+ <title><code>language="c"</code></title>
+ <programlisting language="c"><xi:include parse="text" href="code/cpp"/></programlisting>
+ </example>
+</section>
+
+<section id="cs">
+ <title>C#</title>
+ <example>
+ <title><code>language="cs"</code></title>
+ <programlisting language="cs"><xi:include parse="text" href="code/cs"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="csharp"</code></title>
+ <programlisting language="csharp"><xi:include parse="text" href="code/cs"/></programlisting>
+ </example>
+</section>
+
+<section id="cpp">
+ <title>C++</title>
+ <example>
+ <title><code>language="cpp"</code></title>
+ <programlisting language="cpp"><xi:include parse="text" href="code/cpp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="c++"</code></title>
+ <programlisting language="c++"><xi:include parse="text" href="code/cpp"/></programlisting>
+ </example>
+</section>
+
+<section id="clojure">
+ <title>Clojure</title>
+ <example>
+ <title><code>language="clojure"</code></title>
+ <programlisting language="clojure"><xi:include parse="text" href="code/clojure"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="clj"</code></title>
+ <programlisting language="clj"><xi:include parse="text" href="code/clojure"/></programlisting>
+ </example>
+</section>
+
+<section id="cmake">
+ <title>CMake</title>
+ <example>
+ <title><code>language="cmake"</code></title>
+ <programlisting language="cmake"><xi:include parse="text" href="code/cmake"/></programlisting>
+ </example>
+</section>
+
+<section id="css">
+ <title>CSS</title>
+ <example>
+ <title><code>language="css"</code></title>
+ <programlisting language="css"><xi:include parse="text" href="code/css"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="css21"</code></title>
+ <programlisting language="css21"><xi:include parse="text" href="code/css"/></programlisting>
+ </example>
+</section>
+
+<section id="d">
+ <title>D</title>
+ <example>
+ <title><code>language="d"</code></title>
+ <programlisting language="d"><xi:include parse="text" href="code/d"/></programlisting>
+ </example>
+</section>
+
+<section id="diff">
+ <title>Diff</title>
+ <example>
+ <title><code>language="diff"</code></title>
+ <programlisting language="diff"><xi:include parse="text" href="code/diff"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="patch"</code></title>
+ <programlisting language="patch"><xi:include parse="text" href="code/diff"/></programlisting>
+ </example>
+</section>
+
+<section id="django">
+ <title>Django</title>
+ <example>
+ <title><code>language="django"</code></title>
+ <programlisting language="django"><xi:include parse="text" href="code/django"/></programlisting>
+ </example>
+</section>
+
+<section id="dockerfile">
+ <title>Dockerfile</title>
+ <example>
+ <title><code>language="dockerfile"</code></title>
+ <programlisting language="dockerfile"><xi:include parse="text" href="code/dockerfile"/></programlisting>
+ </example>
+</section>
+
+<section id="dos">
+ <title>DOS Batch</title>
+ <example>
+ <title><code>language="dos"</code></title>
+ <programlisting language="dos"><xi:include parse="text" href="code/dos"/></programlisting>
+ </example>
+</section>
+
+<section id="erb">
+ <title>Embedded Ruby</title>
+ <example>
+ <title><code>language="erb"</code></title>
+ <programlisting language="erb"><xi:include parse="text" href="code/erb"/></programlisting>
+ </example>
+</section>
+
+<section id="fsharp">
+ <title>F#</title>
+ <example>
+ <title><code>language="fsharp"</code></title>
+ <programlisting language="fsharp"><xi:include parse="text" href="code/fsharp"/></programlisting>
+ </example>
+</section>
+
+<section id="go">
+ <title>Go</title>
+ <example>
+ <title><code>language="go"</code></title>
+ <programlisting language="go"><xi:include parse="text" href="code/go"/></programlisting>
+ </example>
+</section>
+
+<section id="haml">
+ <title>Haml</title>
+ <example>
+ <title><code>language="haml"</code></title>
+ <programlisting language="haml"><xi:include parse="text" href="code/haml"/></programlisting>
+ </example>
+</section>
+
+<section id="haskell">
+ <title>Haskell</title>
+ <example>
+ <title><code>language="haskell"</code></title>
+ <programlisting language="haskell"><xi:include parse="text" href="code/haskell"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="hs"</code></title>
+ <programlisting language="hs"><xi:include parse="text" href="code/haskell"/></programlisting>
+ </example>
+</section>
+
+<section id="html">
+ <title>HTML</title>
+ <example>
+ <title><code>language="html"</code></title>
+ <programlisting language="html"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="xhtml"</code></title>
+ <programlisting language="xhtml"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+</section>
+
+<section id="http">
+ <title>HTTP</title>
+ <example>
+ <title><code>language="http"</code></title>
+ <programlisting language="http"><xi:include parse="text" href="code/http"/></programlisting>
+ </example>
+</section>
+
+<section id="ini">
+ <title>INI</title>
+ <example>
+ <title><code>language="ini"</code></title>
+ <programlisting language="ini"><xi:include parse="text" href="code/ini"/></programlisting>
+ </example>
+</section>
+
+<section id="java">
+ <title>Java</title>
+ <example>
+ <title><code>language="java"</code></title>
+ <programlisting language="java"><xi:include parse="text" href="code/java"/></programlisting>
+ </example>
+</section>
+
+<section id="json">
+ <title>JSON</title>
+ <example>
+ <title><code>language="json"</code></title>
+ <programlisting language="json"><xi:include parse="text" href="code/json"/></programlisting>
+ </example>
+</section>
+
+<section id="javascript">
+ <title>JavaScript</title>
+ <example>
+ <title><code>language="javascript"</code></title>
+ <programlisting language="javascript"><xi:include parse="text" href="code/javascript"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="js"</code></title>
+ <programlisting language="js"><xi:include parse="text" href="code/javascript"/></programlisting>
+ </example>
+</section>
+
+<section id="LISP">
+ <title>LISP</title>
+ <example>
+ <title><code>language="lisp"</code></title>
+ <programlisting language="lisp"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="cl"</code></title>
+ <programlisting language="cl"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="el"</code></title>
+ <programlisting language="el"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="lsp"</code></title>
+ <programlisting language="lsp"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+</section>
+
+<section id="lua">
+ <title>Lua</title>
+ <example>
+ <title><code>language="lua"</code></title>
+ <programlisting language="lua"><xi:include parse="text" href="code/lua"/></programlisting>
+ </example>
+</section>
+
+<section id="makefile">
+ <title>Makefile</title>
+ <example>
+ <title><code>language="makefile"</code></title>
+ <programlisting language="makefile"><xi:include parse="text" href="code/makefile"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="make"</code></title>
+ <programlisting language="make"><xi:include parse="text" href="code/makefile"/></programlisting>
+ </example>
+</section>
+
+<section id="markdown">
+ <title>Markdown</title>
+ <example>
+ <title><code>language="markdown"</code></title>
+ <programlisting language="markdown"><xi:include parse="text" href="code/markdown"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="md"</code></title>
+ <programlisting language="md"><xi:include parse="text" href="code/markdown"/></programlisting>
+ </example>
+</section>
+
+<section id="matlab">
+ <title>MATLAB/Octave</title>
+ <example>
+ <title><code>language="matlab"</code></title>
+ <programlisting language="matlab"><xi:include parse="text" href="code/matlab"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="octave"</code></title>
+ <programlisting language="octave"><xi:include parse="text" href="code/matlab"/></programlisting>
+ </example>
+</section>
+
+<section id="nginx">
+ <title>Nginx Config</title>
+ <example>
+ <title><code>language="nginx"</code></title>
+ <programlisting language="nginx"><xi:include parse="text" href="code/nginx"/></programlisting>
+ </example>
+</section>
+
+<section id="objectivec">
+ <title>Objective-C</title>
+ <example>
+ <title><code>language="objc"</code></title>
+ <programlisting language="objc"><xi:include parse="text" href="code/objectivec"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="m"</code></title>
+ <programlisting language="m"><xi:include parse="text" href="code/objectivec"/></programlisting>
+ </example>
+</section>
+
+<section id="perl">
+ <title>Perl</title>
+ <example>
+ <title><code>language="perl"</code></title>
+ <programlisting language="perl"><xi:include parse="text" href="code/perl"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="pl"</code></title>
+ <programlisting language="pl"><xi:include parse="text" href="code/perl"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="pm"</code></title>
+ <programlisting language="pm"><xi:include parse="text" href="code/perl"/></programlisting>
+ </example>
+</section>
+
+<section id="php">
+ <title>PHP</title>
+ <example>
+ <title><code>language="php"</code></title>
+ <programlisting language="php"><xi:include parse="text" href="code/php"/></programlisting>
+ </example>
+</section>
+
+<section id="python">
+ <title>Python</title>
+ <example>
+ <title><code>language="python"</code></title>
+ <programlisting language="python"><xi:include parse="text" href="code/python"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="py"</code></title>
+ <programlisting language="py"><xi:include parse="text" href="code/python"/></programlisting>
+ </example>
+</section>
+
+<section id="r">
+ <title>R/S</title>
+ <example>
+ <title><code>language="r"</code></title>
+ <programlisting language="r"><xi:include parse="text" href="code/r"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="s"</code></title>
+ <programlisting language="s"><xi:include parse="text" href="code/r"/></programlisting>
+ </example>
+</section>
+
+<section id="ruby">
+ <title>Ruby</title>
+ <example>
+ <title><code>language="ruby"</code></title>
+ <programlisting language="ruby"><xi:include parse="text" href="code/ruby"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="rb"</code></title>
+ <programlisting language="rb"><xi:include parse="text" href="code/ruby"/></programlisting>
+ </example>
+</section>
+
+<section id="rust">
+ <title>Rust</title>
+ <example>
+ <title><code>language="rust"</code></title>
+ <programlisting language="rust"><xi:include parse="text" href="code/rust"/></programlisting>
+ </example>
+</section>
+
+<section id="scala">
+ <title>Scala</title>
+ <example>
+ <title><code>language="scala"</code></title>
+ <programlisting language="scala"><xi:include parse="text" href="code/scala"/></programlisting>
+ </example>
+</section>
+
+<section id="scheme">
+ <title>Scheme</title>
+ <example>
+ <title><code>language="scheme"</code></title>
+ <programlisting language="scheme"><xi:include parse="text" href="code/scheme"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="scm"</code></title>
+ <programlisting language="scm"><xi:include parse="text" href="code/scheme"/></programlisting>
+ </example>
+</section>
+
+<section id="smalltalk">
+ <title>Smalltalk</title>
+ <example>
+ <title><code>language="smalltalk"</code></title>
+ <programlisting language="smalltalk"><xi:include parse="text" href="code/smalltalk"/></programlisting>
+ </example>
+</section>
+
+<section id="tcl">
+ <title>TCL</title>
+ <example>
+ <title><code>language="tcl"</code></title>
+ <programlisting language="tcl"><xi:include parse="text" href="code/tcl"/></programlisting>
+ </example>
+</section>
+
+<section id="tex">
+ <title>TeX</title>
+ <example>
+ <title><code>language="tex"</code></title>
+ <programlisting language="tex"><xi:include parse="text" href="code/tex"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="latex"</code></title>
+ <programlisting language="latex"><xi:include parse="text" href="code/tex"/></programlisting>
+ </example>
+</section>
+
+<section id="vala">
+ <title>Vala</title>
+ <example>
+ <title><code>language="vala"</code></title>
+ <programlisting language="vala"><xi:include parse="text" href="code/vala"/></programlisting>
+ </example>
+</section>
+
+<section id="xml">
+ <title>XML</title>
+ <example>
+ <title><code>language="xml"</code></title>
+ <programlisting language="xml"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="myxml"</code></title>
+ <programlisting language="myxml"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+</section>
+
+<section id="xquery">
+ <title>XQuery</title>
+ <example>
+ <title><code>language="xquery"</code></title>
+ <programlisting language="xquery"><xi:include parse="text" href="code/xquery"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="xq"</code></title>
+ <programlisting language="xq"><xi:include parse="text" href="code/xquery"/></programlisting>
+ </example>
+</section>
+
+<section id="yaml">
+ <title>YAML</title>
+ <example>
+ <title><code>language="yaml"</code></title>
+ <programlisting language="yaml"><xi:include parse="text" href="code/yaml"/></programlisting>
+ </example>
+</section>
+
+</article>
diff --git a/test/syntax/mallard.page b/test/syntax/mallard.page
new file mode 100644
index 00000000..0066207c
--- /dev/null
+++ b/test/syntax/mallard.page
@@ -0,0 +1,713 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ xmlns:e="http://projectmallard.org/experimental/"
+ xmlns:ui="http://projectmallard.org/ui/1.0/"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ id="mallard">
+<title>Syntax Highlighting</title>
+
+<section id="embedded">
+<title>Embedded Markup</title>
+<code mime="text/x-csrc">
+#include &lt;stdlib.h>
+int main(char** argv) {
+ // This is a <link href="#">link</link>
+ /* This is <var>replaceable text</var> */
+ int i = 12;
+ printf(<e:hi>"hello %s\n"</e:hi>, world);
+}
+</code>
+</section>
+
+<section id="actionscript">
+ <title>ActionScript</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-actionscript"</code></title>
+ <code mime="application/x-actionscript"><xi:include parse="text" href="code/actionscript"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="actionscript"</code></title>
+ <code type="actionscript"><xi:include parse="text" href="code/actionscript"/></code>
+ </listing>
+</section>
+
+<section id="apache">
+ <title>Apache Config</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-apacheconf"</code></title>
+ <code mime="text/x-apacheconf"><xi:include parse="text" href="code/apache"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="apache"</code></title>
+ <code type="apache"><xi:include parse="text" href="code/apache"/></code>
+ </listing>
+</section>
+
+<section id="asciidoc">
+ <title>AsciiDoc</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-asciidoc"</code></title>
+ <code mime="text/x-asciidoc"><xi:include parse="text" href="code/asciidoc"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="asciidoc"</code></title>
+ <code type="asciidoc"><xi:include parse="text" href="code/asciidoc"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="adoc"</code></title>
+ <code type="adoc"><xi:include parse="text" href="code/asciidoc"/></code>
+ </listing>
+</section>
+
+<section id="bash">
+ <title>Bash</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-shellscript"</code></title>
+ <code mime="application/x-shellscript"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="sh"</code></title>
+ <code type="sh"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="bash"</code></title>
+ <code type="bash"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="csh"</code></title>
+ <code type="csh"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+</section>
+
+<section id="c">
+ <title>C</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-chdr"</code></title>
+ <code mime="text/x-chdr"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-csrc"</code></title>
+ <code mime="text/x-csrc"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="c"</code></title>
+ <code type="c"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+</section>
+
+<section id="cs">
+ <title>C#</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-csharp"</code></title>
+ <code mime="text/x-csharp"><xi:include parse="text" href="code/cs"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cs"</code></title>
+ <code type="cs"><xi:include parse="text" href="code/cs"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="csharp"</code></title>
+ <code type="csharp"><xi:include parse="text" href="code/cs"/></code>
+ </listing>
+</section>
+
+<section id="cpp">
+ <title>C++</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-c++hdr"</code></title>
+ <code mime="text/x-c++hdr"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-c++src"</code></title>
+ <code mime="text/x-c++src"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cpp"</code></title>
+ <code type="cpp"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="c++"</code></title>
+ <code type="c++"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+</section>
+
+<section id="clojure">
+ <title>Clojure</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-clojure"</code></title>
+ <code mime="application/x-clojure"><xi:include parse="text" href="code/clojure"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="clojure"</code></title>
+ <code type="clojure"><xi:include parse="text" href="code/clojure"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="clj"</code></title>
+ <code type="clj"><xi:include parse="text" href="code/clojure"/></code>
+ </listing>
+</section>
+
+<section id="cmake">
+ <title>CMake</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-cmake"</code></title>
+ <code mime="text/x-cmake"><xi:include parse="text" href="code/cmake"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cmake"</code></title>
+ <code type="cmake"><xi:include parse="text" href="code/cmake"/></code>
+ </listing>
+</section>
+
+<section id="css">
+ <title>CSS</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/css"</code></title>
+ <code mime="text/css"><xi:include parse="text" href="code/css"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="css"</code></title>
+ <code type="css"><xi:include parse="text" href="code/css"/></code>
+ </listing>
+</section>
+
+<section id="d">
+ <title>D</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-d"</code></title>
+ <code mime="text/x-d"><xi:include parse="text" href="code/d"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="d"</code></title>
+ <code type="d"><xi:include parse="text" href="code/d"/></code>
+ </listing>
+</section>
+
+<section id="diff">
+ <title>Diff</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-diff"</code></title>
+ <code mime="text/x-diff"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-patch"</code></title>
+ <code mime="text/x-patch"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="diff"</code></title>
+ <code type="diff"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="patch"</code></title>
+ <code type="patch"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+</section>
+
+<section id="django">
+ <title>Django</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-django-templating"</code></title>
+ <code mime="application/x-django-templating"><xi:include parse="text" href="code/django"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="django"</code></title>
+ <code type="django"><xi:include parse="text" href="code/django"/></code>
+ </listing>
+</section>
+
+<section id="dockerfile">
+ <title>Dockerfile</title>
+ <listing ui:expanded="false">
+ <title><code>type="dockerfile"</code></title>
+ <code type="dockerfile"><xi:include parse="text" href="code/dockerfile"/></code>
+ </listing>
+</section>
+
+<section id="dos">
+ <title>DOS Batch</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-dos-batch"</code></title>
+ <code mime="application/x-dos-batch"><xi:include parse="text" href="code/dos"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="dos"</code></title>
+ <code type="dos"><xi:include parse="text" href="code/dos"/></code>
+ </listing>
+</section>
+
+<section id="erb">
+ <title>Embedded Ruby</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-ruby-templating"</code></title>
+ <code mime="application/x-ruby-templating"><xi:include parse="text" href="code/erb"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="erb"</code></title>
+ <code type="erb"><xi:include parse="text" href="code/erb"/></code>
+ </listing>
+</section>
+
+<section id="fsharp">
+ <title>F#</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-fsharp"</code></title>
+ <code mime="text/x-fsharp"><xi:include parse="text" href="code/fsharp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="fsharp"</code></title>
+ <code type="fsharp"><xi:include parse="text" href="code/fsharp"/></code>
+ </listing>
+</section>
+
+<section id="go">
+ <title>Go</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-go"</code></title>
+ <code mime="text/x-go"><xi:include parse="text" href="code/go"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="go"</code></title>
+ <code type="go"><xi:include parse="text" href="code/go"/></code>
+ </listing>
+</section>
+
+<section id="haml">
+ <title>Haml</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-haml"</code></title>
+ <code mime="text/x-haml"><xi:include parse="text" href="code/haml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="haml"</code></title>
+ <code type="haml"><xi:include parse="text" href="code/haml"/></code>
+ </listing>
+</section>
+
+<section id="haskell">
+ <title>Haskell</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-haskell"</code></title>
+ <code mime="text/x-haskell"><xi:include parse="text" href="code/haskell"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="haskell"</code></title>
+ <code type="haskell"><xi:include parse="text" href="code/haskell"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="hs"</code></title>
+ <code type="hs"><xi:include parse="text" href="code/haskell"/></code>
+ </listing>
+</section>
+
+<section id="html">
+ <title>HTML</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/html"</code></title>
+ <code mime="text/html"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="html"</code></title>
+ <code type="html"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xhtml"</code></title>
+ <code type="xhtml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+</section>
+
+<section id="http">
+ <title>HTTP</title>
+ <listing ui:expanded="false">
+ <title><code>type="http"</code></title>
+ <code type="http"><xi:include parse="text" href="code/http"/></code>
+ </listing>
+</section>
+
+<section id="ini">
+ <title>INI</title>
+ <listing ui:expanded="false">
+ <title><code>type="ini"</code></title>
+ <code type="ini"><xi:include parse="text" href="code/ini"/></code>
+ </listing>
+</section>
+
+<section id="java">
+ <title>Java</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-java"</code></title>
+ <code mime="text/x-java"><xi:include parse="text" href="code/java"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="java"</code></title>
+ <code type="java"><xi:include parse="text" href="code/java"/></code>
+ </listing>
+</section>
+
+<section id="json">
+ <title>JSON</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/json"</code></title>
+ <code mime="application/json"><xi:include parse="text" href="code/json"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="json"</code></title>
+ <code type="json"><xi:include parse="text" href="code/json"/></code>
+ </listing>
+</section>
+
+<section id="javascript">
+ <title>JavaScript</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/javascript"</code></title>
+ <code mime="application/javascript"><xi:include parse="text" href="code/javascript"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="javascript"</code></title>
+ <code type="javascript"><xi:include parse="text" href="code/javascript"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="js"</code></title>
+ <code type="js"><xi:include parse="text" href="code/javascript"/></code>
+ </listing>
+</section>
+
+<section id="LISP">
+ <title>LISP</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-lisp"</code></title>
+ <code mime="application/x-lisp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-emacs-lisp"</code></title>
+ <code mime="text/x-emacs-lisp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="lisp"</code></title>
+ <code type="lisp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cl"</code></title>
+ <code type="cl"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="el"</code></title>
+ <code type="el"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="lsp"</code></title>
+ <code type="lsp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+</section>
+
+<section id="lua">
+ <title>Lua</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-lua"</code></title>
+ <code mime="text/x-lua"><xi:include parse="text" href="code/lua"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="lua"</code></title>
+ <code type="lua"><xi:include parse="text" href="code/lua"/></code>
+ </listing>
+</section>
+
+<section id="makefile">
+ <title>Makefile</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-makefile"</code></title>
+ <code mime="text/x-makefile"><xi:include parse="text" href="code/makefile"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="makefile"</code></title>
+ <code type="makefile"><xi:include parse="text" href="code/makefile"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="make"</code></title>
+ <code type="make"><xi:include parse="text" href="code/makefile"/></code>
+ </listing>
+</section>
+
+<section id="markdown">
+ <title>Markdown</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-markdown"</code></title>
+ <code mime="text/x-markdown"><xi:include parse="text" href="code/markdown"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="markdown"</code></title>
+ <code type="markdown"><xi:include parse="text" href="code/markdown"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="md"</code></title>
+ <code type="md"><xi:include parse="text" href="code/markdown"/></code>
+ </listing>
+</section>
+
+<section id="matlab">
+ <title>MATLAB/Octave</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-matlab"</code></title>
+ <code mime="text/x-matlab"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-octave"</code></title>
+ <code mime="text/x-octave"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="matlab"</code></title>
+ <code type="matlab"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="octave"</code></title>
+ <code type="octave"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+</section>
+
+<section id="nginx">
+ <title>Nginx Config</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-nginx-conf"</code></title>
+ <code mime="text/x-nginx-conf"><xi:include parse="text" href="code/nginx"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="nginx"</code></title>
+ <code type="nginx"><xi:include parse="text" href="code/nginx"/></code>
+ </listing>
+</section>
+
+<section id="objectivec">
+ <title>Objective-C</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-objcsrc"</code></title>
+ <code mime="text/x-objcsrc"><xi:include parse="text" href="code/objectivec"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="objc"</code></title>
+ <code type="objc"><xi:include parse="text" href="code/objectivec"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="m"</code></title>
+ <code type="m"><xi:include parse="text" href="code/objectivec"/></code>
+ </listing>
+</section>
+
+<section id="perl">
+ <title>Perl</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-perl"</code></title>
+ <code mime="application/x-perl"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="perl"</code></title>
+ <code type="perl"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="pl"</code></title>
+ <code type="pl"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="pm"</code></title>
+ <code type="pm"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+</section>
+
+<section id="php">
+ <title>PHP</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-php"</code></title>
+ <code mime="application/x-php"><xi:include parse="text" href="code/php"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="php"</code></title>
+ <code type="php"><xi:include parse="text" href="code/php"/></code>
+ </listing>
+</section>
+
+<section id="python">
+ <title>Python</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-python"</code></title>
+ <code mime="text/x-python"><xi:include parse="text" href="code/python"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="python"</code></title>
+ <code type="python"><xi:include parse="text" href="code/python"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="py"</code></title>
+ <code type="py"><xi:include parse="text" href="code/python"/></code>
+ </listing>
+</section>
+
+<section id="r">
+ <title>R/S</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-r"</code></title>
+ <code mime="text/x-r"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-s"</code></title>
+ <code mime="text/x-s"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="r"</code></title>
+ <code type="r"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="s"</code></title>
+ <code type="s"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+</section>
+
+<section id="ruby">
+ <title>Ruby</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-ruby"</code></title>
+ <code mime="application/x-ruby"><xi:include parse="text" href="code/ruby"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="ruby"</code></title>
+ <code type="ruby"><xi:include parse="text" href="code/ruby"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="rb"</code></title>
+ <code type="rb"><xi:include parse="text" href="code/ruby"/></code>
+ </listing>
+</section>
+
+<section id="rust">
+ <title>Rust</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-rust"</code></title>
+ <code mime="text/x-rust"><xi:include parse="text" href="code/rust"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="rust"</code></title>
+ <code type="rust"><xi:include parse="text" href="code/rust"/></code>
+ </listing>
+</section>
+
+<section id="scala">
+ <title>Scala</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-scala"</code></title>
+ <code mime="text/x-scala"><xi:include parse="text" href="code/scala"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="scala"</code></title>
+ <code type="scala"><xi:include parse="text" href="code/scala"/></code>
+ </listing>
+</section>
+
+<section id="scheme">
+ <title>Scheme</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-scheme"</code></title>
+ <code mime="text/x-scheme"><xi:include parse="text" href="code/scheme"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="scheme"</code></title>
+ <code type="scheme"><xi:include parse="text" href="code/scheme"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="scm"</code></title>
+ <code type="scm"><xi:include parse="text" href="code/scheme"/></code>
+ </listing>
+</section>
+
+<section id="smalltalk">
+ <title>Smalltalk</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-smalltalk"</code></title>
+ <code mime="text/x-smalltalk"><xi:include parse="text" href="code/smalltalk"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="smalltalk"</code></title>
+ <code type="smalltalk"><xi:include parse="text" href="code/smalltalk"/></code>
+ </listing>
+</section>
+
+<section id="tcl">
+ <title>TCL</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-tcl"</code></title>
+ <code mime="application/x-tcl"><xi:include parse="text" href="code/tcl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="tcl"</code></title>
+ <code type="tcl"><xi:include parse="text" href="code/tcl"/></code>
+ </listing>
+</section>
+
+<section id="tex">
+ <title>TeX</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-tex"</code></title>
+ <code mime="text/x-tex"><xi:include parse="text" href="code/tex"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="tex"</code></title>
+ <code type="tex"><xi:include parse="text" href="code/tex"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="latex"</code></title>
+ <code type="latex"><xi:include parse="text" href="code/tex"/></code>
+ </listing>
+</section>
+
+<section id="vala">
+ <title>Vala</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-vala"</code></title>
+ <code mime="text/x-vala"><xi:include parse="text" href="code/vala"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="vala"</code></title>
+ <code type="vala"><xi:include parse="text" href="code/vala"/></code>
+ </listing>
+</section>
+
+<section id="xml">
+ <title>XML</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/xml"</code></title>
+ <code mime="application/xml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="application/docbook+xml"</code></title>
+ <code mime="application/docbook+xml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xml"</code></title>
+ <code type="xml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+</section>
+
+<section id="xquery">
+ <title>XQuery</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/xquery"</code></title>
+ <code mime="application/xquery"><xi:include parse="text" href="code/xquery"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xquery"</code></title>
+ <code type="xquery"><xi:include parse="text" href="code/xquery"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xq"</code></title>
+ <code type="xq"><xi:include parse="text" href="code/xquery"/></code>
+ </listing>
+</section>
+
+<section id="yaml">
+ <title>YAML</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-yaml"</code></title>
+ <code mime="application/x-yaml"><xi:include parse="text" href="code/yaml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="yaml"</code></title>
+ <code type="yaml"><xi:include parse="text" href="code/yaml"/></code>
+ </listing>
+</section>
+
+</page>