summaryrefslogtreecommitdiffhomepage
path: root/build
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-09-11 00:50:19 +0000
committerSteven Barth <steven@midlink.org>2008-09-11 00:50:19 +0000
commitc8ef012b3a73fbf548379b386ead43779b744562 (patch)
tree450f33b50c53e91283489826c43ef5350c9c1fba /build
parentef8f835894953259e17a2f59b00e7e8173598a06 (diff)
Completed first part of UVLDoc
Diffstat (limited to 'build')
-rw-r--r--build/config.mk3
-rwxr-xr-xbuild/uvldoc24
2 files changed, 27 insertions, 0 deletions
diff --git a/build/config.mk b/build/config.mk
index 6f54ce591..bac250d72 100644
--- a/build/config.mk
+++ b/build/config.mk
@@ -8,6 +8,9 @@ LUA_LIBRARYDIR = /usr/lib/lua
LUCI_MODULEDIR = $(LUA_MODULEDIR)/luci
LUCI_LIBRARYDIR = $(LUA_LIBRARYDIR)/luci
+UVL_SCHEMEDIR = host/lib/uci/schema
+
HTDOCS = /www
+LUA=$(shell which lua)
XSLTPROC=$(shell which xsltproc)
diff --git a/build/uvldoc b/build/uvldoc
new file mode 100755
index 000000000..a6e9cc8e6
--- /dev/null
+++ b/build/uvldoc
@@ -0,0 +1,24 @@
+#!/usr/bin/env lua
+local fs = require "luci.fs"
+local util = require "luci.util"
+local uvldoc = require "luci.uvldoc.renderer"
+
+pcall(function()
+ require "uci"
+ require "luci.model.uci".cursor = function(config, save)
+ return uci.cursor(config or arg[1] .. "/etc/config", save or arg[1] .. "/tmp/.uci")
+ end
+end)
+
+local schemes = {}
+if not arg[4] or #arg[4] == 0 then
+ for i, name in ipairs(fs.dir(arg[2].."/default/")) do
+ if name ~= "." and name ~= ".." then
+ schemes[#schemes+1] = name
+ end
+ end
+else
+ schemes = util.split(arg[4], "[,;%s]+", nil, true)
+end
+
+uvldoc.Generator(schemes, arg[3], arg[2]):make()