shithub: werc

Download patch

ref: b9a1531ee8e6e352a0c6d9d40a9835bd92b82b93
parent: 3c92cc333311e7a98c31c5d56fad9b90c8f63823
parent: c24ede465e797fca71bf1acb4594ae55e4310ce2
author: uriel <[email protected]>
date: Mon Oct 19 22:09:21 EDT 2009

Merge updates from 'stable'.

--- /dev/null
+++ b/apps/wman/search.tpl
@@ -1,0 +1,20 @@
+<form action="" method="POST">
+<fieldset>
+    <input type="text" name="wman_search" value="%($"s%)" />
+    <input type="submit" name="go" value="Feel Lucky" />
+    <input type="submit" value="Search" />
+
+% if(! ~ $"post_arg_wman_search '') {
+%   if(~ $"wman_search_results '') {
+        No matches found for <i>'%($post_arg_wman_search%)'</i>.
+%   }
+%   if not {
+        <ul>
+%       echo $wman_search_results|awk -F/ '$(NF-1) ~ "^[0-9]+$" {printf "<li><a href=\"'$wman_base_uri'%s/%s\" />%s(%s)</a></li>", $(NF-1),$NF, $NF, $(NF-1)}'
+        </ul>
+%   }
+% }
+
+</fieldset>
+</form>
+
--- a/sites/default.cat-v.org/_werc/lib/footer.inc
+++ b/sites/default.cat-v.org/_werc/lib/footer.inc
@@ -19,8 +19,11 @@
 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
 </script>
 <script type="text/javascript">
+try {
 var pageTracker = _gat._getTracker("UA-1220719-1");
 pageTracker._setDomainName("cat-v.org");
-pageTracker._initData();
 pageTracker._trackPageview();
-</script>
+
+var pageTracker2 = _gat._getTracker("UA-1220719-12");
+pageTracker2._trackPageview();
+} catch(err) {}</script>
--- a/sites/default.cat-v.org/_werc/lib/headers.inc
+++ b/sites/default.cat-v.org/_werc/lib/headers.inc
@@ -1,3 +1,7 @@
 <meta name="verify-v1" content="6zEoK0WMlnLmIS/w7Pnh6+srZECHsvnMGN0kQmowSGk=" />
+<meta name="google-site-verification" content="z5zCyEitNLNZmhVblsogrEiy6Acf0UZROsFMtLjioN4" />
 <META name="y_key" content="49dff3fad5352458"><META name="y_key" content="5dc40bfee9494e98"><META name="y_key" content="b60a53d1fa98f4c8">
 <meta name="msvalidate.01" content="5008C6E6B172BEB1F43E770296C3D560" />
+<style>
+a { text-decoration: none!important; }
+</style>
--- a/sites/default.cat-v.org/_werc/lib/top_bar.inc
+++ b/sites/default.cat-v.org/_werc/lib/top_bar.inc
@@ -1,7 +1,11 @@
     <div class="left">
-      <a href="http://gsoc.cat-v.org">gsoc</a> |
-      <a href="http://doc.cat-v.org">doc archive</a> |
-      <a href="http://repo.cat-v.org">software repo</a> |
+      <a href="http://quotes.cat-v.org">quotes</a> |
+      <a href="http://doc.cat-v.org">docs</a> |
+      <a href="http://repo.cat-v.org">repo</a> |
+      <a href="http://sam.cat-v.org">sam</a> |
+      <a href="http://man.cat-v.org">man</a> |
+      <a href="http://acme.cat-v.org">acme</a> |
+      <a href="http://glenda.cat-v.org">Glenda</a> |
       <a href="http://ninetimes.cat-v.org">9times</a> |
       <a href="http://harmful.cat-v.org">harmful</a> |
       <a href="http://9p.cat-v.org/">9P</a> |
--- /dev/null
+++ b/sites/werc.cat-v.org/apps/_footer.md
@@ -1,0 +1,10 @@
+External Apps
+=============
+
+This are some apps developed by werc users, to install them put them in your werc's `apps/` dir and enable them from any config file as usual.
+
+* [Xibit](http://xibit.soul9.org/): an image gallery app by written by soul9.
+* [SMAK](http://www.anarchyinthetubes.com/hg/smak/): a "very simple" image gallery by yiyus.
+* [hgwerc](http://www.anarchyinthetubes.com/hg/hgwebdir.cgi/hgwerc/): a wrapper around the mercurial web interface to integrate it into werc sites, also by yiyus.
+* [scrappydog](http://code.google.com/p/scrappydog/): A werc based online scrapbook by maht.
+* [flip](http://www.anarchyinthetubes.com/hg/flip/): A web interface to view PDFs, by yiyus.
--- /dev/null
+++ b/sites/werc.cat-v.org/apps/_header.md
@@ -1,0 +1,5 @@
+Werc Apps
+=========
+
+Werc includes the following 'apps' by default that any site can enable usually by executing a function of the form `conf_enable_myapp` in any given `_werc/config` file.
+
--- a/sites/werc.cat-v.org/apps/dirdir/index.md
+++ b/sites/werc.cat-v.org/apps/dirdir/index.md
@@ -6,7 +6,7 @@
 infrastructure.  
 
 Features
-========
+--------
 
 DirDir is still somewhat experimental, but already all features diri had, plus some extras thanks to werc's power:
 
@@ -20,14 +20,22 @@
     * Implemented in about two dozen lines of rc scripts.
 
 
+Documentation
+-------------
+
+Just login, go to any page, and click the `Edit` button.
+
+To create a new page, go to the address where you want to create the new page, click `Edit`, enter the initial contents, `Save`, and you are done.
+
+
 Status
-======
+------
 
 Mostly usable, all basic features already implemented in the latest werc source
 tree. 
 
 About the name
-==============
+--------------
 
 DirDir is a pun on its predecessor diri and WikiWiki, and [Dirdir is also the title of a novel](http://www.amazon.com/gp/product/0879974788?ie=UTF8&tag=catv-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0879974788) by science fiction and literature grand master [Jack Vance](http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26redirect%3Dtrue%26search-type%3Dss%26index%3Dbooks%26ref%3Dntt%255Fathr%255Fdp%255Fsr%255F1%26field-author%3DJack%2520Vance&tag=catv-20&linkCode=ur2&camp=1789&creative=39095).
 
--- /dev/null
+++ b/sites/werc.cat-v.org/docs/dir_listings.md
@@ -1,0 +1,29 @@
+Autogenerated Directory Listings
+================================
+
+If a directory has no `index.md`, `index.html` or `index.txt` and has no other
+*main handler* set up by a [werc app](/apps/), the default directory listing
+handler is used.
+
+The default directory handler simply displays the path to the directory, and a
+list of links to all files and dirs located at this path.
+
+
+Header and footer
+-----------------
+
+If a `_header.md` or `_footer.md` files are found in the directory, their
+contents will be displayed in the corresponding sections before and after
+the directory contents.
+
+
+Tuning the item's order
+------------------------
+
+You can set the `dir_listing_ls_opts` config variable in the dir's corresponding _werc/config to change the way items will be ordered.
+
+For example to list items in reverse chronological order simply add:
+
+    dir_listing_ls_opts=( -t )
+
+The options taken are [the standard Plan 9 ls(1) flags](http://man.cat-v.org/plan_9/1/ls).
--- a/sites/werc.cat-v.org/docs/rc_template_lang.md
+++ b/sites/werc.cat-v.org/docs/rc_template_lang.md
@@ -11,6 +11,11 @@
 
 That is basically it!
 
+For further documentation on rc see:
+
+* [The rc(1) man page for Plan 9](http://man.cat-v.org/plan_9/1/rc).
+* [The rc shell paper by Tom Duff](http://rc.cat-v.org).
+
 
 Examples
 --------
--- /dev/null
+++ b/sites/werc.cat-v.org/docs/web_server_setup/_header.md
@@ -1,0 +1,16 @@
+Setting Up Your HTTP Server to Run Werc
+=======================================
+
+
+Werc should work with any web server that supports the CGI interface, and a few
+that don't. Here are collected instructions and sample configurations for some
+of the most popular HTTP servers that people has used with werc.
+
+In general setup consists of mapping all paths for a virtual host to the
+werc.rc script, usually in practice this means that the `document root` (or
+similar concept) for a virtual host is mapped to
+`/path/to/werc/sites/domain.name.com/`, and if no static file matches the
+request, control is handed to werc.rc, this allows the HTTP server to handle
+static files and werc to handle everything else (note that such a setup will
+expose your `_werc/config` files, which usually should not be a security
+issue).
--- a/sites/werc.cat-v.org/index.md
+++ b/sites/werc.cat-v.org/index.md
@@ -37,6 +37,10 @@
 Werc runs on any Unix-like system where [Plan 9 from User Space](http://plan9.us)
 is available (this includes Linux, *BSD, OS X and Solaris), and on Plan 9.
 
+If you use Debian you can install the `9base` package that will provide all the
+required commands (but at the moment you need to install the version in *sid*,
+older versions in stable lack some of the required programs)
+
 Werc can use any HTTP server that can handle CGI, and has been tested with at
 least Apache, Lighttpd, Cherokee, nhttpd, Hiawatha, and others.
 
@@ -72,13 +76,17 @@
 * [werc project at freshmeat](http://freshmeat.net/projects/werc/) - You can get new release notifications there.
 * [werc project at ohloh](https://www.ohloh.net/p/werc/)
 
+
 License
 -------
 
-Public domain, [because so called 'intellectual property' is an oxymoron](http://harmful.cat-v.org/economics/intellectual_property/).
+Public domain, [because so called 'intellectual property' is an
+oxymoron](http://harmful.cat-v.org/economics/intellectual_property/).
 
-(By default includes markdown.pl which has a different license, but this can be
-replaced).
+Alternatively if your prefer it or your country's brain dead copyright law
+doesn't recognize the public domain werc is made available under the terms of
+the MIT and ISC licenses.
+
 
 Credits
 -------
--- a/sites/werc.cat-v.org/wiki/_werc/config
+++ b/sites/werc.cat-v.org/wiki/_werc/config
@@ -1,1 +1,1 @@
-enable_wiki=yes
+conf_enable_wiki