Questions tagged [luadoc]

is a documentation generator tool for Lua source code. It parses the declarations and documentation comments in a set of Lua source files and produces a set of XHTML pages describing the commented declarations and functions.

Overview

LuaDoc is a documentation generator tool for source code. It parses the declarations and documentation comments in a set of Lua source files and produces a set of pages describing the commented declarations and functions.

The output is not limited to XHTML. Other formats can be generated by implementing new doclets. The format of the documentation comments is also flexible and can be customized by implementing new taglets. Please refer to customizing section for further information.

LuaDoc is free software and uses the same license as Lua. Current version is 3.0.1. It was developed for Lua 5.1.

Download

LuaDoc can be downloaded from its Lua Forge page.

Dependencies

LuaDoc depends on two external packages:

Architecture

LuaDoc's processing can be divided in two distinct steps: parsing and generation. The parsing step take as input a set of .lua files and must produce a Documentation object. A generator takes a Documentation object as input and produces a set of output files. It's up to the generator to decide which output format it will generate.

Architecture

The parsing step is executed by a component called taglet, while the generation is handled by a component called doclet. This architecture is shown below.

Taglet

LuaDoc does not impose a documentation format. Instead, it relies on an internal representation of the documentation. This representation is described in the Documentation section. If the developer wants to use a custom documentation format the taglet component can be replaced.

Writing a new taglet is a matter a implementing a single method:

function start (files, doc)
  • files - a list of file (or directory) names.
  • doc - a preprocessed documentation object.

Doclet

The primary job of an doclet is to take a Documentation object and generate some kind of output. LuaDoc is bundled with an implementation that generates HTML files.

Writing a new doclet is a matter a implementing a single method:

function start (doc)
  • doc - a documentation object.

Credits

Tag wiki copied from LuaDoc GitHub pages

11 questions
9
votes
1 answer

A regex I don't understand

I'm starring at these few (slightly modified) lines from luadoc that are obviously building a filename with a full path. But I simply don't get it what happens in line 5. The parameter filename could be something like "myfile.lua". function out_file…
h0b0
  • 1,802
  • 1
  • 25
  • 44
4
votes
1 answer

How to document a closure with LuaDoc?

Suppose I have a function that returns a closure: --- Agent constructor -- @return A function describing the behavior of the agent Agent = function(data) return function(arg1, arg2, ...) end end And then I have a variable that receives that…
Daniel
  • 645
  • 7
  • 11
3
votes
2 answers

Lua comment --~

I know LuaDoc uses "---" on the first line of comments like this: --- an example function -- @param a parameter a desc -- @param b parameter b desc function f (a,b) --code --code end However I see this in the beginning of comments: --~…
AlexStack
  • 16,766
  • 21
  • 72
  • 104
3
votes
1 answer

lua - metadata for documentation

I've read a comment from Norman Ramsey about using metadata for generating documentation in lua. I'm attempting to generate documentation from my lib, and I'd rather not use luadoc if possible. I'd like to know more about this "metadata-oriented"…
kikito
  • 51,734
  • 32
  • 149
  • 189
3
votes
1 answer

How to use luadoc in ubuntu/linux?

As the title says, how to use luadoc in ubuntu/linux? I generated documentation in windows using batch file but no success in ubuntu. Any ideas? luadoc Usage: /usr/bin/luadoc [options|files] Generate documentation from files. Available options are: …
Chhabilal
  • 1,076
  • 11
  • 22
3
votes
0 answers

How to format LuaDoc multiline comments in Lua code

I have a long Lua (LuaDoc) comment which I want to convert to a multi-line comment using the VIM command 'qgap'. Guess there is some solution in .vimrc with format-comments, but I couldn't figure it out myself. Example: --- This is a very long…
Erwin411
  • 734
  • 1
  • 7
  • 14
2
votes
2 answers

How do I document that an input parameter is a table of some type in Lua Development Tools?

In Lua Development Tools, how do I document that an input parameter is a table of some type? mynamespace = {} --- -- @type mynamespace.MyClass -- @field #number var1 mynamespace.MyClass = {} --- -- @param #number param1 -- @return…
birgersp
  • 3,909
  • 8
  • 39
  • 79
2
votes
1 answer

Error generating documentation for lua

i'm trying to generate documentation for my lua project i have my lua installation folder and within it i have luafilesystem and lualogging but when i try to generate doc using luadoc-start.bat i get an error saying lfs module not found i think lfs…
Antwan
  • 3,837
  • 9
  • 41
  • 62
2
votes
2 answers

How to use LuaDoc with LuaForWindows

The question is all in the title : how to use LuaDoc with LuaForWindows ? In my Lua installation, I have a luadoc_start.bat but the command windows closes as soon as it opens. From there I don't know what else can I do. Any help ? Thanks
0
votes
1 answer

Using LuaDoc with extensions other than .lua

I am currently developing lua scripts for a new application which requires the extension to be xx_lua. I have luadoc working fine for .lua extensions and I know I could simply rename the files to the lua extension create the documents and rename…
Jane T
  • 2,081
  • 2
  • 17
  • 23
0
votes
1 answer

use LDoc to generate document for whole lua project with index page

I want to generate documentation for my lua project but with Ldoc i generate docs for each single lua file and the output file every time overwrite the index.html file . So my question is how i can generate generate documentation for the whole…
Antwan
  • 3,837
  • 9
  • 41
  • 62