docs: Complete removal of object type from API URLs
authorAndy Williams <andy@andywilliams.me>
Fri, 8 Dec 2017 18:16:51 +0000 (18:16 +0000)
committerAndy Williams <andy@andywilliams.me>
Fri, 8 Dec 2017 18:16:51 +0000 (18:16 +0000)
We still have the subtypes for now, that is less
likely to cause user confusion as they are unlikely to browse
method names in the address bar.

src/scripts/elua/apps/docgen/writer.lua
src/scripts/elua/apps/gendoc.lua

index 648aa54..9042c84 100644 (file)
@@ -270,16 +270,14 @@ writers["dokuwiki"] = util.Object:clone {
 
     write_link = function(self, target, title)
         if type(target) == "table" then
-            if target[#target] == true then
-                target[#target] = nil
-                target = ":" .. root_nspace .. ":"
-                             .. table.concat(target, ":")
-            elseif target[#target] == false then
+            if target[#target] == false then
                 target[#target] = nil
                 target = ":" .. root_nspace .. "-include:"
                              .. table.concat(target, ":")
             else
-                target = table.concat(target, ":")
+                target[#target] = nil
+                target = ":" .. root_nspace .. ":"
+                             .. table.concat(target, ":")
             end
         end
         if not title then
index f950d5b..04c0764 100644 (file)
@@ -315,7 +315,7 @@ local build_reftable = function(f, title, ctitle, ctype, t, iscl)
         nt[#nt + 1] = {
             writer.Buffer():write_link(
                 iscl and v:nspaces_get(true)
-                      or dtree.Node.nspaces_get(v, ctype, true),
+                      or dtree.Node.nspaces_get(v, true),
                 v:full_name_get()
             ):finish(),
             v:doc_get():brief_get()
@@ -1026,7 +1026,7 @@ local write_tsigs = function(f, tp, ns)
 end
 
 local build_alias = function(tp)
-    local ns = dtree.Node.nspaces_get(tp, "alias")
+    local ns = dtree.Node.nspaces_get(tp)
     local fulln = tp:full_name_get()
     local f = writer.Writer(ns, fulln)
     printgen("Generating alias: " .. fulln)
@@ -1044,7 +1044,7 @@ local build_alias = function(tp)
 end
 
 local build_struct = function(tp)
-    local ns = dtree.Node.nspaces_get(tp, "struct")
+    local ns = dtree.Node.nspaces_get(tp)
     local fulln = tp:full_name_get()
     local f = writer.Writer(ns, fulln)
     printgen("Generating struct: " .. fulln)
@@ -1077,7 +1077,7 @@ local build_struct = function(tp)
 end
 
 local build_enum = function(tp)
-    local ns = dtree.Node.nspaces_get(tp, "enum")
+    local ns = dtree.Node.nspaces_get(tp)
     local fulln = tp:full_name_get()
     local f = writer.Writer(ns, fulln)
     printgen("Generating enum: " .. fulln)