Feel free to contribute to the project. To contribute, fork the repository, commit your changes and send a pull request.


A new function requires a unique name and consists of three parts, the code, a documentation and a test.

The Name

Function names are written in lower case A function name consisting of multiple words will just be connected like the functions in the the standard Lua library, for example getmetatable. All three files use the same filename with a different extension.


It is just a Lua module file that returns a function. We use just .lua as the extension. The Function must have a function tag one line above the function. The tag is a comment that has ZFUNC-prefix, function name and the version of the function. If external packages are used is it required to tag them with a ZREQ-prefix and package name.

local lfs = require( "lfs" ) --ZREQ-lfs
local function isfile( path ) --> res
   local attr = lfs.attributes( path )
   if attr.mode == "file" then return true
   else return false end

return isfile


The Documentation must be written in asciidoc. We use the .adoc as the file extension for the documentation file. Just check the example to see more rules.

= examplefunc
function examplefunc( par1, par2 [, optpar] ) --> res1, res2

== Description

A short or long description for the function.
Mark parameters and return values in italic, like _par1_ or _res1_.
Lua keywords like *nil*, *true* or *nil* are bold.
Each parameter and return value will be mentioned in a labeled list.

== Parameters

Information for the first parameter of the function.

Information for the second parameter of the function.

Some information for the optional parameter, like the default value.

== Return Values

The first return parameter.

The second return parameter.

== Code


== Examples


== Inspired by

*[C++ vecter::insert]
*[PHP levenshtein]
*[Lodash slice]

== See also

* link:otherfunc.html[otherfunc]


Tests are Lua scripts that include the function module and are using tapered. The code is also an example that will be used for tests. The first test has the extension .ex1.lua, all other test increment the number in the extension.

local t = require( "tapered" )
local {{func}} = require( "{{func}}" )
-- util functions
local otherfunc = require( "otherfunc" )
-- setup
-- test
t.nok( true )
-- teardown

With the help of lzt and tappy is it easy to test all functions. Just run the following commands in the project root directory:

$ lzt luapath >
$ lzt testenv >
$ . setluapath
$ .
$ tappy *.tap