1
2
3
4
5
6
7
8
9
10
11
12
13
..
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
-- vim: ft=terra
local page = lib.srv.convo.page
local pstr = lib.mem.ptr(int8)
local pref = lib.mem.ref(int8)
local P = lib.str.plit
local R = lib.str.lit
local topics = lib.util.keys(data.doc)
local topicidxt = {}
table.sort(topics) -- because deterministic builds are good
local branches = {}
for i,k in pairs(topics) do
topicidxt[k] = i
................................................................................
if t.meta.priv then
if type(t.meta.priv) ~= 'table' then t.meta.priv = {t.meta.priv} end
for _,v in pairs(t.meta.priv) do
setbits = quote [setbits]; (restrict.[v] << true) end
end
end
allpages[i] = quote var [restrict]; [setbits] in pgpair {
name = R(v);
parent = par;
priv = restrict;
title = R(t.meta.title);
content = page {
title = ['documentation :: ' .. t.meta.title];
body = [ t.text ];
class = P'doc article';
cache = true;
};
} end
end
local terra
showpage(co: &lib.srv.convo, id: pref)
................................................................................
end
end
list:lpush('</ul>')
co:stdpage(page {
title = 'documentation';
body = list:finalize();
class = P'doc listing';
cache = false;
})
else showpage(co, pg) end
end
return render_docpage
|
|
1
2
3
4
5
6
7
8
9
10
11
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
-- vim: ft=terra
local page = lib.srv.convo.page
local pstr = lib.mem.ptr(int8)
local pref = lib.mem.ref(int8)
local topics = lib.util.keys(data.doc)
local topicidxt = {}
table.sort(topics) -- because deterministic builds are good
local branches = {}
for i,k in pairs(topics) do
topicidxt[k] = i
................................................................................
if t.meta.priv then
if type(t.meta.priv) ~= 'table' then t.meta.priv = {t.meta.priv} end
for _,v in pairs(t.meta.priv) do
setbits = quote [setbits]; (restrict.[v] << true) end
end
end
allpages[i] = quote var [restrict]; [setbits] in pgpair {
name = [v];
parent = par;
priv = restrict;
title = [t.meta.title];
content = page {
title = ['documentation :: ' .. t.meta.title];
body = [ t.text ];
class = 'doc article';
cache = true;
};
} end
end
local terra
showpage(co: &lib.srv.convo, id: pref)
................................................................................
end
end
list:lpush('</ul>')
co:stdpage(page {
title = 'documentation';
body = list:finalize();
class = 'doc listing';
cache = false;
})
else showpage(co, pg) end
end
return render_docpage
|