Commits

Anonymous committed 17e3bed

thirdparty mtx scripts now required to carry “t-” prefix

Comments (0)

Files changed (2)

mtx-acceptor.lua

-#!/usr/bin/env mtxrun
---
---------------------------------------------------------------------------------
---         FILE:  mtx-acceptor.lua
---        USAGE:  mtxrun --script acceptor --if="input file name"
---  DESCRIPTION:  context script interface for the Acceptor module
--- REQUIREMENTS:  latest ConTeXt MkIV
---       AUTHOR:  Philipp Gesang (Phg), <gesang@stud.uni-heidelberg.de>
---      CREATED:  2011-09-08 20:43:08+0200
---------------------------------------------------------------------------------
---
-
-environment.loadluafile("acceptor-main")
-
-local acceptor = thirddata.acceptor
-local globals  = thirddata.globals
-
-acceptor.__script = true
-scripts           = scripts or { }
-scripts.acceptor  = { }
-local ea          = environment.argument
-
-local helpinfo = [[
-===============================================================
-    The Acceptor module, command line interface.
-    © 2011 Philipp Gesang. License: 2-clause BSD.
-    Home: <https://bitbucket.org/phg/acceptor/>
-===============================================================
-
-USAGE:
-
-    mtxrun --script acceptor [--if="filename"] | [--a="Article Name]
-                             [--lang="language"]
-                             [--comment="comment_parm"]
-                             [--no-img-download]
-
-Assignments
-~~~~~~~~~~~
-
-    “filename”:         **local** file to process
-                        
-    “Article Name”:     remote Article name
-                        
-    “language”:         which WP server to use
-                        
-    “tmp”:              name of temporary directory (subdir of $PWD)
-                        
-    “comment”:          “ignore”, “insert” or “stdout”: how to handle
-                        commented text (warning: “insert” may break
-                        things badly!
-
-Switches
-~~~~~~~~
-
-    --no-img-download   skip downloading images
-
-    --overwrite         forces downloading of article if local
-                        copy exists
-
-===============================================================
-]]
-
-local application = logs.application {
-  name     = "mtx-acceptor",
-  banner   = "The Acceptor Module for ConTeXt, checkout from hg",
-  helpinfo = helpinfo,
-}
-
-scripts.acceptor.input        = ea"if"
-scripts.acceptor.output       = ea"of" or "stdout"
-scripts.acceptor.article_name = ea"a"
-
-local parameters = {
-  input           = nil,         -- file | web
-  no_img_download = ea"no-img-download",
-  language        = ea"lang",
-  output          = scripts.acceptor.output,
-  overwrite       = ea"overwrite",
-  target          = nil,         -- article name or file name
-  tmp_dir         = ea"tmp",
-  comment         = ea"comment",
-}
-if scripts.acceptor.input then
-  parameters.input  = "file"
-  parameters.target = scripts.acceptor.input
-elseif scripts.acceptor.article_name then
-  parameters.target = scripts.acceptor.article_name
-  parameters.input  = "web"
-else
-  application.help()
-  os.exit()
-end
-
-acceptor.main(parameters)

mtx-t-acceptor.lua

+#!/usr/bin/env mtxrun
+--
+--------------------------------------------------------------------------------
+--         FILE:  mtx-acceptor.lua
+--        USAGE:  mtxrun --script acceptor --if="input file name"
+--  DESCRIPTION:  context script interface for the Acceptor module
+-- REQUIREMENTS:  latest ConTeXt MkIV
+--       AUTHOR:  Philipp Gesang (Phg), <gesang@stud.uni-heidelberg.de>
+--      CREATED:  2011-09-08 20:43:08+0200
+--------------------------------------------------------------------------------
+--
+
+environment.loadluafile("acceptor-main")
+
+local acceptor = thirddata.acceptor
+local globals  = thirddata.globals
+
+acceptor.__script = true
+scripts           = scripts or { }
+scripts.acceptor  = { }
+local ea          = environment.argument
+
+local helpinfo = [[
+===============================================================
+    The Acceptor module, command line interface.
+    © 2011 Philipp Gesang. License: 2-clause BSD.
+    Home: <https://bitbucket.org/phg/acceptor/>
+===============================================================
+
+USAGE:
+
+    mtxrun --script acceptor [--if="filename"] | [--a="Article Name]
+                             [--lang="language"]
+                             [--comment="comment_parm"]
+                             [--no-img-download]
+
+Assignments
+~~~~~~~~~~~
+
+    “filename”:         **local** file to process
+                        
+    “Article Name”:     remote Article name
+                        
+    “language”:         which WP server to use
+                        
+    “tmp”:              name of temporary directory (subdir of $PWD)
+                        
+    “comment”:          “ignore”, “insert” or “stdout”: how to handle
+                        commented text (warning: “insert” may break
+                        things badly!
+
+Switches
+~~~~~~~~
+
+    --no-img-download   skip downloading images
+
+    --overwrite         forces downloading of article if local
+                        copy exists
+
+===============================================================
+]]
+
+local application = logs.application {
+  name     = "mtx-acceptor",
+  banner   = "The Acceptor Module for ConTeXt, checkout from hg",
+  helpinfo = helpinfo,
+}
+
+scripts.acceptor.input        = ea"if"
+scripts.acceptor.output       = ea"of" or "stdout"
+scripts.acceptor.article_name = ea"a"
+
+local parameters = {
+  input           = nil,         -- file | web
+  no_img_download = ea"no-img-download",
+  language        = ea"lang",
+  output          = scripts.acceptor.output,
+  overwrite       = ea"overwrite",
+  target          = nil,         -- article name or file name
+  tmp_dir         = ea"tmp",
+  comment         = ea"comment",
+}
+if scripts.acceptor.input then
+  parameters.input  = "file"
+  parameters.target = scripts.acceptor.input
+elseif scripts.acceptor.article_name then
+  parameters.target = scripts.acceptor.article_name
+  parameters.input  = "web"
+else
+  application.help()
+  os.exit()
+end
+
+acceptor.main(parameters)