Use ldoc to generate teal type definitions
Go to file
steve donovan 6832e1de2d module not added with sensible line number - causes crash on warning 2011-08-27 10:11:41 +02:00
builtin Can now have <<REF>> inside Markdown-flavoured ldoc, which use the same rules for 2011-07-05 18:19:49 +02:00
docs example of using --package ... to generate luadoc documentation correctly 2011-08-14 11:50:36 +02:00
html do not put out an index backlink on the actual index page 2011-08-26 15:45:56 +02:00
ldoc module not added with sensible line number - causes crash on warning 2011-08-27 10:11:41 +02:00
tests updated test 2011-08-25 19:02:43 +02:00
COPYRIGHT a custom styling example 2011-06-13 15:43:28 +02:00
ldoc.lua --tags broke ldoc! The new builtins are fixme, todo and warning, and the old tags author, license and copyright also work 2011-08-26 15:41:38 +02:00
readme.md doc fixes 2011-06-19 18:13:36 +02:00

readme.md

LDoc - A Lua Documentation Tool

Copyright (C) 2011 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 %*