diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js
index 9fdf6a64..3abdf664 100644
--- a/demo/kitchen-sink/doclist.js
+++ b/demo/kitchen-sink/doclist.js
@@ -66,95 +66,19 @@ function makeHuge(txt) {
}
var docs = {
- "docs/javascript.js": "JavaScript",
- "docs/AsciiDoc.asciidoc": "AsciiDoc",
- "docs/clojure.clj": "Clojure",
- "docs/coffeescript.coffee": "CoffeeScript",
- "docs/coldfusion.cfm": "ColdFusion",
- "docs/cpp.cpp": "C/C++",
- "docs/csharp.cs": "C#",
- "docs/css.css": "CSS",
- "docs/curly.curly": "Curly",
- "docs/dart.dart": "Dart",
- "docs/diff.diff": "Diff",
- "docs/dot.dot": "Dot",
- "docs/freemarker.ftl" : "FreeMarker",
- "docs/glsl.glsl": "Glsl",
- "docs/golang.go": "Go",
- "docs/groovy.groovy": "Groovy",
- "docs/haml.haml": "Haml",
- "docs/Haxe.hx": "haXe",
- "docs/html.html": "HTML",
- "docs/html_ruby.erb": "HTML (Ruby)",
- "docs/jade.jade": "Jade",
- "docs/java.java": "Java",
- "docs/jsp.jsp": "JSP",
- "docs/json.json": "JSON",
- "docs/jsx.jsx": "JSX",
+ "docs/javascript.js": {order: 1, name: "JavaScript"},
+
"docs/latex.tex": {name: "LaTeX", wrapped: true},
- "docs/less.less": "LESS",
- "docs/lisp.lisp": "Lisp",
- "docs/lsl.lsl": "LSL",
- "docs/scheme.scm": "Scheme",
- "docs/livescript.ls": "LiveScript",
- "docs/liquid.liquid": "Liquid",
- "docs/logiql.logic": "LogiQL",
- "docs/lua.lua": "Lua",
- "docs/lucene.lucene": "Lucene",
- "docs/luapage.lp": "LuaPage",
- "docs/Makefile": "Makefile",
"docs/markdown.md": {name: "Markdown", wrapped: true},
"docs/mushcode.mc": {name: "MUSHCode", wrapped: true},
- "docs/objectivec.m": {name: "Objective-C"},
- "docs/ocaml.ml": "OCaml",
- "docs/OpenSCAD.scad": "OpenSCAD",
- "docs/pascal.pas": "Pascal",
- "docs/perl.pl": "Perl",
"docs/pgsql.pgsql": {name: "pgSQL", wrapped: true},
- "docs/php.php": "PHP",
"docs/plaintext.txt": {name: "Plain Text", prepare: makeHuge, wrapped: true},
- "docs/powershell.ps1": "Powershell",
- "docs/properties.properties": "Properties",
- "docs/python.py": "Python",
- "docs/r.r": "R",
- "docs/rdoc.Rd": "RDoc",
- "docs/rhtml.rhtml": "RHTML",
- "docs/ruby.rb": "Ruby",
- "docs/abap.abap": "SAP - ABAP",
- "docs/scala.scala": "Scala",
- "docs/scss.scss": "SCSS",
- "docs/sass.sass": "SASS",
- "docs/sh.sh": "SH",
- "docs/space.space": "Space",
- "docs/stylus.styl": "Stylus",
"docs/sql.sql": {name: "SQL", wrapped: true},
- "docs/svg.svg": "SVG",
- "docs/tcl.tcl": "Tcl",
- "docs/tex.tex": "Tex",
- "docs/textile.textile": {name: "Textile", wrapped: true},
- "docs/snippets.snippets": "snippets",
- "docs/toml.toml": "TOML",
- "docs/typescript.ts": "Typescript",
- "docs/vbscript.vbs": "VBScript",
- "docs/velocity.vm": "Velocity",
- "docs/xml.xml": "XML",
- "docs/xquery.xq": "XQuery",
- "docs/yaml.yaml": "YAML",
- "docs/c9search.c9search_results": "C9 Search Results",
- "docs/actionscript.as": "ActionScript",
- "docs/assembly_x86.asm": "Assembly_x86",
- "docs/autohotkey.ahk": "AutoHotKey",
- "docs/batchfile.bat": "BatchFile",
- "docs/erlang.erl": "Erlang",
- "docs/forth.frt": "Forth",
- "docs/haskell.hs": "Haskell",
- "docs/julia.js": "Julia",
- "docs/prolog.plg": "Prolog",
- "docs/rust.rs": "Rust",
- "docs/twig.twig": "Twig",
- "docs/Nix.nix": "Nix",
- "docs/protobuf.proto": "Protobuf"
+ "docs/textile.textile": {name: "Textile", wrapped: true},
+
+ "docs/c9search.c9search_results": "C9 Search Results",
+ "docs/Nix.nix": "Nix"
};
var ownSource = {
@@ -166,6 +90,23 @@ var hugeDocs = {
"build/src-min/ace.js": ""
};
+modelist.modes.forEach(function(m) {
+ var ext = m.extensions.split("|")[0];
+ if (ext[0] === "^") {
+ path = ext.substr(1);
+ } else {
+ var path = m.name + "." + ext
+ }
+ path = "docs/" + path;
+ if (!docs[path]) {
+ docs[path] = {name: m.caption};
+ } else if (typeof docs[path] == "object" && !docs[path].name) {
+ docs[path].name = m.caption;
+ }
+})
+
+
+
if (window.require && window.require.s) try {
for (var path in window.require.s.contexts._.defined) {
if (path.indexOf("!") != -1)
@@ -176,6 +117,13 @@ if (window.require && window.require.s) try {
}
} catch(e) {}
+function sort(list) {
+ return list.sort(function(a, b) {
+ var cmp = (b.order || 0) - (a.order || 0);
+ return cmp || a.name && a.name.localeCompare(b.name);
+ })
+}
+
function prepareDocList(docs) {
var list = [];
for (var path in docs) {
@@ -219,7 +167,7 @@ function loadDoc(name, callback) {
module.exports = {
fileCache: fileCache,
- docs: prepareDocList(docs),
+ docs: sort(prepareDocList(docs)),
ownSource: prepareDocList(ownSource),
hugeDocs: prepareDocList(hugeDocs),
initDoc: initDoc,
diff --git a/demo/kitchen-sink/docs/ada.ada b/demo/kitchen-sink/docs/ada.ada
new file mode 100644
index 00000000..90e027f0
--- /dev/null
+++ b/demo/kitchen-sink/docs/ada.ada
@@ -0,0 +1,5 @@
+with Ada.Text_IO; use Ada.Text_IO;
+procedure Hello is
+begin
+ Put_Line("Hello, world!");
+end Hello;
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/cpp.cpp b/demo/kitchen-sink/docs/c_cpp.cpp
similarity index 100%
rename from demo/kitchen-sink/docs/cpp.cpp
rename to demo/kitchen-sink/docs/c_cpp.cpp
diff --git a/demo/kitchen-sink/docs/cobol.CBL b/demo/kitchen-sink/docs/cobol.CBL
new file mode 100644
index 00000000..30404ce4
--- /dev/null
+++ b/demo/kitchen-sink/docs/cobol.CBL
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/coffeescript.coffee b/demo/kitchen-sink/docs/coffee.coffee
similarity index 100%
rename from demo/kitchen-sink/docs/coffeescript.coffee
rename to demo/kitchen-sink/docs/coffee.coffee
diff --git a/demo/kitchen-sink/docs/d.d b/demo/kitchen-sink/docs/d.d
new file mode 100644
index 00000000..57069067
--- /dev/null
+++ b/demo/kitchen-sink/docs/d.d
@@ -0,0 +1,14 @@
+#!/usr/bin/env rdmd
+// Computes average line length for standard input.
+import std.stdio;
+
+void main() {
+ ulong lines = 0;
+ double sumLength = 0;
+ foreach (line; stdin.byLine()) {
+ ++lines;
+ sumLength += line.length;
+ }
+ writeln("Average line length: ",
+ lines ? sumLength / lines : 0);
+}
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/ejs.ejs b/demo/kitchen-sink/docs/ejs.ejs
new file mode 100644
index 00000000..30404ce4
--- /dev/null
+++ b/demo/kitchen-sink/docs/ejs.ejs
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/freemarker.ftl b/demo/kitchen-sink/docs/ftl.ftl
similarity index 100%
rename from demo/kitchen-sink/docs/freemarker.ftl
rename to demo/kitchen-sink/docs/ftl.ftl
diff --git a/demo/kitchen-sink/docs/html.htm b/demo/kitchen-sink/docs/html.htm
new file mode 100644
index 00000000..30404ce4
--- /dev/null
+++ b/demo/kitchen-sink/docs/html.htm
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/ini.ini b/demo/kitchen-sink/docs/ini.ini
new file mode 100644
index 00000000..30404ce4
--- /dev/null
+++ b/demo/kitchen-sink/docs/ini.ini
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/jsoniq.jq b/demo/kitchen-sink/docs/jsoniq.jq
new file mode 100644
index 00000000..30404ce4
--- /dev/null
+++ b/demo/kitchen-sink/docs/jsoniq.jq
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/matlab.matlab b/demo/kitchen-sink/docs/matlab.matlab
new file mode 100644
index 00000000..30404ce4
--- /dev/null
+++ b/demo/kitchen-sink/docs/matlab.matlab
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/mysql.mysql b/demo/kitchen-sink/docs/mysql.mysql
new file mode 100644
index 00000000..30404ce4
--- /dev/null
+++ b/demo/kitchen-sink/docs/mysql.mysql
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/OpenSCAD.scad b/demo/kitchen-sink/docs/scad.scad
similarity index 100%
rename from demo/kitchen-sink/docs/OpenSCAD.scad
rename to demo/kitchen-sink/docs/scad.scad
diff --git a/demo/kitchen-sink/docs/soy_template.soy b/demo/kitchen-sink/docs/soy_template.soy
new file mode 100644
index 00000000..3a9e3436
--- /dev/null
+++ b/demo/kitchen-sink/docs/soy_template.soy
@@ -0,0 +1,46 @@
+/**
+ * Greets a person using "Hello" by default.
+ * @param name The name of the person.
+ * @param? greetingWord Optional greeting word to use instead of "Hello".
+ */
+{template .helloName #eee}
+ {if not $greetingWord}
+ Hello {$name}!
+ {else}
+ {$greetingWord} {$name}!
+ {/if}
+{/template}
+
+/**
+ * Greets a person and optionally a list of other people.
+ * @param name The name of the person.
+ * @param additionalNames The additional names to greet. May be an empty list.
+ */
+{template .helloNames}
+ // Greet the person.
+ {call .helloName data="all" /}
+ // Greet the additional people.
+ {foreach $additionalName in $additionalNames}
+ {call .helloName}
+ {param name: $additionalName /}
+ {/call}
+ {if not isLast($additionalName)}
+
// break after every line except the last
+ {/if}
+ {ifempty}
+ No additional people to greet.
+ {/foreach}
+{/template}
+
+
+{/foreach}
+{if length($items) > 5}
+{msg desc="Says hello to the user."}
+
+
+{namespace ns autoescape="contextual"}
+
+/** Example. */
+{template .example}
+ foo is {$ij.foo}
+{/template}
\ No newline at end of file
diff --git a/index.html b/index.html
index 4427356d..75504169 100644
--- a/index.html
+++ b/index.html
@@ -963,7 +963,7 @@ if (match) {
Divshot
Codio