summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-12-23 11:53:26 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2017-12-23 13:42:35 +0100
commit35f0567a8fe840ca65f8474d0293942c76a1220f (patch)
tree7664aec1683cdec1fbf7696e449a8512978fd21a /doc
parentef4351c4d2dee9b392c80e439a3c0f0d60594a33 (diff)
Lua modules: add function pandoc.utils.to_roman_numeral
The function allows conversion of numbers below 4000 into roman numerals.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua-filters.md21
1 files changed, 18 insertions, 3 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 52d745ce8..4411e90a5 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -173,10 +173,11 @@ Some pandoc functions have been made available in lua:
documents;
- [`pipe`](#pipe) runs an external command with input from and
output to strings;
-- [`sha1`](#utils-sha1) generates a SHA1 hash;
- the [`pandoc.mediabag`](#module-pandoc.mediabag) module allows
access to the "mediabag," which stores binary content such as
- images that may be included in the final document.
+ images that may be included in the final document;
+- the [`pandoc.utils`](#module-pandoc.utils) module contains
+ various utility functions.
# Lua interpreter initialization
@@ -1456,9 +1457,23 @@ functions.
Usage:
local inline = pandoc.Emph{pandoc.Str 'Moin'}
- -- outputs "Moin"
+ -- outputs "Moin"
print(pandoc.utils.stringify(inline))
+[`to_roman_numeral (integer)`]{#utils-to_roman_numeral}
+
+: Converts an integer < 4000 to uppercase roman numeral.
+
+ Returns:
+
+ - A roman numeral string.
+
+ Usage:
+
+ local to_roman_numeral = pandoc.utils.to_roman_numeral
+ local pandoc_birth_year = to_roman_numeral(2006)
+ -- pandoc_birth_year == 'MMVI'
+
# Module pandoc.mediabag