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
m
(Overview)
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
LuaDocumentor allow users to generate HTML documentation and API files from some code documented using [[/Koneki/LDT/User_Area/Documentation_Language| Lua documentation language]]
+
LuaDocumentor allow users to generate HTML documentation and API files from some code documented using [[LDT/User_Area/Documentation_Language|Lua documentation language]].
The generated HTML is similar to [https://github.com/stevedonovan/LDoc ldoc] and looks like to popular JavaDoc and ldoc's CSS can't be reused for LuaDocumentor HTML result.
+
The generated HTML is similar to [http://github.com/stevedonovan/LDoc 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 [[/Koneki/LDT/User_Area/Execution_Environment_file_format|create Execution Environements]].
+
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 [[LDT/User_Area/Execution_Environment_file_format|create Execution Environements]].
  
== How to install it ==
+
LuaDocumentor is based on popular lua libraries : lfs, metalua, lapp and template from penlight.
  
#Download the archive [http://91.121.117.128/koneki/luadocumentor/ here]
+
Sources are available on GitHub: [https://github.com/LuaDevelopmentTools/luadocumentor https://github.com/LuaDevelopmentTools/luadocumentor].
#Extract the LuaDocumentor archive somewhere, and be modify LUA_PATH environment variable to and the absolute path of the extracted folder
+
#Under linux, change the luadocumentor.lua file rights to be executable
+
#To be able to launch luadocumentor from any folder, you have two choice:
+
##Add the extracted folder to the PATH environment variable
+
##Under linux, create an alias in your ~/.profile witch run the luadocumentor.lua file
+
  
== Command line detail ==
+
== How to install it  ==
  
'''luadocumentor.lua [OPTIONS] (DIRECTORIES|FILES)...'''
+
<source lang="bash">
 +
$ luarocks install --local luadocumentor
 +
</source>
  
* -f, --format: Define output format:
+
== Command line detail ==
** doc: Will produce HTML documentation from specified file(s) or directories (default value).
+
** sdk: Will produce API file(s) from specified file(s) or directories.
+
 
+
* -d, --dir: Define an output directory, by default the output directory is "docs". If the given directory doesn't exist, it will be created.
+
 
+
* -h, --help: Display the help.
+
 
+
* -s, --style: Define a css to put with HTML files (usefull only for the doc format).
+
 
+
* DIRECTORIES: One or several directories to look for input files. Input files considered are lua or c files containing a @module tag.
+
  
* FILES: One or several input files. Input files considered are lua or c files containing a @module tag.
+
'''luadocumentor v0.1.4: 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 ==
 
== Examples ==
  
<code><pre>luadocumentor.lua .</pre></code>
+
<source lang="bash">$ luadocumentor .</source>
<center>Create a folder called ''docs'' containing the HTML documentation of each valid lua file under the current folder.</center>
+
<center><small>Create a folder called ''docs'' containing the HTML documentation of each valid lua file under the current folder.</small></center>
  
  
<code><pre>luadocumentor.lua -f sdk -d /tmp/output file1.lua file2.lua</pre></code>
+
<source lang="bash">$ luadocumentor -f api -d /tmp/output file1.lua file2.lua</source>
<center>Create API files for file1.lua and file2.lua in the /tmp/output folder.</center>
+
<center><small>Create API files for file1.lua and file2.lua in the /tmp/output folder.</small></center>
  
  
<code><pre>luadocumentor.lua -f doc -d /tmp/output -s my.css /tmp/directory /tmp/file.lua</pre></code>
+
<source lang="bash">$ luadocumentor -f doc -d /tmp/output -s my.css /tmp/directory /tmp/file.lua</source>
<center>Create HTML files for the file.lua and all valid lua file in the directory in the output folder where my.css file is also copied.</center>
+
<center><small>Create HTML files for the file.lua and all valid lua file in the directory in the output folder. Use my.css as stylesheet.</small></center>

Latest revision as of 11:56, 16 July 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.

Sources are available on GitHub: https://github.com/LuaDevelopmentTools/luadocumentor.

How to install it

$ luarocks install --local luadocumentor

Command line detail

luadocumentor v0.1.4: 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

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


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


$ luadocumentor -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