lua-filters: Move docs from module text to pandoc.text

The latter is easier to use and more consistent with the other modules.
This commit is contained in:
Albert Krewinkel
2023-03-20 09:15:56 +01:00
parent a53a6edfa5
commit 4e2949ceca
+71 -71
View File
@@ -2490,77 +2490,6 @@ Fields:
`toc`
: table of contents information (table)
# Module text
UTF-8 aware text manipulation functions, implemented in Haskell.
The module is made available as part of the `pandoc` module via
`pandoc.text`. The text module can also be loaded explicitly:
``` lua
-- uppercase all regular text in a document:
text = require 'text'
function Str (s)
s.text = text.upper(s.text)
return s
end
```
### fromencoding {#text.fromencoding}
`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.
### lower {#text.lower}
`lower (s)`
Returns a copy of a UTF-8 string, converted to lowercase.
### upper {#text.upper}
`upper (s)`
Returns a copy of a UTF-8 string, converted to uppercase.
### reverse {#text.reverse}
`reverse (s)`
Returns a copy of a UTF-8 string, with characters reversed.
### len {#text.len}
`len (s)`
Returns the length of a UTF-8 string.
### sub {#text.sub}
`sub (s)`
Returns a substring of a UTF-8 string, using Lua's string
indexing rules.
### toencoding {#text.toencoding}
`toencoding(s, encoding)`
Converts a UTF-8 string to a different encoding. The `encoding`
parameter defaults to the current ANSI code page on Windows; on
other platforms it will try to guess the file system's encoding.
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`.
# Module pandoc
Fields and functions for pandoc scripts; includes constructors for
@@ -5834,6 +5763,77 @@ AST elements (table)
<!-- END: AUTOGENERATED CONTENT -->
# Module pandoc.text
UTF-8 aware text manipulation functions, implemented in Haskell.
The text module can also be loaded under the name `text`, although
this is discouraged and deprecated.
``` lua
-- uppercase all regular text in a document:
function Str (s)
s.text = pandoc.text.upper(s.text)
return s
end
```
### fromencoding {#text.fromencoding}
`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.
### lower {#text.lower}
`lower (s)`
Returns a copy of a UTF-8 string, converted to lowercase.
### upper {#text.upper}
`upper (s)`
Returns a copy of a UTF-8 string, converted to uppercase.
### reverse {#text.reverse}
`reverse (s)`
Returns a copy of a UTF-8 string, with characters reversed.
### len {#text.len}
`len (s)`
Returns the length of a UTF-8 string.
### sub {#text.sub}
`sub (s)`
Returns a substring of a UTF-8 string, using Lua's string
indexing rules.
### toencoding {#text.toencoding}
`toencoding(s, encoding)`
Converts a UTF-8 string to a different encoding. The `encoding`
parameter defaults to the current ANSI code page on Windows; on
other platforms it will try to guess the file system's encoding.
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`.
# Module pandoc.template
Handle pandoc templates.