aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/manual.md27
-rw-r--r--modules/lua/init.lua2
2 files changed, 29 insertions, 0 deletions
diff --git a/doc/manual.md b/doc/manual.md
index 4d297212..da8dd233 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -1492,6 +1492,33 @@ using Lua" is not an exaggeration!
[shows the pane]: api.html#ui.find.focus
[menu action]: api.html#textadept.menu.menubar
+### Generating Autocompletions and Documentation
+
+Generate Lua
+[autocompletion and documentation](#Autocompletion.and.Documentation) files for
+your own modules using the *modules/lua/tadoc.lua* [LuaDoc][] module:
+
+ luadoc -d [output_path] --doclet _HOME/modules/lua/tadoc.lua [module(s)]
+
+where `_HOME` is the path where you installed Textadept and `output_path` is
+an arbitrary path to write the generated *tags* and *api* files to. You can then
+use your *~/.textadept/init.lua* file to load those completions and API docs for
+use within Textadept when editing [Lua files][]:
+
+ events.connect(events.LEXER_LOADED, function(lexer)
+ if lexer == 'lua' then
+ _M.lua.tags[#_M.lua.tags + 1] = '/path/to/tags'
+ local lua_api_files = textadept.editing.api_files.lua
+ lua_api_files[#lua_api_files + 1] = '/path/to/api'
+ end
+ end)
+
+Textadept uses this script to generate its own *tags* and *api* files for its
+Lua API.
+
+[LuaDoc]: http://keplerproject.github.com/luadoc/
+[Lua files]: api.html#_M.lua
+
### Generating LuaDoc
Generate Textadept-like API documentation for your own modules using the
diff --git a/modules/lua/init.lua b/modules/lua/init.lua
index b2122d93..978884bb 100644
--- a/modules/lua/init.lua
+++ b/modules/lua/init.lua
@@ -14,6 +14,8 @@ module('_M.lua')]]
-- List of "fake" ctags files to use for autocompletion.
-- The kind 'm' is recognized as a module, 'f' as a function, 't' as a table and
-- 'F' as a module or table field.
+-- The *modules/lua/tadoc.lua* script can generate *tags* and
+-- [*api*](#textadept.editing.api_files) files for Lua modules via LuaDoc.
-- @class table
-- @name tags
M.tags = {_HOME..'/modules/lua/tags', _USERHOME..'/modules/lua/tags'}