[racket] What about an Racket Artifacts thread?
Two hours ago, Neil Van Dyke wrote:
>
> FWIW, some wiki/CMS *software* actually implemented in Racket (none
> of this kludgey TWiki or massive MediaWiki or such) has been quietly
> the next thing on my unpaid work TODO list, after I release McFly
> and my rewritten HTML templating libraries.
>
> I want the markup language for the wiki/CMS to use the Scribble
> reader (and probably Scribble subset language and formatter), to
> lower the barrier for people editing the wiki or authoring a PLaneT
> package to then go and do the other thing. Most uses of a wiki
> installation would be hitting static files or blobs, and the Racket
> Web Server would handle editing and any tiny bits of JSON Web
> serving, so it could run a site like the official Racket wiki on a
> modest computer/VM.
I have a sketch of an implementation which I hope to finish this
summer.
* The language is the one in `scribble/html' (which is still not
really public since it's undocumented, it still needs a few minor
tweaks), but any other language can be used, and the output is used
-- so it sticks to the "just use modules" principle, no hacks. It
also looks inevitable to implement a markdown parser, especially
given that people will start using GH for bugreports.
* The rendering is doing just that: dumps the result to a file, so
unless you're editing pages it's all static. But this should be
extended too, since I want it to have some gadgets like votes,
access lists, etc. The plan is to also have files that are not
rendered as public pages (but are editable through the wiki). This
is so you can create a bunch of pages that use libraries that you
can put on the wiki -- and also have some central library so that
you could contribute site-wide library code if needed.
* For an editor, I basically hooked a simple textarea into an ajax
call, so you have the editor at the top and a continuously updated
HTML result rendered below. (Ie, there is no "run" button.) All
evaluations are sandboxed, of course. This didn't take much code to
implement.
But there's a bunch of stuff to be done:
* A backend system to save pages and revisions. Using git is an
obvious choice -- and maybe also allow pushing to a repo as a way to
publish pages. (The repo layout is unclear: a single repo means
that there's no access restrictions, and lots of binary file work is
not something that fits git.) Also, implement uploading of files
for binaries (possibly requiring some quota system to avoid the
obvious).
* Some authentication facility.
* Dealing with edit conflicts.
* An editor that works better than a textarea. I looked into a fewe
fancy ones, then just went on with the plain choice to defer the
decision. Recently I looked into etherpad lite: it implements a
better editor, but more importantly, if it's used as the editor then
conflicts are resolved in a trivial way (they don't happen), and as
a side bonus you get a live evaluator that you can edit with other
people in real time.
Etherpad (lite or not) by itself doesn't look like something that
scales well, more than saving a lot of data, it's stuff that you
don't want to see when you're done editing. (IOW, you want to see
changes between "revision steps", but there's no need to keep the
history of editing steps almot at the char-by-char level.) So I
want to use it as an editor for as long as the file is being edited,
and have a "save" button which saves revision; when nobody edits the
page, the etherpad server can die, and the history is no longer
needed. (So it's used strictly for shared editing.)
And further down the road, it would be nice to add widgets like a page
that has some fixed code, and a lighter version of the editor
(smaller, no shared editing) which has the code required or used as a
language -- so you can make pages that will have some sample code, and
an interactive repl to try playing with the code. There's also the
popular try-foo style pages that could be done similarly.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!