summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-12-13 10:06:16 +0000
committerAndy Williams <andy@andywilliams.me>2017-12-13 10:08:21 +0000
commitd5d130085af045d3ee5736afc0649cc2ace47860 (patch)
treea9fd6daf2b8f46d0e2a18b7a3a9f9cdd8dfd0b1c
parentcf36e21e0787b63aa784907a87d19c2983061beb (diff)
docs: Remove the somewhat unreadable graphs from web output
-rw-r--r--src/scripts/elua/apps/docgen/writer.lua70
-rw-r--r--src/scripts/elua/apps/gendoc.lua61
2 files changed, 0 insertions, 131 deletions
diff --git a/src/scripts/elua/apps/docgen/writer.lua b/src/scripts/elua/apps/docgen/writer.lua
index 9042c8481c..92be2f1adf 100644
--- a/src/scripts/elua/apps/docgen/writer.lua
+++ b/src/scripts/elua/apps/docgen/writer.lua
@@ -295,76 +295,6 @@ writers["dokuwiki"] = util.Object:clone {
295 return self 295 return self
296 end, 296 end,
297 297
298 write_graph = function(self, tbl)
299 if not M.has_feature("dot") then
300 return self
301 end
302 self:write_raw("<graphviz>\n")
303 self:write_raw("digraph ", tbl.type, " {\n")
304
305 for k, v in pairs(tbl.attrs or {}) do
306 self:write_raw(" ", k, " = \"", v, "\"\n")
307 end
308
309 local write_attrs = function(attrs)
310 if not attrs then
311 return
312 end
313 self:write_raw(" [")
314 local first = true
315 for k, v in pairs(attrs) do
316 if not first then
317 self:write_raw(", ")
318 end
319 self:write_raw(k, " = \"", v, "\"")
320 first = false
321 end
322 self:write_raw("]")
323 end
324
325 if tbl.node then
326 self:write_nl()
327 self:write_raw(" node")
328 write_attrs(tbl.node)
329 self:write_nl()
330 end
331 if tbl.edge then
332 if not tbl.node then self:write_nl() end
333 self:write_raw(" edge")
334 write_attrs(tbl.edge)
335 self:write_nl()
336 end
337
338 self:write_nl()
339 for i, v in ipairs(tbl.nodes) do
340 local nname = v.name
341 v.name = nil
342 self:write_raw(" ", nname)
343 write_attrs(v)
344 self:write_nl()
345 end
346
347 self:write_nl()
348 for i, v in ipairs(tbl.connections) do
349 local from, to, sep, attrs = v[1], v[2], (v[3] or "->")
350 if type(from) == "table" then
351 self:write_raw(" {", table.concat(from, ", "), "}")
352 else
353 self:write_raw(" ", from)
354 end
355 self:write_raw(" ", sep, " ")
356 if type(to) == "table" then
357 self:write_raw("{", table.concat(to, ", "), "}")
358 else
359 self:write_raw(to)
360 end
361 write_attrs(v[4])
362 self:write_nl()
363 end
364
365 self:write_raw("}\n</graphviz>")
366 end,
367
368 write_table = function(self, titles, tbl) 298 write_table = function(self, titles, tbl)
369 if titles then 299 if titles then
370 self:write_raw("^ ", table.concat(titles, " ^ "), " ^\n") 300 self:write_raw("^ ", table.concat(titles, " ^ "), " ^\n")
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index ee306bf18a..6de63b7131 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -615,62 +615,6 @@ local set_theme = function(tname)
615 end 615 end
616end 616end
617 617
618local class_to_node = function(cl, main)
619 local ret = {}
620
621 ret.label = cl:full_name_get()
622 ret.name = ret.label:lower():gsub("%.", "_")
623
624 local clr = cl:theme_str_get()
625
626 ret.style = current_theme.classes[clr].style
627 ret.color = current_theme.classes[clr][main and "primary_color" or "color"]
628 ret.fillcolor = current_theme.classes[clr][main and "primary_fill_color"
629 or "fill_color"]
630 ret.fontcolor = current_theme.classes[clr][main and "primary_font_color"
631 or "font_color"]
632
633 -- FIXME: need a dokuwiki graphviz plugin with proper URL support
634 -- the existing one only supports raw URLs (no dokuwikí namespaces)
635 --ret.URL = ":" .. global_opts.root_nspace .. ":"
636 -- .. table.concat(cl:nspaces_get(), ":")
637
638 return ret
639end
640
641local build_igraph_r
642build_igraph_r = function(cl, nbuf, ibuf)
643 local sn = cl:full_name_get():lower():gsub("%.", "_")
644 for i, acl in ipairs(cl:inherits_get()) do
645 nbuf[#nbuf + 1] = class_to_node(acl)
646 ibuf[#ibuf + 1] = { sn, (acl:full_name_get():lower():gsub("%.", "_")) }
647 build_igraph_r(acl, nbuf, ibuf)
648 end
649end
650
651local build_igraph = function(cl)
652 local graph = {
653 type = "hierarchy",
654 attrs = {
655 rankdir = current_theme.rank_dir,
656 size = current_theme.size,
657 bgcolor = current_theme.bg_color
658 },
659 node = current_theme.node,
660 edge = current_theme.edge
661 }
662
663 local nbuf = {}
664 local ibuf = {}
665 nbuf[#nbuf + 1] = class_to_node(cl, true)
666 build_igraph_r(cl, nbuf, ibuf)
667
668 graph.nodes = nbuf
669 graph.connections = ibuf
670
671 return graph
672end
673
674local find_parent_impl 618local find_parent_impl
675find_parent_impl = function(fulln, cl) 619find_parent_impl = function(fulln, cl)
676 for i, pcl in ipairs(cl:inherits_get()) do 620 for i, pcl in ipairs(cl:inherits_get()) do
@@ -1025,9 +969,6 @@ local build_class = function(cl)
1025 end 969 end
1026 f:write_nl() 970 f:write_nl()
1027 971
1028 f:write_folded("Inheritance graph", function()
1029 f:write_graph(build_igraph(cl))
1030 end)
1031 if writer.has_feature("dot") then 972 if writer.has_feature("dot") then
1032 f:write_nl(2) 973 f:write_nl(2)
1033 end 974 end
@@ -1634,7 +1575,6 @@ getopt.parse {
1634 { "n", "namespace", true, help = "Root namespace of the docs." }, 1575 { "n", "namespace", true, help = "Root namespace of the docs." },
1635 { nil, "graph-theme", true, help = "Optional graph theme." }, 1576 { nil, "graph-theme", true, help = "Optional graph theme." },
1636 { nil, "graph-theme-light", false, help = "Use light builtin graph theme." }, 1577 { nil, "graph-theme-light", false, help = "Use light builtin graph theme." },
1637 { nil, "disable-graphviz", false, help = "Disable graphviz usage." },
1638 { nil, "disable-notes", false, help = "Disable notes plugin usage." }, 1578 { nil, "disable-notes", false, help = "Disable notes plugin usage." },
1639 { nil, "disable-folded", false, help = "Disable folded plugin usage." }, 1579 { nil, "disable-folded", false, help = "Disable folded plugin usage." },
1640 { nil, "disable-title", false, help = "Disable title plugin usage." }, 1580 { nil, "disable-title", false, help = "Disable title plugin usage." },
@@ -1693,7 +1633,6 @@ getopt.parse {
1693 local wfeatures = { 1633 local wfeatures = {
1694 notes = not opts["disable-notes"], 1634 notes = not opts["disable-notes"],
1695 folds = not opts["disable-folded"], 1635 folds = not opts["disable-folded"],
1696 dot = not opts["disable-graphviz"],
1697 title = not opts["disable-title"] 1636 title = not opts["disable-title"]
1698 } 1637 }
1699 writer.init(rootns, wfeatures) 1638 writer.init(rootns, wfeatures)