diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js
index e73c796b..8660d7d5 100644
--- a/demo/kitchen-sink/demo.js
+++ b/demo/kitchen-sink/demo.js
@@ -109,6 +109,8 @@ var modesByName = {
less: ["LESS" , "less"],
liquid: ["Liquid" , "liquid"],
lua: ["Lua" , "lua"],
+ luapage: ["LuaPage" , "lp"],
+ // LuaPage implements the LuaPage markup as described by the Kepler Project's CGILua documentation: http://keplerproject.github.com/cgilua/manual.html#templates
markdown: ["Markdown" , "md|markdown"],
ocaml: ["OCaml" , "ml|mli"],
perl: ["Perl" , "pl|pm"],
@@ -186,6 +188,7 @@ var docs = {
"docs/ocaml.ml": "OCaml",
"docs/OpenSCAD.scad": "OpenSCAD",
"docs/lua.lua": "Lua",
+ "docs/luapage.lp": "LuaPage", // index.lp from the Kepler Project's LuaDoc HTML doclet. http://keplerproject.github.com/luadoc/
"docs/liquid.liquid": "Liquid",
"docs/java.java": "Java",
"docs/clojure.clj": "Clojure",
diff --git a/demo/kitchen-sink/docs/luapage.lp b/demo/kitchen-sink/docs/luapage.lp
new file mode 100644
index 00000000..27514494
--- /dev/null
+++ b/demo/kitchen-sink/docs/luapage.lp
@@ -0,0 +1,67 @@
+
+
+
+ Reference
+ " type="text/css" />
+
+
+
+
+
+
+
+
+
+
+
+<%=luadoc.doclet.html.include("menu.lp", { doc=doc })%>
+
+
+
+
+
+
+<%if not options.nomodules and #doc.modules > 0 then%>
+
Modules
+
+
+<%for _, modulename in ipairs(doc.modules) do%>
+
+ | <%=modulename%> |
+ <%=doc.modules[modulename].summary%> |
+
+<%end%>
+
+<%end%>
+
+
+
+<%if not options.nofiles and #doc.files > 0 then%>
+
Files
+
+
+<%for _, filepath in ipairs(doc.files) do%>
+
+ | <%=filepath%> |
+ |
+
+<%end%>
+
+<%end%>
+
+
+
+
+
+
+

+
+
+
+
+
diff --git a/lib/ace/mode/luapage.js b/lib/ace/mode/luapage.js
new file mode 100644
index 00000000..03ee19d1
--- /dev/null
+++ b/lib/ace/mode/luapage.js
@@ -0,0 +1,22 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var HtmlMode = require("./html").Mode;
+var LuaMode = require("./lua").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules;
+
+var Mode = function() {
+ var highlighter = new LuaPageHighlightRules();
+
+ this.$tokenizer = new Tokenizer(new LuaPageHighlightRules().getRules());
+ this.$embeds = highlighter.getEmbeds();
+ this.createModeDelegates({
+ "lua-": LuaMode
+ });
+};
+oop.inherits(Mode, HtmlMode);
+
+exports.Mode = Mode;
+});
\ No newline at end of file
diff --git a/lib/ace/mode/luapage_highlight_rules.js b/lib/ace/mode/luapage_highlight_rules.js
new file mode 100644
index 00000000..8a2dedba
--- /dev/null
+++ b/lib/ace/mode/luapage_highlight_rules.js
@@ -0,0 +1,40 @@
+define(function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
+
+var LuaPageHighlightRules = function() {
+ this.$rules = new HtmlHighlightRules().getRules();
+
+ for (var i in this.$rules){ // Thanks to Harutyun Amirjanyan for this fix.
+ this.$rules[i].unshift({
+ token: "keyword",
+ regex: "<\\%\\=?",
+ next: "lua-start"
+ }, {
+ token: "keyword",
+ regex: "<\\?lua\\=?",
+ next: "lua-start"
+ });
+ }
+ this.embedRules(LuaHighlightRules, "lua-", [
+ {
+ token: "keyword",
+ regex: "\\%>",
+ next: "start"
+ },
+ {
+ token: "keyword",
+ regex: "\\?>",
+ next: "start"
+ }
+ ]);
+};
+
+oop.inherits(LuaPageHighlightRules, HtmlHighlightRules);
+
+exports.LuaPageHighlightRules = LuaPageHighlightRules;
+
+});
\ No newline at end of file