aboutsummaryrefslogtreecommitdiff
path: root/doc/lua-filters.md
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-11-18 13:40:47 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-11-18 13:40:47 -0800
commit47e74742a86ced0098626202bd9a0faccf18f17d (patch)
tree30c29d5da88e5edbf2ad07e3eb8656cc96b8a998 /doc/lua-filters.md
parent17f6621b21fa9c5b64f58e4da38a3ce53b50f7b9 (diff)
downloadpandoc-47e74742a86ced0098626202bd9a0faccf18f17d.tar.gz
Documented text module for lua-filters.
See #4077.
Diffstat (limited to 'doc/lua-filters.md')
-rw-r--r--doc/lua-filters.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 35610cea3..03f198aaa 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -478,6 +478,43 @@ function CodeBlock(block)
end
```
+# Module text
+
+UTF-8 aware text manipulation functions, implemented in Haskell.
+These are available to any lua filter. However, the module must
+be explicitly loaded:
+
+```lua
+-- uppercase all regular text in a document:
+text = require 'text'
+function Str (s)
+ s.text = text.upper(s.text)
+ return s
+end
+```
+
+[`lower (s)`]{#text-lower}
+
+: Returns a copy of a UTF-8 string, converted to lowercase.
+
+[`upper (s)`]{#text-upper}
+
+: Returns a copy of a UTF-8 string, converted to uppercase.
+
+[`reverse (s)`]{#text-reverse}
+
+: Returns a copy of a UTF-8 string, with characters reversed.
+
+[`len (s)`]{#text-len}
+
+: Returns the length of a UTF-8 string.
+
+[`sub (s)`]{#text-sub}
+
+: Returns a substring of a UTF-8 string, using lua's string
+ indexing rules.
+
+
# Module pandoc
Lua functions for pandoc scripts.