diff --git a/dist/antd_web_apps.tar.gz b/dist/antd_web_apps.tar.gz index 441b47c..96e2ef6 100644 Binary files a/dist/antd_web_apps.tar.gz and b/dist/antd_web_apps.tar.gz differ diff --git a/doc/controllers/IndexController.lua b/doc/controllers/IndexController.lua index fe94f52..07768b6 100644 --- a/doc/controllers/IndexController.lua +++ b/doc/controllers/IndexController.lua @@ -1,10 +1,23 @@ BaseController:subclass("IndexController") function IndexController:index(...) + local file = io.open("/home/mrsang/doc/library.md", "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("index") - return self:index(table.unpack({...})) + self.template:setView("book") + return self:book(table.unpack({...})) +end + +function IndexController:book(...) + return true end \ No newline at end of file diff --git a/doc/controllers/doccontroller.lua b/doc/controllers/doccontroller.lua index 8089384..7783102 100644 --- a/doc/controllers/doccontroller.lua +++ b/doc/controllers/doccontroller.lua @@ -171,7 +171,7 @@ function DocController:index(...) content, has_3d = post_process_md(content, self) -- replace some display plugins - self.template:setView("index", "index") + self.template:setView("book", "index") self.template:set("data", content) self.template:set("has_3d", has_3d) else diff --git a/doc/views/default/index/book.ls b/doc/views/default/index/book.ls new file mode 100644 index 0000000..f335b18 --- /dev/null +++ b/doc/views/default/index/book.ls @@ -0,0 +1,121 @@ + + 0 then return toc.entries[1] end + if toc.parent and toc.parent.entries and #toc.parent.entries > 0 then + local entries = toc.parent.entries + if toc.id == #entries then + local p = toc.parent + while p and p.parent and p.parent.entries and #p.parent.entries > 0 do + entries = p.parent.entries + if p.id ~= #entries then + return entries[p.id + 1] + end + p = p.parent + end + return nil + else + return entries[toc.id + 1] + end + else + return nil + end + else + if toc.entries then + for i,v in pairs(toc.entries) do + local ret = get_next(v, cpath) + if ret then return ret end + end + return nil + else + return nil + end + end + end + + local get_prev + get_prev = function(toc, cpath) + if toc.path == cpath then + if toc.id == 1 then + return toc.parent + end + if toc.parent and toc.parent.entries and #toc.parent.entries > 0 then + local entries = toc.parent.entries + local c = entries[toc.id - 1] + while c and c.entries and #c.entries > 0 do + if c.entries then + c = c.entries[#c.entries] + end + end + return c + else + return nil + end + else + if toc.entries then + for i,v in pairs(toc.entries) do + local ret = get_prev(v, cpath) + if ret then return ret end + end + return nil + else + return nil + end + end + end + local prev_entry = nil + local next_entry = nil + if toc then + prev_entry = get_prev(toc.data, toc.cpath) + next_entry = get_next(toc.data, toc.cpath) + end +?> + +
+ +
+ +
+

Comments

+
+The comment editor supports Markdown syntax. Your email is necessary to notify you of further updates on the discussion. It will be hidden from the public. +
+
+
+ + \ No newline at end of file diff --git a/doc/views/default/index/index.ls b/doc/views/default/index/index.ls index f335b18..13f9b82 100644 --- a/doc/views/default/index/index.ls +++ b/doc/views/default/index/index.ls @@ -1,121 +1,7 @@ - 0 then return toc.entries[1] end - if toc.parent and toc.parent.entries and #toc.parent.entries > 0 then - local entries = toc.parent.entries - if toc.id == #entries then - local p = toc.parent - while p and p.parent and p.parent.entries and #p.parent.entries > 0 do - entries = p.parent.entries - if p.id ~= #entries then - return entries[p.id + 1] - end - p = p.parent - end - return nil - else - return entries[toc.id + 1] - end - else - return nil - end - else - if toc.entries then - for i,v in pairs(toc.entries) do - local ret = get_next(v, cpath) - if ret then return ret end - end - return nil - else - return nil - end - end - end - - local get_prev - get_prev = function(toc, cpath) - if toc.path == cpath then - if toc.id == 1 then - return toc.parent - end - if toc.parent and toc.parent.entries and #toc.parent.entries > 0 then - local entries = toc.parent.entries - local c = entries[toc.id - 1] - while c and c.entries and #c.entries > 0 do - if c.entries then - c = c.entries[#c.entries] - end - end - return c - else - return nil - end - else - if toc.entries then - for i,v in pairs(toc.entries) do - local ret = get_prev(v, cpath) - if ret then return ret end - end - return nil - else - return nil - end - end - end - local prev_entry = nil - local next_entry = nil - if toc then - prev_entry = get_prev(toc.data, toc.cpath) - next_entry = get_next(toc.data, toc.cpath) - end -?> - -
- -
- -
-

Comments

-
-The comment editor supports Markdown syntax. Your email is necessary to notify you of further updates on the discussion. It will be hidden from the public. -
-
-
- - \ No newline at end of file +?> \ No newline at end of file diff --git a/doc/views/default/index/notfound.ls b/doc/views/default/index/notfound.ls deleted file mode 100644 index 19eacfb..0000000 --- a/doc/views/default/index/notfound.ls +++ /dev/null @@ -1 +0,0 @@ -404 not found \ No newline at end of file diff --git a/doc/views/default/layout.ls b/doc/views/default/layout.ls index 50a0d61..aea9997 100644 --- a/doc/views/default/layout.ls +++ b/doc/views/default/layout.ls @@ -70,7 +70,7 @@ local url = __main__:get("url") if tocdata then echo(tocdata.data.name) else - echo("Untitled") + echo("Documentation Hub") end ?> @@ -94,32 +94,49 @@ local url = __main__:get("url")
+
-
- -
- -
- + +
+ +
+
+ +
+ +
+
+
@@ -139,12 +156,15 @@ local url = __main__:get("url") } var input = document.getElementById("search_box"); var form = document.getElementById("search_form"); - form.onsubmit = function() + if(form) { - var val = input.value.trim(); - console.log(val); - if( val === "" || val == "\n") return false; - return true; + form.onsubmit = function() + { + var val = input.value.trim(); + console.log(val); + if( val === "" || val == "\n") return false; + return true; + } } + 404 Not found: no book found + diff --git a/get/shs/antos.sh b/get/shs/antos.sh index e2c32c3..aa6357a 100755 --- a/get/shs/antos.sh +++ b/get/shs/antos.sh @@ -1,28 +1,30 @@ #! /bin/bash set -e -# base server -wget -O- https://get.bitdojo.dev/antd | bash -s "1.0.6b" -# base plugin -wget -O- https://get.bitdojo.dev/antd_plugin | bash -s "lua-0.5.2b" -wget -O- https://get.bitdojo.dev/antd_plugin | bash -s "wterm-1.0.0b" -wget -O- https://get.bitdojo.dev/antd_plugin | bash -s "tunnel-0.1.0b" -# install antos - -[ -d /tmp/apub ] && rm -r /tmp/apub -mkdir -p /tmp/apub -cd /tmp/apub -wget --no-check-certificate "https://github.com/lxsang/antd-tunnel-publishers/raw/master/dist/antd-publishers-0.1.0a.tar.gz" -tar xvzf antd-publishers-0.1.0a.tar.gz -cd antd-publishers-0.1.0a -./configure --prefix=/opt/www && make && make install mkdir -p /opt/www/htdocs -cd /opt/www +if [ "$1" = "full" ]; then + # base server + wget -O- https://get.bitdojo.dev/antd | bash -s "1.0.6b" + # base plugin + wget -O- https://get.bitdojo.dev/antd_plugin | bash -s "lua-0.5.2b" + wget -O- https://get.bitdojo.dev/antd_plugin | bash -s "wterm-1.0.0b" + wget -O- https://get.bitdojo.dev/antd_plugin | bash -s "tunnel-0.1.0b" + # install antos -# create the configuration file -cat << EOF > config.ini + [ -d /tmp/apub ] && rm -r /tmp/apub + mkdir -p /tmp/apub + cd /tmp/apub + wget --no-check-certificate "https://github.com/lxsang/antd-tunnel-publishers/raw/master/dist/antd-publishers-0.1.0a.tar.gz" + tar xvzf antd-publishers-0.1.0a.tar.gz + cd antd-publishers-0.1.0a + ./configure --prefix=/opt/www && make && make install + + cd /opt/www + + # create the configuration file + cat << EOF > config.ini [SERVER] plugins=/opt/www/lib/ plugins_ext=.so @@ -81,11 +83,12 @@ audio/mpeg=mp3,mpeg ls = lua lua = lua EOF -# generate cert -openssl genrsa -des3 -passout pass:1234 -out keypair.key 2048 -openssl rsa -passin pass:1234 -in keypair.key -out server.key -openssl req -new -subj '/C=FR' -key server.key -out server.csr -openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt + # generate cert + openssl genrsa -des3 -passout pass:1234 -out keypair.key 2048 + openssl rsa -passin pass:1234 -in keypair.key -out server.key + openssl req -new -subj '/C=FR' -key server.key -out server.csr + openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt +fi cd /opt/www/htdocs