aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2023-03-20 14:48:16 +0100
committerAlbert Krewinkel <[email protected]>2023-03-20 16:06:18 +0100
commit936f44d46013bb70e693a5f2947aae097cb48b5f (patch)
treee8f577369bf8716d8d2910c3abc13aef29e208a3
parented5197f5258fa52de7676980799ddc47fa4f2278 (diff)
lua-filters: auto-generate docs for `pandoc.text` module.
-rw-r--r--cabal.project6
-rw-r--r--doc/lua-filters.md134
2 files changed, 122 insertions, 18 deletions
diff --git a/cabal.project b/cabal.project
index d5afefaa6..0c8050cbc 100644
--- a/cabal.project
+++ b/cabal.project
@@ -6,3 +6,9 @@ tests: True
flags: +embed_data_files
constraints: skylighting-format-blaze-html >= 0.1.1,
skylighting-format-context >= 0.1.0.2
+
+source-repository-package
+ type: git
+ location: https://github.com/hslua/hslua
+ tag: dd06f7b54440ba2e8f5ddd4afd7fde85abdf4bc0
+ subdir: hslua-module-text
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 2cc11032b..60fb96ab3 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -5763,6 +5763,8 @@ AST elements (table)
<!-- END: AUTOGENERATED CONTENT -->
+<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.text -->
+
# Module pandoc.text
UTF-8 aware text manipulation functions, implemented in Haskell.
@@ -5778,52 +5780,115 @@ function Str (s)
end
```
-### fromencoding {#text.fromencoding}
+## Functions {#pandoc.text-functions}
+
+### fromencoding {#pandoc.text.fromencoding}
-`fromencoding(s, encoding)`
+`fromencoding (s[, encoding])`
Converts a string to UTF-8. The `encoding` parameter specifies the
encoding of the input string. On Windows, that parameter defaults
to the current ANSI code page; on other platforms the function
will try to use the file system's encoding.
-See [`toencoding`](#text.toencoding) for more info on supported
-encodings.
+The set of known encodings is system dependent, but includes at
+least `UTF-8`, `UTF-16BE`, `UTF-16LE`, `UTF-32BE`, and `UTF-32LE`.
+Note that the default code page on Windows is available through
+`CP0`.
+
+Parameters:
+
+`s`
+: string to be converted (string)
+
+`encoding`
+: target encoding (string)
+
+Returns:
+
+- UTF-8 string (string)
+
+*Since: 3.0*
+
+### len {#pandoc.text.len}
+
+`len (s)`
-### lower {#text.lower}
+Returns the length of a UTF-8 string, i.e., the number of
+characters.
+
+Parameters:
+
+`s`
+: UTF-8 encoded string (string)
+
+Returns:
+
+- length ([integer]{unknown-type="integer"}\|string)
+
+*Since: 2.0.3*
+
+### lower {#pandoc.text.lower}
`lower (s)`
Returns a copy of a UTF-8 string, converted to lowercase.
-### upper {#text.upper}
+Parameters:
-`upper (s)`
+`s`
+: UTF-8 string to convert to lowercase (string)
-Returns a copy of a UTF-8 string, converted to uppercase.
+Returns:
+
+- Lowercase copy of `s` (string)
-### reverse {#text.reverse}
+*Since: 2.0.3*
+
+### reverse {#pandoc.text.reverse}
`reverse (s)`
Returns a copy of a UTF-8 string, with characters reversed.
-### len {#text.len}
+Parameters:
+
+`s`
+: UTF-8 string to revert (string)
-`len (s)`
+Returns:
+
+- Reversed `s` (string)
+
+*Since: 2.0.3*
+
+### sub {#pandoc.text.sub}
+
+`sub (s, i[, j])`
+
+Returns a substring of a UTF-8 string, using Lua's string indexing
+rules.
+
+Parameters:
+
+`s`
+: UTF-8 string (string)
-Returns the length of a UTF-8 string.
+`i`
+: substring start position ([integer]{unknown-type="integer"})
+
+`j`
+: substring end position ([integer]{unknown-type="integer"})
-### sub {#text.sub}
+Returns:
-`sub (s)`
+- text substring (string)
-Returns a substring of a UTF-8 string, using Lua's string
-indexing rules.
+*Since: 2.0.3*
-### toencoding {#text.toencoding}
+### toencoding {#pandoc.text.toencoding}
-`toencoding(s, encoding)`
+`toencoding (s[, enc])`
Converts a UTF-8 string to a different encoding. The `encoding`
parameter defaults to the current ANSI code page on Windows; on
@@ -5834,6 +5899,39 @@ least `UTF-8`, `UTF-16BE`, `UTF-16LE`, `UTF-32BE`, and `UTF-32LE`.
Note that the default code page on Windows is available through
`CP0`.
+Parameters:
+
+`s`
+: UTF-8 string (string)
+
+`enc`
+: target encoding (string)
+
+Returns:
+
+- re-encoded string (string)
+
+*Since: 3.0*
+
+### upper {#pandoc.text.upper}
+
+`upper (s)`
+
+Returns a copy of a UTF-8 string, converted to uppercase.
+
+Parameters:
+
+`s`
+: UTF-8 string to convert to uppercase (string)
+
+Returns:
+
+- Uppercase copy of `s` (string)
+
+*Since: 2.0.3*
+
+<!-- END: AUTOGENERATED CONTENT -->
+
# Module pandoc.template
Handle pandoc templates.