From aef9159b02ace4f23d607b1bf024e240e26c9399 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 3 Oct 2011 10:56:03 +0200 Subject: =?UTF-8?q?=E2=80=9Ct-=E2=80=9D=20prefix=20now=20required=20for=20?= =?UTF-8?q?thirdparty=20mtx=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mod/scripts/context/lua/third/rst/mtx-rst.lua | 64 ------------------------- mod/scripts/context/lua/third/rst/mtx-t-rst.lua | 64 +++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 64 deletions(-) delete mode 100644 mod/scripts/context/lua/third/rst/mtx-rst.lua create mode 100644 mod/scripts/context/lua/third/rst/mtx-t-rst.lua (limited to 'mod/scripts') diff --git a/mod/scripts/context/lua/third/rst/mtx-rst.lua b/mod/scripts/context/lua/third/rst/mtx-rst.lua deleted file mode 100644 index 08782a9..0000000 --- a/mod/scripts/context/lua/third/rst/mtx-rst.lua +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env texlua --------------------------------------------------------------------------------- --- FILE: mtx-rst.lua --- USAGE: mtxrun --script rst --if=input.rst --of=output.tex --- DESCRIPTION: context script interface for the reStructuredText module --- REQUIREMENTS: latest ConTeXt MkIV --- AUTHOR: Philipp Gesang (Phg), --- CREATED: 2011-08-28 12:43:49+0200 --------------------------------------------------------------------------------- --- - -scripts = scripts or { } -scripts.rst = { } - -environment.loadluafile("rst_parser") - -local ea = environment.argument - -local helpinfo = [[ -=============================================================== - The reStructuredText module, command line interface. - © 2010--2011 Philipp Gesang. License: 2-clause BSD. - Home: -=============================================================== - -USAGE: - - mtxrun --script rst --if=input.rst --of=output.tex - -Mandatory arguments: - - “infile.rst” is your input file containing reST markup. - “outfile.tex” is the target file that the TeX-code will be - written to. - -Optional arguments: - --et=bool “expandtab”, should tab chars (“\t”, “\v”) be - converted to spaces? - --sw=int “shiftwidth”, tab stop modulo factor. - -=============================================================== -]] - -local application = logs.application { - name = "mtx-rst", - banner = "The reStructuredText module for ConTeXt, hg-rev 125+", - helpinfo = helpinfo, -} - -scripts.rst.input = ea("if") -scripts.rst.output = ea("of") - -if scripts.rst.input and scripts.rst.output then - local expandtab = ea("et") == "true" and true - local shiftwidth = ea("sw") - local debug = ea("debug") == "true" - if expandtab then thirddata.rst.expandtab = true end - if shiftwdith then thirddata.rst.shiftwidth = tonumber(shiftwidth) end - if debug then thirddata.rst_helpers.rst_debug = debug end - thirddata.rst.standalone(scripts.rst.input, scripts.rst.output) -else - application.help() -end - diff --git a/mod/scripts/context/lua/third/rst/mtx-t-rst.lua b/mod/scripts/context/lua/third/rst/mtx-t-rst.lua new file mode 100644 index 0000000..08782a9 --- /dev/null +++ b/mod/scripts/context/lua/third/rst/mtx-t-rst.lua @@ -0,0 +1,64 @@ +#!/usr/bin/env texlua +-------------------------------------------------------------------------------- +-- FILE: mtx-rst.lua +-- USAGE: mtxrun --script rst --if=input.rst --of=output.tex +-- DESCRIPTION: context script interface for the reStructuredText module +-- REQUIREMENTS: latest ConTeXt MkIV +-- AUTHOR: Philipp Gesang (Phg), +-- CREATED: 2011-08-28 12:43:49+0200 +-------------------------------------------------------------------------------- +-- + +scripts = scripts or { } +scripts.rst = { } + +environment.loadluafile("rst_parser") + +local ea = environment.argument + +local helpinfo = [[ +=============================================================== + The reStructuredText module, command line interface. + © 2010--2011 Philipp Gesang. License: 2-clause BSD. + Home: +=============================================================== + +USAGE: + + mtxrun --script rst --if=input.rst --of=output.tex + +Mandatory arguments: + + “infile.rst” is your input file containing reST markup. + “outfile.tex” is the target file that the TeX-code will be + written to. + +Optional arguments: + --et=bool “expandtab”, should tab chars (“\t”, “\v”) be + converted to spaces? + --sw=int “shiftwidth”, tab stop modulo factor. + +=============================================================== +]] + +local application = logs.application { + name = "mtx-rst", + banner = "The reStructuredText module for ConTeXt, hg-rev 125+", + helpinfo = helpinfo, +} + +scripts.rst.input = ea("if") +scripts.rst.output = ea("of") + +if scripts.rst.input and scripts.rst.output then + local expandtab = ea("et") == "true" and true + local shiftwidth = ea("sw") + local debug = ea("debug") == "true" + if expandtab then thirddata.rst.expandtab = true end + if shiftwdith then thirddata.rst.shiftwidth = tonumber(shiftwidth) end + if debug then thirddata.rst_helpers.rst_debug = debug end + thirddata.rst.standalone(scripts.rst.input, scripts.rst.output) +else + application.help() +end + -- cgit v1.2.3