summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-05 14:29:14 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-12 11:59:09 +0100
commitd46ae0205c056103697196b94a6ffe745e3d0033 (patch)
tree8514130615f133a110140abbfe032c3beeb07594
parenta7297cef42daf8bef47ac69a64b3bede36f12790 (diff)
docgen: generate pages for different types
-rw-r--r--gendoc.lua33
1 files changed, 23 insertions, 10 deletions
diff --git a/gendoc.lua b/gendoc.lua
index 18d5b61..db201e8 100644
--- a/gendoc.lua
+++ b/gendoc.lua
@@ -1228,23 +1228,13 @@ end
1228 1228
1229local build_method, build_property 1229local build_method, build_property
1230 1230
1231local reft_checks = {
1232 ["alias"] = check_alias,
1233 ["struct"] = check_struct,
1234 ["enum"] = check_enum,
1235 ["constant"] = check_constant,
1236 ["global"] = check_global
1237}
1238
1239local build_reftable = function(f, title, ctitle, ctype, t) 1231local build_reftable = function(f, title, ctitle, ctype, t)
1240 if not t or #t == 0 then 1232 if not t or #t == 0 then
1241 return 1233 return
1242 end 1234 end
1243 f:write_h(title, 2) 1235 f:write_h(title, 2)
1244 local nt = {} 1236 local nt = {}
1245 local cfunc = reft_checks[ctype]
1246 for i, v in ipairs(t) do 1237 for i, v in ipairs(t) do
1247 if cfunc then cfunc(v) end
1248 nt[#nt + 1] = { 1238 nt[#nt + 1] = {
1249 Buffer():write_link(gen_nsp_eo(v, ctype, true), 1239 Buffer():write_link(gen_nsp_eo(v, ctype, true),
1250 v:full_name_get()):finish(), 1240 v:full_name_get()):finish(),
@@ -1490,15 +1480,35 @@ local build_classes = function()
1490end 1480end
1491 1481
1492local build_alias = function(tp) 1482local build_alias = function(tp)
1483 local f = Writer(gen_nsp_eo(tp, "alias"))
1484 check_alias(tp)
1485
1486 f:finish()
1493end 1487end
1494 1488
1495local build_struct = function(tp) 1489local build_struct = function(tp)
1490 local f = Writer(gen_nsp_eo(tp, "struct"))
1491 check_struct(tp)
1492
1493 f:finish()
1496end 1494end
1497 1495
1498local build_enum = function(tp) 1496local build_enum = function(tp)
1497 local f = Writer(gen_nsp_eo(tp, "enum"))
1498 check_enum(tp)
1499
1500 f:finish()
1499end 1501end
1500 1502
1501local build_variable = function(v, constant) 1503local build_variable = function(v, constant)
1504 local f = Writer(gen_nsp_eo(v, constant and "constant" or "global"))
1505 if constant then
1506 check_constant(v)
1507 else
1508 check_global(v)
1509 end
1510
1511 f:finish()
1502end 1512end
1503 1513
1504local build_typedecls = function() 1514local build_typedecls = function()
@@ -1513,7 +1523,9 @@ local build_typedecls = function()
1513 for tp in eolian.typedecl_all_enums_get() do 1523 for tp in eolian.typedecl_all_enums_get() do
1514 build_enum(tp) 1524 build_enum(tp)
1515 end 1525 end
1526end
1516 1527
1528local build_variables = function()
1517 for v in eolian.variable_all_constants_get() do 1529 for v in eolian.variable_all_constants_get() do
1518 build_variable(v, true) 1530 build_variable(v, true)
1519 end 1531 end
@@ -1728,6 +1740,7 @@ getopt.parse {
1728 build_ref() 1740 build_ref()
1729 build_classes() 1741 build_classes()
1730 build_typedecls() 1742 build_typedecls()
1743 build_variables()
1731 print_stats() 1744 print_stats()
1732 end 1745 end
1733} 1746}