Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "LDT/User Area/LuaDocumentor"

< LDT
(How to install it)
(How to install it)
Line 7: Line 7:
  
 
== How to install it  ==
 
== How to install it  ==
 
=== Luarocks ===
 
  
 
<source lang="bash">
 
<source lang="bash">
 
$ luarocks install --local luadocumentor
 
$ luarocks install --local luadocumentor
 
</source>
 
</source>
 
=== From Sources ===
 
 
*LuaDocumentor depends on ''Lua 5.1'' and [http://keplerproject.github.com/luafilesystem/ lfs], so you need to install it&nbsp;:
 
**For windows&nbsp;: If you have installed [http://code.google.com/p/luaforwindows/ luaforwindows], you should already have lfs.
 
**For linux&nbsp;: Generaly you can find it on your official system package repository.
 
**Both&nbsp;: You can use [http://luarocks.org/ luarock] to intall it too.
 
*Download [http://eclipse.org/downloads/download.php?file=/koneki/luadocumentor/0.1.3/luadocumentor-0.1.3-de51f10382-noarch.zip LuaDocumentor 0.1.3]
 
*Extract it.
 
 
'''Note''': Since the 0.1.3 version, luadocumentor can extract information from code. You could use the legacy behavior by using the <code>--noheuristic</code> option (see command line detail below)
 
  
 
== Command line detail ==
 
== Command line detail ==

Revision as of 10:23, 12 March 2014

Overview

LuaDocumentor allow users to generate HTML documentation and API files from some code documented using Lua documentation language. The generated HTML is similar to ldoc. It means you can probably reuse an existing ldoc CSS with virtually no modifications. The other output of LuaDocumentor is API files, an API file for a module is the original file, without the code with only the Lua document language. This is use to expose API without exposing the code. This mode is largely used to create Execution Environements.

LuaDocumentor is based on popular lua libraries : lfs, metalua, lapp and template from penlight.

How to install it

$ luarocks install --local luadocumentor

Command line detail

luadocumentor: tool for Lua Documentation Language

  • -f, --format (default doc) Define output format :
    • doc: Will produce HTML documentation from specified file(s) or directories.
    • api: Will produce API file(s) from specified file(s) or directories.
  • -d, --dir (default docs) Define an output directory. If the given directory doesn't exist, it will be created.
  • -h, --help Display the help.
  • -n, --noheuristic Do not use code analysis, use only comments to generate documentation.
  • -s, --style (default !) The path of your own css file, if you don't want to use the default one. (usefull only for the doc format)
  • [directories|files] Define the paths or the directories of inputs files. Only Lua or C files containing a @module tag will be considered.

Examples

lua luadocumentor.lua .
Create a folder called docs containing the HTML documentation of each valid lua file under the current folder.


lua luadocumentor.lua -f api -d /tmp/output file1.lua file2.lua
Create API files for file1.lua and file2.lua in the /tmp/output folder.


lua luadocumentor.lua -f doc -d /tmp/output -s my.css /tmp/directory /tmp/file.lua
Create HTML files for the file.lua and all valid lua file in the directory in the output folder. Use my.css as stylesheet.

Back to the top