# publicstevedonovan/LDoc

### Subversion checkout URL

You can clone with HTTPS or Subversion.

…doc updates
latest commit 511dfe7df0
authored
 doc ldoc.custom_references to create new @{KIND:NAME} reference schemes; … January 21, 2014 ldoc ldoc.custom_references to create new @{KIND:NAME} reference schemes; … January 21, 2014 tests more general method of controlling visibility of local functions or i… January 02, 2014 COPYRIGHT a custom styling example June 13, 2011 changes.md updated changes.md - preparing for release January 10, 2014 ldoc-1.3.12-1.rockspec added new rockspec; updated docs; nil-description error triggered by … May 16, 2013 ldoc-1.3.8-2.rockspec replaced scm rockspec with regular rockspec May 06, 2013 ldoc-scm-2.rockspec Add entries missing in rockspec. December 21, 2013 ldoc.lua ldoc.custom_references to create new @{KIND:NAME} reference schemes; … January 21, 2014 makefile Support DESTDIR for the main makefile's install targets. January 30, 2013 readme.md Updated LuaDoc canonical URL January 15, 2014

# LDoc - A Lua Documentation Tool

## 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 %*

Something went wrong with that request. Please try again.