summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rst_parser.lua53
1 files changed, 27 insertions, 26 deletions
diff --git a/src/rst_parser.lua b/src/rst_parser.lua
index e633899..4fc36cf 100644
--- a/src/rst_parser.lua
+++ b/src/rst_parser.lua
@@ -5,10 +5,31 @@
-- DESCRIPTION: https://bitbucket.org/phg/context-rst/overview
-- AUTHOR: Philipp Gesang (Phg), <phg42.2a@gmail.com>
-- VERSION: 0.6
--- CHANGED: 2014-02-28 06:49:01+0100
+-- CHANGED: 2014-03-02 14:25:57+0100
--------------------------------------------------------------------------------
--
+local usage_info = [[
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ rstConTeXt
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Functionality has been moved, the reST converter can now be
+accessed via mtxrun:
+
+ $mtxrun --script rst
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+]]
+
+local main = function ()
+ io.write("\n"..usage_info.."\n")
+ return -1
+end
+
+if not (context or scripts) then
+ return main()
+end
thirddata = thirddata or { }
thirddata.rst = { }
@@ -41,6 +62,9 @@ local stringmatch = string.match
local stringstrip = string.strip
local stringsub = string.sub
local utflen = utf.len
+local select = select
+
+local context = context
local warn
do
@@ -51,9 +75,8 @@ do
local slen = #str + 3
--str = "*["..str.."]"
str = stringformat("*[%4d][%s]", ndebug, str)
- local arglst = { ... }
- for i=1, #arglst do
- local current = arglst[i]
+ for i=1, select ("#", ...) do
+ local current = select (i, ...)
if 80 - i * 8 - slen < 0 then
local indent = ""
for i=1, slen do
@@ -1580,26 +1603,4 @@ function thirddata.rst.do_rst_snippet(txt)
end
end
-local usage_info = [[
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- rstConTeXt
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Functionality has been moved, the reST converter can now be
-accessed via mtxrun:
-
- $mtxrun --script rst
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-]]
-
-local function main()
- iowrite("\n"..usage_info.."\n")
- return -1
-end
-
-if not (context or scripts) then
- return main()
-end
-
--- vim:tw=79:et:sw=4:ts=8:sts=4