Permalink
Browse files

Fix Bug 383657 - [luadocumentor] lnline link

  • Loading branch information...
1 parent b52b978 commit b38ab076828af361fdcfa48d0e364ecb23c48afa @maubry maubry committed with sbernard31 Jun 29, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 libraries/doctemplates/template/utils.lua
View
16 libraries/doctemplates/template/utils.lua
@@ -66,6 +66,7 @@ end
M.linktypes = {
internaltyperef = function(o) return string.format('##(%s)', o.typename) end,
externaltyperef = function(o) return string.format('%s.html##(%s)', o.modulename, o.typename) end,
+ file = function(o) return string.format('%s.html', o.name) end,
index = function() return 'index.html' end,
recordtypedef = function(o)
local anchor = M.anchor(o)
@@ -324,6 +325,18 @@ local extern = function (type)
end
---
+-- Build an API external reference from a string like: `mod.ule`
+local file = function (type)
+ for modulename in type:gmatch('([%a%.%d_]+)') do
+ local file = apimodel._file()
+ file.name = modulename
+ return file
+ end
+ return nil
+end
+
+
+---
-- Provide API Model element from a string
-- @usage local externaltyperef = getelement("somemodule#somefield")
function M.getelement( str )
@@ -333,7 +346,8 @@ function M.getelement( str )
globals,
field,
extern,
- internal
+ internal,
+ file
}
-- Loop over extractors.
-- First valid result is used

0 comments on commit b38ab07

Please sign in to comment.