Jump to content

LuaDoc

Modules

Files

  • luadoc/doclet/ikiwiki.lua

File luadoc/doclet/ikiwiki.lua

Doclet that generates MarkDown output that can be included in a IkiWiki site. This doclet generates a set of mdwn files based on a group of templates. The main templates are:

  • index.lp: index of modules and files;
  • file.lp: documentation for a lua file;
  • module.lp: documentation for a lua module;
  • function.lp: documentation for a lua function. This is a sub-template used by the others.

Author:

  • Tuomas Jormola

Copyright: © 2011-2016 Tuomas Jormola tj@solitudo.net http://solitudo.net Licensed under the terms of the GNU General Public License Version 2.0.

Functions summary

file link (doc, to) Returns the wikilink of a lua(doc) file
include (template, env) Include the result of a lp template into the current stream
link to (fname, doc, module_doc, file_doc, kind) Returns a wikilink to a function or to a table
module link (doc, modulename) Returns the wikilink of a module
out file (filename) Assembly the output mdwn filename for an input file
out module (modulename) Assembly the output mdwn filename for a module
search (path, name) Looks for a file name in given path.
start (doc) Generate the output
symbol link (symbol, doc, module_doc, file_doc) Make a wikilink to a module, function, or table

Functions


file_link (doc, to)

Returns the wikilink of a lua(doc) file

Parameters

  • doc: Documentation table
  • to: Name of the file to be processed, may be a .lua file or a .luadoc file beginning of path

Return value:

Wikilink string for the file


include (template, env)

Include the result of a lp template into the current stream

Parameters

  • template: Template name
  • env: Environment for the template

Return value:

String resulted from the template expansion


Returns a wikilink to a function or to a table

Parameters

  • fname: Name of the function or table to link to
  • doc: Documentation table
  • module_doc: Modules table
  • file_doc: Files table
  • kind: String specifying the kind of element to link (“functions” or “tables”). Default is “functions”.

Return value:

Wikilink string for the function or table


module_link (doc, modulename)

Returns the wikilink of a module

Parameters

  • doc: Documentation table
  • modulename: Name of the module to be processed

Return value:

Wikilink string for the module


out_file (filename)

Assembly the output mdwn filename for an input file

Parameters

  • filename: input file

Return value:

mdwn file name matching the input file


out_module (modulename)

Assembly the output mdwn filename for a module

Parameters

  • modulename: module for which to get the filename

Return value:

mdwn file name matching the module


search (path, name)

Looks for a file name in given path. Removed from compat-5.1

Parameters

  • path: String with the path
  • name: String with the name to look for

Return value:

String with the complete path of the file found or nil in case the file is not found.


start (doc)

Generate the output

Parameters

  • doc: Table with the structured documentation.

symbol_link (symbol, doc, module_doc, file_doc)

Make a wikilink to a module, function, or table

Parameters

  • symbol: Name of the module, function or table
  • doc: Documentation table
  • module_doc: Modules table
  • file_doc: Files table

Return value:

Wikilink string for the module, function, or table