From ad358a80e961f56db5edc81b268448aad1a933fc Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 2 Aug 2016 15:46:03 +0100 Subject: [PATCH] docs: support for foldable inheritance graphs --- src/scripts/elua/apps/gendoc.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua index 828a732..ec471ab 100644 --- a/src/scripts/elua/apps/gendoc.lua +++ b/src/scripts/elua/apps/gendoc.lua @@ -10,7 +10,7 @@ local writer = require("docgen.writer") local keyref = require("docgen.keyref") local ser = require("docgen.serializers") -local use_dot +local use_dot, use_folded -- eolian to various doc elements conversions @@ -724,7 +724,13 @@ local build_class = function(cl) f:write_list(build_inherits(cl)) f:write_nl() if use_dot then + if use_folded then + f:write_raw("++++ Inheritance graph |\n\n") + end f:write_graph(build_igraph(cl)) + if use_folded then + f:write_raw("\n\n++++") + end f:write_nl(2) end @@ -1084,7 +1090,8 @@ getopt.parse { { "n", "namespace", true, help = "Root namespace of the docs." }, { nil, "graph-theme", true, help = "Optional graph theme." }, { nil, "disable-graphviz", false, help = "Disable graphviz usage." }, - { nil, "disable-notes", false, help = "Disable notes plugin usage." } + { nil, "disable-notes", false, help = "Disable notes plugin usage." }, + { nil, "disable-folded", false, help = "Disable folded plugin usage." } }, error_cb = function(parser, msg) io.stderr:write(msg, "\n") @@ -1098,6 +1105,7 @@ getopt.parse { set_theme(opts["graph-theme"]) end use_dot = not opts["disable-graphviz"] + use_folded = not opts["disable-folded"] local rootns = (not opts["n"] or opts["n"] == "") and "efl" or opts["n"] local dr -- 2.7.4