[plt-scheme] Re: Some sort of documentation tool from the toplevel?

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Wed Jul 6 19:29:05 EDT 2005

> I'd like to write a tool that'll help me get quick documentation strings
> for an arbitrary mzscheme primitive function.  For the life of me, I
> can't remember all of the mzscheme primitives, nor what order the
> arguments have to be in, nor what optional arguments they accept.


Hi everyone,

I've written something that is starting to work, although it is hacky as
heck, and totally not right yet.  But here's what it does so far:

;;;;;;
> (require "help.ss")
> (help-strings delete-directory)
("delete-directory\n(delete-directory path)\n (delete-directory
path)\ndeletes an existing directory with the path path.  If
the\ndirectory is deleted successfully, void is returned, otherwise\nthe
exn:fail:filesystem exception is raised.")
>
> (help-strings make-hash-table)
("make-hash-table\n(make-hash-table [flag-symbol
flag-symbol])\n\n\n(make-hash-table [flag-symbol flag-symbol]) creates and
returns a\nnew hash table. If provided, each flag-symbol must one of\nthe
following:\n")
;;;;;;


There are some presentation things I'll need to do, and some corrections
in how it extracts documentation, but I think it's a good start so far.
When it starts actually working right, I'll be happy to turn it into a
PLaneT package.

The source code is here:

http://aztec.stanford.edu/svn/repos/personal/dyoo/scratch/plt/help/

The help code works under the assumption that the mzscheme and r5rs
documentation have been installed locally under collects/doc.  But at the
moment, the code appears only to sorta work on things defined in the
MzScheme Reference Manual, because the R5RS documentation organizes its
summary strings differently, and my HTML scraping is very fragile.


I guess I'm looking for feedback on what I can do to make this actually
work; one of my main problem now seems to be robust HTML scraping issues.

At the moment, I'm just using the html and xml collections provided as
part of PLT Scheme to extract content from the HTML-ified reference
documentation, but the parsers seem particularly unhappy about the
non-well-formedness in there.  Should I be using a different set of
parsers.



Posted on the users mailing list.