mirror of
https://github.com/lxsang/antd-web-apps
synced 2024-11-20 10:18:21 +01:00
24 lines
620 B
Lua
24 lines
620 B
Lua
BaseController:subclass("IndexController")
|
|
|
|
function IndexController:index(...)
|
|
-- TODO: add description to router
|
|
local file = io.open(DOC_COVER, "r")
|
|
if file then
|
|
local content = ""
|
|
local md = require("md")
|
|
local callback = function(s) content = content .. s end
|
|
md.to_html(file:read("*a"), callback)
|
|
file.close()
|
|
self.template:set("data", content)
|
|
end
|
|
return true
|
|
end
|
|
|
|
function IndexController:actionnotfound(...)
|
|
self.template:setView("book")
|
|
return self:book(table.unpack({...}))
|
|
end
|
|
|
|
function IndexController:book(...)
|
|
return true
|
|
end |