From 2c209c39b83d031fe01d39a5f1da7d996aa4db97 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 3 Oct 2011 10:59:28 +0200 Subject: =?UTF-8?q?thirdparty=20mtx=20scripts=20required=20to=20carry=20?= =?UTF-8?q?=E2=80=9Ct-=E2=80=9D=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third/transliterator/mtx-t-transliterate.lua | 64 ++++++++++++++++++++++ .../lua/third/transliterator/mtx-transliterate.lua | 64 ---------------------- 2 files changed, 64 insertions(+), 64 deletions(-) create mode 100644 scripts/context/lua/third/transliterator/mtx-t-transliterate.lua delete mode 100644 scripts/context/lua/third/transliterator/mtx-transliterate.lua (limited to 'scripts') diff --git a/scripts/context/lua/third/transliterator/mtx-t-transliterate.lua b/scripts/context/lua/third/transliterator/mtx-t-transliterate.lua new file mode 100644 index 0000000..a6e3968 --- /dev/null +++ b/scripts/context/lua/third/transliterator/mtx-t-transliterate.lua @@ -0,0 +1,64 @@ +-- +-------------------------------------------------------------------------------- +-- FILE: mtx-transliterate.lua +-- USAGE: mtxrun --script transliterate [--mode=mode] --s="string" +-- DESCRIPTION: context script interface for the Transliterator module +-- REQUIREMENTS: latest ConTeXt MkIV +-- AUTHOR: Philipp Gesang (Phg), +-- CREATED: 2011-06-11T16:14:16+0200 +-------------------------------------------------------------------------------- +-- + +environment.loadluafile("transliterator") + +local translit = thirddata.translit + +translit.__script = true +scripts = scripts or { } +scripts.transliterate = { } +local ea = environment.argument + +local helpinfo = [[ +=============================================================== + The Transliterator module, command line interface. + © 2010--2011 Philipp Gesang. License: 2-clause BSD. + Home: +=============================================================== + +USAGE: + + mtxrun --script transliterate [--mode=mode] --s="target" + + Where “target” is the target string to be transliterated. + Optionally, a transliteration mode can be specified (see + the respective descriptions in transliterator.pdf). The + “mode” defaults to “ru_old”. + +=============================================================== +]] + +local application = logs.application { + name = "mtx-transliterate", + banner = "The Transliterator for ConTeXt, hg-rev 38+", + helpinfo = helpinfo, +} + +scripts.transliterate.input = ea("s") +scripts.transliterate.out = function (sin, sout) + if ea("silent") then + io.write(sout) + else + io.write(string.format("\n“%s” -> “%s”\n", sin, sout)) + end +end + +if scripts.transliterate.input then + local mode = ea("mode") or "ru_old" + scripts.transliterate.out( + scripts.transliterate.input, + translit.transliterate(mode, ea("s")) + ) +else + application.help() +end + diff --git a/scripts/context/lua/third/transliterator/mtx-transliterate.lua b/scripts/context/lua/third/transliterator/mtx-transliterate.lua deleted file mode 100644 index a6e3968..0000000 --- a/scripts/context/lua/third/transliterator/mtx-transliterate.lua +++ /dev/null @@ -1,64 +0,0 @@ --- --------------------------------------------------------------------------------- --- FILE: mtx-transliterate.lua --- USAGE: mtxrun --script transliterate [--mode=mode] --s="string" --- DESCRIPTION: context script interface for the Transliterator module --- REQUIREMENTS: latest ConTeXt MkIV --- AUTHOR: Philipp Gesang (Phg), --- CREATED: 2011-06-11T16:14:16+0200 --------------------------------------------------------------------------------- --- - -environment.loadluafile("transliterator") - -local translit = thirddata.translit - -translit.__script = true -scripts = scripts or { } -scripts.transliterate = { } -local ea = environment.argument - -local helpinfo = [[ -=============================================================== - The Transliterator module, command line interface. - © 2010--2011 Philipp Gesang. License: 2-clause BSD. - Home: -=============================================================== - -USAGE: - - mtxrun --script transliterate [--mode=mode] --s="target" - - Where “target” is the target string to be transliterated. - Optionally, a transliteration mode can be specified (see - the respective descriptions in transliterator.pdf). The - “mode” defaults to “ru_old”. - -=============================================================== -]] - -local application = logs.application { - name = "mtx-transliterate", - banner = "The Transliterator for ConTeXt, hg-rev 38+", - helpinfo = helpinfo, -} - -scripts.transliterate.input = ea("s") -scripts.transliterate.out = function (sin, sout) - if ea("silent") then - io.write(sout) - else - io.write(string.format("\n“%s” -> “%s”\n", sin, sout)) - end -end - -if scripts.transliterate.input then - local mode = ea("mode") or "ru_old" - scripts.transliterate.out( - scripts.transliterate.input, - translit.transliterate(mode, ea("s")) - ) -else - application.help() -end - -- cgit v1.2.3