chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Re: post-commit


From: Alejandro Forero Cuervo
Subject: [Chicken-hackers] Re: post-commit
Date: Sat, 31 Mar 2007 05:24:13 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

Hey.

I'm attaching a change I made to egg-post-commit (which, it should be
said, I have not tested).  Basically, instead of including all the
verbose HTML for each egg in the Eggs Unlimited page in the wiki, it
just includes “<chickenegg .../>” tags.  These tags are expanded to
the actual HTML code by the wiki itself (by an extension I made for
Svnwiki).

The reason to do this is that it makes the information in the wiki
more rich semantically.  A practical consequence is that, since the
Svnwiki extension has more information about the wiki than
egg-post-commit, it can do more things.  For example, it can replace
the link to “http://www.call-with-current-continuation.org/eggs/” with
a link to the wiki if a page for the egg exists in the wiki
(regardless of “doc-from-wiki” from the meta file).

You can test what “<chickenegg .../>” does by going to the edit form
for any wiki file, entering code such as

    <chickenegg name="stream-ext" description="some extension foobar yes" 
license="gpl" author="Alejandro Forero Cuervo"/>

and hitting Preview.

The implementation for chickenegg is function chicken-egg-html in
/var/www/svnwiki-data/chicken-eggs/extensions/chicken.scm:

    (define (chicken-egg-html env)
      (let-from-environment env (params parse path-in)
        (or
          (and-let* ((name-stream (assoc 'name params))
                     (name (stream->string (cdr name-stream)))
                     (description (assoc 'description params))
                     (license (assoc 'license params))
                     (author (assoc 'author params)))
            (parse
              (html-stream
                (tr (td (if (file-exists? (svnwiki-make-pathname path-in name))
                          (format #f "[[~A]]" name)
                          (format #f "[[~A~A.html|~A]]" *url-eggs* name name)))
                    (td (cdr description))
                    (td (cdr license))
                    (td "[[" (cdr author) "]]")))))
          stream-null)))

It should be easy to add more tags (such as chickenexample, chickensignature,
etc.) bound to functions that map them to wiki code (which the wiki will itself
map to HTML/PDF/etc.).

By the way, one consequence of the way I wrote chicken-egg-html, is
that authors, as appearing in eggs' meta files, should match exactly a
page in the wiki (eg. "Alejandro Forero Cuervo" instead of "Alejandro
Forero Cuervo <address@hidden>"), which I think is a good
thing (and in the case of a mismatch, the link in the wiki will be
shown in red).

Alejo.
http://azul.freaks-unidos.net/

Attachment: patchs
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]