[plt-scheme] Re: how do you include documentation with a teachpack or planet collection?

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Aug 15 13:48:26 EDT 2008

On Aug 15, Stephen Bloch wrote:
> On Aug 15, 2008, at 1:11 AM, Eli Barzilay wrote:
> > Actually, there might be a way to get what you want (it wasn't clear
> > if this is what you tried so apologies if you already did).
> >
> > The first step is to create a post-installer hook ...
> Ah!  I didn't know about that.  I was doing roughly the same thing at  
> the end of the module itself.  A minor problem is that it currently  
> copies EVERYTHING from the PLaneT cache subdirectory, including  
> "info.ss" which then shows up in the "Add Teachpack" dialogue as  
> though it  were a teachpack; I need to experiment to figure out  
> exactly what needs to be copied.

Don't copy everything...  The code I had installed a stub file that
reprovides stuff from your real package for exactly that purpose.
This has many advantages: first, there's no need to choose what needs
to be copied -- the package itself can have anything you want, and the
stub just refers to that; second, it's easy to identify when the file
that you want to write is "not yours" which will be a good feature to
have if/when you want other people to try it; third, the stub file is
very simple so you don't need to update it -- it gets "updated"
indirectly when the planet package is updated.

> In the long run, it would be nice to have an info.ss field that  
> decides where to put the thing, e.g.
> (define destination-finder
>   [...]

Specifically, this will not work, because the system expects to look
for collections in specific places.  For irregular needs (like what
the package developer needs) there's planet.  Writing something
directly to the installed teachpacks directory is also an irregular
thing to do -- which is yet another reason I limited the "damage" to a
stub file -- this way when the teachpack facility changes to whatever
(as Robby mentioned) you won't need to change your code (my guess is
that you'll either add a field to the info file naming the teachpacks,
or you'll just change the place where the stub goes).  If you copy
more files, you might end up with code that depends on the new
placement of these files, and this might mess things up when such a
change to drscheme happens.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.