chickadee » eggdoc-svnwiki

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

eggdoc-svnwiki

Render eggdoc source to an svnwiki page.

Overview

eggdoc-svnwiki produces svnwiki output for Chicken eggs from eggdoc SXML source.

Your eggdoc and you

eggdoc->svnwiki DOC #!optional STYLESHEETprocedure

Transform the SXML document DOC into svnwiki format using the optional SXSLT stylesheet STYLESHEET. If not specified, the built-in stylesheet will be used, which is also accessible with eggdoc:make-svnwiki-stylesheet.

eggdoc:make-svnwiki-stylesheet DOCprocedure

Returns the default SXSLT stylesheet, which transforms eggdoc input to svnwiki output. This is a procedure because the stylesheet is built dynamically using the contents of the SXML document DOC.

You can append to or modify this stylesheet and then pass it to eggdoc->svnwiki.

eggdoc:svnwiki-override!procedure

Sets eggdoc's default transformer and stylesheet maker to the svnwiki versions, like so:

(define (eggdoc:svnwiki-override!)
  (eggdoc:default-stylesheet-maker eggdoc:make-svnwiki-stylesheet)
  (eggdoc:default-transformer eggdoc->svnwiki))

Subsequently, calls to eggdoc:transform or eggdoc->html will generate svnwiki output.

Batch conversion

Inside the egg under extras/ there is a simple script to help with conversion of one or more eggdoc sources to svnwiki format.

eggdoc-html-to-svnwiki.sh
Converts one or more eggdoc source files to svnwiki plain text.

Just download the egg source:

$ chicken-install -r eggdoc-svnwiki
$ cd eggdoc-svnwiki

then run the conversion against the source eggdoc.scm. Your output will be placed in ./output/eggdoc.scm.svnwiki.

$ sh extras/eggdoc-html-to-svnwiki.sh ~/scheme/chicken-eggs4/mpi/trunk/mpi-eggdoc.scm
$ cat output/mpi-eggdoc.scm.svnwiki

Examples

For the direct, tedious approach to converting an existing eggdoc to svnwiki, edit the source and change the eggdoc->html call to eggdoc->svnwiki, and (use eggdoc) to (use eggdoc-svnwiki), then just run the eggdoc source script.

For a better approach, just call (eggdoc:svnwiki-override!) before parsing the document. That is exactly what eggdoc-html-to-svnwiki.sh does:

csi -script -e '(eggdoc:svnwiki-override!)' -script eggdoc.scm

For batch conversion and addition to svnwiki I did something silly like

cd output
for i in *; do perl -e '$_ = $ARGV[0]; 
  $f = $_; s/eggdoc-//; s/\.scm\.svnwiki//; 
  print "mv $f ~/scheme/chicken-eggs/wiki/$_\n"; 
  print "(cd ~/scheme/chicken-eggs/wiki && svn add $_)\n" ' $i;
done

resulting in script output which you can later direct to a shell:

mv eggdoc-args.scm.svnwiki ~/scheme/chicken-eggs/wiki/args
(cd ~/scheme/chicken-eggs/wiki && svn add args)
mv eggdoc-doctype.scm.svnwiki ~/scheme/chicken-eggs/wiki/doctype
(cd ~/scheme/chicken-eggs/wiki && svn add doctype)
mv eggdoc-eggdoc.scm.svnwiki ~/scheme/chicken-eggs/wiki/eggdoc
(cd ~/scheme/chicken-eggs/wiki && svn add eggdoc)
mv eggdoc-hostinfo.scm.svnwiki ~/scheme/chicken-eggs/wiki/hostinfo
(cd ~/scheme/chicken-eggs/wiki && svn add hostinfo)
mv eggdoc-sxml-tools.scm.svnwiki ~/scheme/chicken-eggs/wiki/sxml-tools
(cd ~/scheme/chicken-eggs/wiki && svn add sxml-tools)

Ugly but effective.

Limitations

About this egg

Author

Jim Ursetto

Version history

0.3
depend on regex for newer Chicken
0.2
Rendering fixes; update to new eggdoc transformer override API
0.1
Initial release

Requirements

License

BSD.

Contents »