Difference between revisions of "Lua"
(anything I forgot?) |
m |
||
(11 intermediate revisions by 5 users not shown) | |||
Line 15: | Line 15: | ||
=Documentation Links= | =Documentation Links= | ||
==General== | ==General== | ||
− | * ''Recommended reading'': current [http://www.luatex.org/svn/trunk/manual/luatexref-t.pdf Luatex manual | + | * ''Recommended reading'': current [http://www.luatex.org/svn/trunk/manual/luatexref-t.pdf Luatex manual]; |
* Luatex [http://tug.org/pipermail/luatex/ mailing list]; | * Luatex [http://tug.org/pipermail/luatex/ mailing list]; | ||
* Metalink to all [[:Category:Lua|Lua]] topics; | * Metalink to all [[:Category:Lua|Lua]] topics; | ||
Line 23: | Line 23: | ||
* [[Programming_in_LuaTeX|Introduction]] to Context’s interface to Lua; | * [[Programming_in_LuaTeX|Introduction]] to Context’s interface to Lua; | ||
* official [http://www.lua.org/docs.html Lua docs]; | * official [http://www.lua.org/docs.html Lua docs]; | ||
− | * [[ | + | * the [http://wiki.luatex.org/index.php/Main_Page Luatex Wiki]; |
+ | * [[CLD|Context Lua Documents]]; | ||
+ | * [[Running Lua Code Externally]]. | ||
==ConTeXt Lua Extensions== | ==ConTeXt Lua Extensions== | ||
Line 37: | Line 39: | ||
! style="background:#addeff;" | File !! Content | ! style="background:#addeff;" | File !! Content | ||
<!--|---> | <!--|---> | ||
− | <!--| | + | <!--|{{src|l-aux.lua}} || only intermediary--> |
|- | |- | ||
− | | | + | |{{src|l-boolean.lua|l-boolean.lua}}|| <tt>toboolean()</tt> – equivalent of <tt>tonumber()</tt> and <tt>tostring()</tt>; |
|- | |- | ||
− | | | + | |{{src|util-dim.lua|util-dim.lua}} || Tex dimensions (accessible as ''number.*'' namespace); |
|- | |- | ||
− | | | + | |{{src|l-dir.lua|l-dir.lua}} || directory handling (globbing &c., namespace: ''dir.*''); |
|- | |- | ||
− | | | + | |{{src|l-file.lua|l-file.lua}} || filesystem related functions (namespace: ''file.*''); |
|- | |- | ||
− | | | + | |{{src|l-io.lua|l-io.lua}} || [[Extensions_to_the_Lua_I/O_library|file/stream handling]]; |
|- | |- | ||
− | | | + | |{{src|l-lpeg.lua|l-lpeg.lua}} || [[String_manipulation#l-lpeg.lua|pattern helpers]]; |
|- | |- | ||
− | | | + | |{{src|l-math.lua|l-math.lua}} || extra functions for the Lua ''math'' library; |
|- | |- | ||
− | | | + | |{{src|l-md5.lua|l-md5.lua}} || checksum comparison, loading and saving; |
|- | |- | ||
− | | | + | |{{src|l-number.lua|l-number.lua}} || additions to the ''number.*'' namespace – bitset handling; |
|- | |- | ||
− | | | + | |{{src|l-os.lua|l-os.lua}} || additions to the ''os.*'' library, platform initialization; |
|- | |- | ||
− | | | + | |{{src|l-pdfview.lua|l-pdfview.lua}}|| <tt>--autopdf</tt> handling of ''mtxrun''; |
|- | |- | ||
− | | | + | |{{src|l-set.lua|l-set.lua}} || set handling (''set.*'' namespace); |
|- | |- | ||
− | | | + | |{{src|l-string.lua|l-string.lua}} || [[String_manipulation#l-string.lua|string manipulation]]; |
|- | |- | ||
− | | | + | |{{src|l-table.lua|l-table.lua}} || [[Table manipulation]]; |
|- | |- | ||
− | | | + | |{{src|l-unicode.lua|l-unicode.lua}}|| extensions to the ''sln-unicode'' lib, converters for character encodings; |
|- | |- | ||
− | | | + | |{{src|l-url.lua|l-url.lua}} || URI matching (namespace: ''url.*''; also a nice tutorial on lpeg). |
− | <!--| | + | <!--|{{src|l-utils.lua|l-utils.lua}} || only intermediary--> |
− | <!--| | + | <!--|{{src|l-xml.lua|l-xml.lua}} || only intermediary--> |
|+ style="font-style:italic; font-size:83.3333%;" | Lua Library Extensions. | |+ style="font-style:italic; font-size:83.3333%;" | Lua Library Extensions. | ||
|} | |} | ||
Line 90: | Line 92: | ||
* http://keplerproject.github.com/luafilesystem/ – Luafs; | * http://keplerproject.github.com/luafilesystem/ – Luafs; | ||
* http://www.keplerproject.org/md5/ – Lua-md5; | * http://www.keplerproject.org/md5/ – Lua-md5; | ||
− | * http://w3.impa.br/~diego/software/luasocket/ – LuaSocket. | + | * http://w3.impa.br/~diego/software/luasocket/ – LuaSocket; |
+ | * http://luaforge.net/projects/sln/ – Slnunicode; | ||
+ | * http://luaforge.net/projects/lzlib/ – Lua-Zlib. | ||
==Miscellanea== | ==Miscellanea== | ||
* Context may please everyone, but still it can’t hurt to occasionally visit the [http://news.gmane.org/gmane.comp.tex.lualatex.devel lualatex mailing list]. | * Context may please everyone, but still it can’t hurt to occasionally visit the [http://news.gmane.org/gmane.comp.tex.lualatex.devel lualatex mailing list]. | ||
− | + | <!-- vim:fo=cot:tw=65:sw=2:ts=2 --> | |
− | |||
− | + | [[Category:Programming and Databases]] |
Latest revision as of 19:23, 8 June 2020
Contents
Introduction
MkIV is the current branch of the Context typesetting environment. As its underlying engine is supposed to be Luatex, MkIV is to a large extent implemented in Lua, as opposed to the legacy MkII which was written for Pdftex and Xetex as target engines.
As of now, documentation on the Lua guts of Context is somewhat rare. The definite guide is still the source code itself which, unfortunately, tends to be undercommented in many places. This portal-like wiki page is meant to gather links to existing documentation on Lua programming for Context/Luatex.
Documentation Links
General
- Recommended reading: current Luatex manual;
- Luatex mailing list;
- Metalink to all Lua topics;
- Some additional pointers may be found browsing Luatex.
Programming
- Introduction to Context’s interface to Lua;
- official Lua docs;
- the Luatex Wiki;
- Context Lua Documents;
- Running Lua Code Externally.
ConTeXt Lua Extensions
Context MkIV extends the vanilla Lua libraries by some very useful functionality. This pertains mostly to stuff people tend to implement over and over again because it is provided by default with other scripting languages. Thus, before you reimplement, say, a string stripping function for the thousandth time – have a look at these files:
File | Content |
---|---|
l-boolean.lua | toboolean() – equivalent of tonumber() and tostring(); |
util-dim.lua | Tex dimensions (accessible as number.* namespace); |
l-dir.lua | directory handling (globbing &c., namespace: dir.*); |
l-file.lua | filesystem related functions (namespace: file.*); |
l-io.lua | file/stream handling; |
l-lpeg.lua | pattern helpers; |
l-math.lua | extra functions for the Lua math library; |
l-md5.lua | checksum comparison, loading and saving; |
l-number.lua | additions to the number.* namespace – bitset handling; |
l-os.lua | additions to the os.* library, platform initialization; |
l-pdfview.lua | --autopdf handling of mtxrun; |
l-set.lua | set handling (set.* namespace); |
l-string.lua | string manipulation; |
l-table.lua | Table manipulation; |
l-unicode.lua | extensions to the sln-unicode lib, converters for character encodings; |
l-url.lua | URI matching (namespace: url.*; also a nice tutorial on lpeg). |
Further Links
Places worth a visit when hunting for answers.
General
- http://www.luatex.org – the Luatex homepage;
- http://www.lua.org – the Lua homepage;
- http://www.ntg.nl/pipermail/ntg-context/ – the Context list archives;
- http://lua-users.org/lists/lua-l – lua-l, the Lua list;
- http://tex.stackexchange.com – some Questions might be answered here;
- [DE] http://www.luatex.de – Patrick’s blog.
Luatex Libs
- http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html – Roberto’s lpeg-page;
- http://www.keplerproject.org/luazip/ – Luazip;
- http://keplerproject.github.com/luafilesystem/ – Luafs;
- http://www.keplerproject.org/md5/ – Lua-md5;
- http://w3.impa.br/~diego/software/luasocket/ – LuaSocket;
- http://luaforge.net/projects/sln/ – Slnunicode;
- http://luaforge.net/projects/lzlib/ – Lua-Zlib.
Miscellanea
- Context may please everyone, but still it can’t hurt to occasionally visit the lualatex mailing list.