1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-02-01 17:32:46 +01:00
antd-web-apps/doc/controllers/IndexController.lua

23 lines
581 B
Lua
Raw Normal View History

2020-06-22 22:14:52 +02:00
BaseController:subclass("IndexController")
function IndexController:index(...)
local file = io.open(DOC_COVER, "r")
2020-12-22 12:57:23 +00:00
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()
2020-12-22 12:57:23 +00:00
self.template:set("data", content)
end
2020-06-22 22:14:52 +02:00
return true
end
function IndexController:actionnotfound(...)
2020-12-22 12:57:23 +00:00
self.template:setView("book")
return self:book(table.unpack({...}))
end
function IndexController:book(...)
return true
2020-06-22 22:14:52 +02:00
end