[Surfraw-commits] [surfraw] 01/01: New elvis: nlab

jason ryan jasonwryan-guest at moszumanska.debian.org
Wed Jun 4 08:46:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

jasonwryan-guest pushed a commit to branch master
in repository surfraw.

commit e0ad6f0f228249895d11bc81139c8a64147a4739
Author: Jason Ryan <jasonwryan at gmail.com>
Date:   Wed Jun 4 20:46:23 2014 +1200

    New elvis: nlab
---
 elvi/nlab      | 29 +++++++++++++++++++++++++++++
 test/nlab.test |  2 ++
 2 files changed, 31 insertions(+)

diff --git a/elvi/nlab b/elvi/nlab
new file mode 100755
index 0000000..f35d72a
--- /dev/null
+++ b/elvi/nlab
@@ -0,0 +1,29 @@
+#!/bin/sh
+# elvis: nlab		-- Search the nLab Wiki (http://ncatlab.org)
+# author: jason ryan • http://jasonwryan.com
+
+. surfraw || exit 1
+
+w3_usage_hook () {
+    cat <<EOF
+Usage: $w3_argv0 [search terms]...
+Description:
+    Search the nLab Wiki (http://ncatlab.org)
+
+    Local options:
+    The nLab wiki search accepts regular expressions as search terms.                                   
+
+EOF
+    w3_global_usage
+}
+
+w3_config
+w3_parse_args "$@"
+
+# w3_args now contains a list of arguments
+if [ -z "$w3_args" ]; then
+    w3_browse_url "http://ncatlab.org/"
+else
+    escaped_args=$(w3_url_of_arg $w3_args)
+    w3_browse_url "http://ncatlab.org/nlab/search?&query=${escaped_args}"
+fi
diff --git a/test/nlab.test b/test/nlab.test
new file mode 100644
index 0000000..ad6ae74
--- /dev/null
+++ b/test/nlab.test
@@ -0,0 +1,2 @@
+nlab dirac
+Dirac induction

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/surfraw/surfraw.git



More information about the Surfraw-commits mailing list