swerc

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

commit 574dd98247379ad895a1749373eadbf075b0610c
parent 869167256d9dd5d6aa55dd981d4ee94270535b1b
Author: uriel@engel.se.cat-v.org <unknown>
Date:   Wed, 24 Dec 2008 12:18:44 +0100

New function to pick 'metadata' out of new .md convention for attributes.
Diffstat:
Mbin/cgilib.rc | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/bin/cgilib.rc b/bin/cgilib.rc @@ -279,6 +279,18 @@ fn app_handler { } +################################## +# Meta-data extract + +fn get_var { + if(! ~ $#* 2) { + status='ERROR: wrong get_var args >>' $* '<< instead of: get_var file-name var-name' + dprint $status + } + if not + sed -n '/^\* '$2': /p; /^\* '$2': /q; /^$/q' < $1 +} + #app_blog_methods = ( _post index.rss ) #fn app_blog__post { # echo