[plt-scheme] Semi-literate programming with scribble

From: Jakub Piotr Cłapa (jpc-ml at zenburn.net)
Date: Sun Apr 25 16:32:57 EDT 2010

I came accross some nice semi-literate programming tools for CoffeScript 
(an alternative JavaScript syntax) and Ruby [1,2] which I believe to be 
inspired by Code Illumination [3] made for the Mozilla Ubiquity project.

I was thinking how to reproduce something like that in Scheme using 
Scribble. I would like to support at least Scheme and C. Maybe shell 
scripting and Python too. (so AFAIU I cannot just use at-exp and macros)

I am not sure how to make it all tick:
1. How to split the code/docs?

I think the best way would be to do some light regexp based text 
preprocessing to split out the commented blocks and wrap every block in 
an @-form before passing the result to the scribble reader.

2. How to process the files?

I guess I should read the source for scribble/text and/or 
scribble/manual but last time I tried it was quite difficult to 
understand how all the parts fit together. Are there better places to 
learn about how to make such a tool?

I only started playing with Scribble so I would love to hear what 
someone wiser think about this idea.

Thanks for taking time to read this.

[1]: http://jashkenas.github.com/docco/
[2]: http://rtomayko.github.com/rocco/
[3]: http://www.toolness.com/wp/?p=441

Jakub Piotr Cłapa

Posted on the users mailing list.