[cairo] New cairo snippets live on wiki!

Carl Worth cworth at cworth.org
Fri Aug 3 11:11:17 PDT 2007


First, I want to give a huge amount of thanks to Nis Martensen for
some extremely valuable work he's been doing on the cairographics.org
website. He's been putting in a lot of effort that hasn't always been
visible, but it's extremely appreciated. Here is some of what he's
done recently:

 * Monitored the wiki and let us know when it kept failing, (I think
   we've got all the permission problems sorted out so that both
   git-pushes and web-edits should work now without causing failures).

 * Done a lot of boring, thankless work to port wiki content over to
   the latest version of ikiwiki.

 * Ported Michael Urman's original, off-site, python-based cairo
   tutorial so that it is now in C, and within the wiki itself where
   anyone can easily extend/improve it:

	http://cairographics.org/tutorial/

 * Ported Øyvind Kolås's cairo snippets to live within the wiki, so
   that for the first time, people can now also easily contribute and
   improve the snippets:

	http://cairographics.org/samples/

A few more notes on the snippets work in particular. Here are some
other improved aspects of this new version:

 * The cairo_snippet_normalize function is no longer used, (which has
   long been a source of confusion for new cairo users that were
   misled into thinking cairo provided a normalized coordinate system
   by default---or they just cut-and-pasted code samples and got
   confused as to why they didn't work).

 * The snippets using libsvg have been removed, (another source of
   confusion as people were led into using this obsolete library).

 * Several snippets that weren't demonstrating any obviously useful
   concept have been removed, (operators and xxx bug demonstrations,
   etc).

And there are also other benefits that come from the ikiwiki
integration:

 * New sample pages added will automatically be presented in the list
   at cairographics.org/samples.

 * That page also now offers RSS/Atom feeds for people to subscribe to
   new samples as they get added.

I'm really hopeful that this samples page can become a nice, dynamic
place for people to contribute and share samples of cairo code. Here
are some improvements I'd like to see:

 * Some of the existing snippets should be reworked slightly, (some
   of the text is getting clipped, or some tests have fairly extraneous
   content like the word "void" on the text sample with the word
   "hello").

 * It would be nice to add some instructions to the page on how to
   contribute a new snippet.

 * We did lose the XXX snippets, and some of them are certainly still
   valid demonstrations of existing bugs. Now that we have a simple
   template for including a set of snippets on a page, we could have a
   parallel page that presents the bugs. Or, even more interesting, we
   could easily provide tagged snippets and provide views of any
   snippets with a given tag.

 * Currently, the resulting image must be manually generated offline
   and uploaded. It would be really slick if someone created an ikiwiki
   plugin that would automatically render a snippet. Of course, that
   would require some care to avoid malicious code contribution---so
   I'm not exactly sure how to make that work, but I'd be open to any
   ideas people have.

 * Other things that might be interesting would be to present the
   snippets in various languages in addition to C, (that is, allow
   contributions using a very limited subset of C, and then write a
   script to convert that to various other language bindings). This
   "limited subset" approach might also help avoid the malicious attack
   vectors described above.

 * Similarly, it might be nice to provide a link that would allow the
   user to download a complete program for any given code snippet,
   (and the program could target any desired cairo surface
   backend). This part should actually be really easy to do, and might
   be as simple as just providing one ikiwiki template per surface
   backend.

Again, lots of interesting potential here, (all originally envision by
Øyvind I believe, but now much more easily within reach I
think). Thanks again to Nis for stepping up and helping out with this
stuff.

I really love this community and the way great new people are joining
all the time!

Have fun with cairo, everybody.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20070803/3a960955/attachment.pgp 


More information about the cairo mailing list