anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit 522e9be2ec23fd4fc4e168851a834822a2160b3f
parent a5116690f44b859227aa2b45d73a564e68547923
Author: uriel@vm41.cat-v.org <unknown>
Date:   Tue, 20 Oct 2009 02:09:21 +0200

Merge updates from 'stable'.
Aapps/wman/search.tpl | 20++++++++++++++++++++
Msites/default.cat-v.org/_werc/lib/footer.inc | 7+++++--
Msites/default.cat-v.org/_werc/lib/headers.inc | 4++++
Msites/default.cat-v.org/_werc/lib/top_bar.inc | 10+++++++---
Asites/werc.cat-v.org/apps/_footer.md | 10++++++++++
Asites/werc.cat-v.org/apps/_header.md | 5+++++
Msites/werc.cat-v.org/apps/dirdir/index.md | 14+++++++++++---
Asites/werc.cat-v.org/docs/dir_listings.md | 29+++++++++++++++++++++++++++++
Msites/werc.cat-v.org/docs/rc_template_lang.md | 5+++++
Asites/werc.cat-v.org/docs/web_server_setup/_header.md | 16++++++++++++++++
Msites/werc.cat-v.org/index.md | 14+++++++++++---
Msites/werc.cat-v.org/wiki/_werc/config | 2+-
12 files changed, 124 insertions(+), 12 deletions(-)

diff --git a/apps/wman/search.tpl b/apps/wman/search.tpl @@ -0,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> + diff --git a/sites/default.cat-v.org/_werc/lib/footer.inc b/sites/default.cat-v.org/_werc/lib/footer.inc @@ -19,8 +19,11 @@ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "htt 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> diff --git 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> diff --git 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> | diff --git a/sites/werc.cat-v.org/apps/_footer.md b/sites/werc.cat-v.org/apps/_footer.md @@ -0,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. diff --git a/sites/werc.cat-v.org/apps/_header.md b/sites/werc.cat-v.org/apps/_header.md @@ -0,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. + diff --git a/sites/werc.cat-v.org/apps/dirdir/index.md b/sites/werc.cat-v.org/apps/dirdir/index.md @@ -6,7 +6,7 @@ taking advantage of its user, site management frameworks and other 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 @@ DirDir is still somewhat experimental, but already all features diri had, plus s * 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). diff --git a/sites/werc.cat-v.org/docs/dir_listings.md b/sites/werc.cat-v.org/docs/dir_listings.md @@ -0,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). diff --git 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 @@ Basic syntax: 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 -------- diff --git a/sites/werc.cat-v.org/docs/web_server_setup/_header.md b/sites/werc.cat-v.org/docs/web_server_setup/_header.md @@ -0,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). diff --git a/sites/werc.cat-v.org/index.md b/sites/werc.cat-v.org/index.md @@ -37,6 +37,10 @@ server with CGI support. 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 @@ Links * [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/). + +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. -(By default includes markdown.pl which has a different license, but this can be -replaced). Credits ------- diff --git a/sites/werc.cat-v.org/wiki/_werc/config b/sites/werc.cat-v.org/wiki/_werc/config @@ -1 +1 @@ -enable_wiki=yes +conf_enable_wiki