eggdoc-svnwiki

This is version 0.1 of the eggdoc-svnwiki extension library for Chicken Scheme.

  1. eggdoc-svnwiki
    1. Description
    2. Documentation
      1. Your eggdoc and you
      2. Batch conversion
    3. Limitations
    4. Examples
    5. About this egg
      1. Author
      2. Version history
      3. Requirements
      4. License

Description

Render eggdoc source to svnwiki syntax

Documentation

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

Your eggdoc and you

'''procedure:''' (eggdoc->svnwiki DOC [STYLESHEET])

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.

'''procedure:''' (eggdoc:make-svnwiki-stylesheet DOC)

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.

'''procedure:''' (eggdoc:make-defsig TAG SIG . [BODY])

Use this procedure inside a stylesheet to generate a new signature tag, just like procedure or macro. It expands to a (definition (signatures (signature ...))) expression. For example,

(eggdoc->svnwiki doc `( ,@(eggdoc:make-svnwiki-stylesheet doc)
                        (constant *macro* . ,eggdoc:make-defsig)
                        (method   *macro* . ,eggdoc:make-defsig) ))

will create new constant and method tags.

Batch conversion

Inside the egg under extras/ I included some simple scripts to help with conversion of one or more eggdoc sources to svnwiki format.

eggdoc-svnwiki-shim.scm
Overrides standard eggdoc functions with eggdoc-svnwiki versions, so you do not have to modify the source.
eggdoc-html-to-svnwiki.sh
Converts standard eggdoc source to svnwiki plain text.

Limitations

This extension has only been tested on a few eggs, unlike eggdoc-texinfo (which was tested on a hundred). There are undoubtedly unresolved formatting issues that will be encountered. Additionally, svnwiki has some peculiarities and bugs of its own. Overall, however, the conversion quality is not too bad.

Examples

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

To use the example script to convert existing eggdocs, unpack the egg and run the conversion script against the desired source:

~/scheme/eggdoc-svnwiki$ mkdir output
~/scheme/eggdoc-svnwiki$ sh extras/eggdoc-html-to-svnwiki.sh ~/eggdoc/eggdoc-objc.scm
~/scheme/eggdoc-svnwiki$ cat output/eggdoc-objc.scm.svnwiki

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.

About this egg

Author

Zbigniew

Version history

0.1
Initial release

Requirements

[[sxml-transforms]], [[sxml-tools]]

License

Copyright (c) 2007 Jim "Zb" Ursetto.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer. Redistributions in
  binary form must reproduce the above copyright notice, this list of
  conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution. Neither the name of the
  author nor the names of its contributors may be used to endorse or
  promote products derived from this software without specific prior
  written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.