Use ldoc to generate teal type definitions
Go to file
JonasT 86f65410df Putting "Repeating tags" one level up, since not related to Lua 5.1 modules
With my last sorting suggestions I accidentally made "Repeating tags" a subsection of "Doing modules the Lua 5.1 way", while it should be on the same level. (or a subsection of something else, but definitely not that)
2014-01-06 08:05:50 +01:00
doc Putting "Repeating tags" one level up, since not related to Lua 5.1 modules 2014-01-06 08:05:50 +01:00
ldoc more general method of controlling visibility of local functions or items marked with @local 2014-01-02 18:45:04 +02:00
tests more general method of controlling visibility of local functions or items marked with @local 2014-01-02 18:45:04 +02:00
COPYRIGHT a custom styling example 2011-06-13 15:43:28 +02:00
changes.md add changes document 2013-09-20 13:52:18 +02:00
ldoc-1.3.8-2.rockspec replaced scm rockspec with regular rockspec 2013-05-06 15:34:39 +02:00
ldoc-1.3.12-1.rockspec added new rockspec; updated docs; nil-description error triggered by ldoc docs 2013-05-16 11:24:05 +02:00
ldoc-scm-2.rockspec Add entries missing in rockspec. 2013-12-21 00:41:34 -02:00
ldoc.lua more general method of controlling visibility of local functions or items marked with @local 2014-01-02 18:45:04 +02:00
makefile Support DESTDIR for the main makefile's install targets. 2013-01-30 17:10:57 +01:00
readme.md updated 1.3 docs 2012-12-29 11:59:30 +02:00

readme.md

LDoc - A Lua Documentation Tool

Copyright (C) 2011-2012 Steve Donovan.

Rationale

This project grew out of the documentation needs of Penlight (and not always getting satisfaction with LuaDoc) and depends on Penlight itself.(This allowed me to not write a lot of code.)

The API documentation of Penlight is an example of a project using plain LuaDoc markup processed using LDoc.

LDoc is intended to be compatible with LuaDoc and thus follows the pattern set by the various *Doc tools:

--- Summary ends with a period.
-- Some description, can be over several lines.
-- @param p1 first parameter
-- @param p2 second parameter
-- @return a string value
-- @see second_fun
function mod1.first_fun(p1,p2)
end

Tags such as see and usage are supported, and generally the names of functions and modules can be inferred from the code.

LDoc is designed to give better diagnostics: if a @see reference cannot be found, then the line number of the reference is given. LDoc knows about modules which do not use module()

  • this is important since this function has become deprecated in Lua 5.2. And you can avoid having to embed HTML in commments by using Markdown.

LDoc will also work with Lua C extension code, and provides some convenient shortcuts.

An example showing the support for named sections and 'classes' is the Winapi documentation; this is generated from winapi.l.c.

Installation

This is straightforward; the only external dependency is Penlight, which in turn needs LuaFileSystem. These are already present in Lua for Windows, and Penlight is also available through LuaRocks as luarocks install penlight.

Unpack the sources somewhere and make an alias to ldoc.lua on your path. That is, either an excutable script called 'ldoc' like so:

lua /path/to/ldoc/ldoc.lua $*

Or a batch file called 'ldoc.bat':

@echo off
lua \path\to\ldoc\ldoc.lua %*