1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-12-26 01:18:21 +01:00

update antdoc

This commit is contained in:
lxsang 2020-06-24 19:19:20 +02:00
parent c36ca7b8fb
commit 1af8436523
4 changed files with 37 additions and 5 deletions

View File

@ -37,14 +37,14 @@ html,body{
}
#navbar{
margin:0 auto;
max-width: 85%;
max-width: 80%;
display: flex;
justify-content:flex-end;
flex-direction: row;
}
#book{
margin:0 auto;
max-width: 85%;
max-width: 80%;
max-height: 100%;
display: block;
justify-content:flex-end;
@ -53,7 +53,6 @@ html,body{
height: 100%;
}
div.doc-name {
width: 300px;
text-align: left;
padding-top:3px;
}
@ -62,7 +61,21 @@ div.doc-name a {
color: #c9c9c9;
}
div.doc-name a:before{
a.x-link, a.x-link:hover {
text-decoration: none;
color: #c9c9c9;
padding-left: 15px;
padding-top: 7px;
}
a.x-link::before{
content: "\f08e";
color:#c9c9c9;
width:20px;
height: 25px;
font-family: "FontAwesome";
font-size: 15px;
}
div.doc-name a::before{
/* padding-top:13px; */
content: "\f015";
color:#c9c9c9;
@ -77,6 +90,7 @@ input.search-box{
flex:1;
padding:0;
margin:0;
margin-left: 10px;
/* padding-top:13px; */
height: 25px;
background-color: transparent;

View File

@ -4,5 +4,8 @@ DocController:subclass("AntosController", {
vfs_path = "home://testws/antos",
local_path = "/home/mrsang/testws/antos"
},
name = "antos"
name = "antos",
elinks = {
{ name = "API", url = "https://doc.iohub.dev/antos/api/" }
}
})

View File

@ -86,6 +86,8 @@ function DocController:index(...)
local toc = self:loadTOC()
toc.controller = self.name
self.template:set("toc", toc)
self.template:set("elinks", self.elinks)
-- read data from the parameter
local path = nil
if args[1] then
@ -153,6 +155,7 @@ function DocController:search(...)
self.template:set("data", result)
self.template:set("controller", self.name)
self.template:set("map", self.path_map)
self.template:set("elinks", self.elinks)
else
return self:actionnotfound(table.unpack(args))
end

View File

@ -1,5 +1,6 @@
<?lua
local tocdata = __main__:get("toc")
local elinks = __main__:get("elinks")
?>
<!DOCTYPE html>
<html>
@ -60,6 +61,17 @@ local tocdata = __main__:get("toc")
</a>
<?lua end ?>
</div>
<?lua
if elinks then
for k,v in ipairs(elinks) do
?>
<a class = "x-link" href ="<?=v.url?>">
<?=v.name?>
</a>
<?lua
end
end
?>
<form id = "search_form" action="<?=HTTP_ROOT..'/'..tocdata.controller..'/search/'?>" method="get" class="search-form">
<input id = "search_box" name="q" type = "text" class = "search-box"></input>
</form>