docs: implement nspaces_get for Class

This commit is contained in:
Daniel Kolesa 2016-08-11 16:00:12 +01:00
parent d53c622795
commit ae1841dd19
3 changed files with 23 additions and 12 deletions

View File

@ -127,7 +127,7 @@ M.Class = Node:clone {
end,
namespaces_get = function(self)
return self.class:namespaces_get()--:to_array()
return self.class:namespaces_get():to_array()
end,
type_get = function(self)
@ -166,6 +166,19 @@ M.Class = Node:clone {
return self.class:c_get_function_name_get()
end,
nspaces_get = function(self, root)
local tbl = self:namespaces_get()
for i = 1, #tbl do
tbl[i] = tbl[i]:lower()
end
table.insert(tbl, 1, eomap.classt_to_str[self.class:type_get()])
tbl[#tbl + 1] = self:name_get():lower()
if root then
tbl[#tbl + 1] = true
end
return tbl
end,
-- static getters
by_name_get = function(name)
@ -232,7 +245,7 @@ M.Event = Node:clone {
end,
nspaces_get = function(self, cl, root)
local tbl = eomap.gen_nsp_class(cl)
local tbl = cl:nspaces_get()
tbl[#tbl + 1] = "event"
tbl[#tbl + 1] = self:name_get():lower():gsub(",", "_")
if root then

View File

@ -64,12 +64,8 @@ M.gen_nsp_eo = function(eobj, subn, root)
return tbl
end
M.gen_nsp_class = function(cl, root)
return M.gen_nsp_eo(cl, M.classt_to_str[cl:type_get()], root)
end
M.gen_nsp_func = function(fn, cl, root)
local tbl = M.gen_nsp_class(cl)
local tbl = cl:nspaces_get()
tbl[#tbl + 1] = M.funct_to_str[fn:type_get()]
tbl[#tbl + 1] = fn:name_get():lower()
if root then

View File

@ -346,8 +346,10 @@ local build_reftable = function(f, title, ctitle, ctype, t, iscl)
local nt = {}
for i, v in ipairs(t) do
nt[#nt + 1] = {
writer.Buffer():write_link(eomap.gen_nsp_eo(v, ctype, true),
v:full_name_get()):finish(),
writer.Buffer():write_link(
iscl and v:nspaces_get() or eomap.gen_nsp_eo(v, ctype, true),
v:full_name_get()
):finish(),
(iscl and v:doc_get() or dtree.Doc(v:documentation_get())):brief_get()
}
end
@ -440,7 +442,7 @@ build_inherits = function(cl, t, lvl)
t = t or {}
lvl = lvl or 0
local lbuf = writer.Buffer()
lbuf:write_link(eomap.gen_nsp_class(cl, true), cl:full_name_get())
lbuf:write_link(cl:nspaces_get(true), cl:full_name_get())
lbuf:write_raw(" ")
lbuf:write_i("(" .. eomap.classt_to_str[cl:type_get()] .. ")")
if lvl == 0 then
@ -692,7 +694,7 @@ local class_to_node = function(cl, main)
-- FIXME: need a dokuwiki graphviz plugin with proper URL support
-- the existing one only supports raw URLs (no dokuwikí namespaces)
--ret.URL = ":" .. global_opts.root_nspace .. ":"
-- .. table.concat(eomap.gen_nsp_class(cl), ":")
-- .. table.concat(cl:nspaces_get(), ":")
return ret
end
@ -735,7 +737,7 @@ local build_igraph = function(cl)
end
local build_class = function(cl)
local f = writer.Writer(eomap.gen_nsp_class(cl))
local f = writer.Writer(cl:nspaces_get())
stats.check_class(cl)
f:write_h(cl:full_name_get(), 2)