[racket] Scribble continuous previsualisation?

From: Ismael Figueroa (ifigueroap at gmail.com)
Date: Tue Sep 10 15:38:07 EDT 2013

Thanks Michael for your informative response!

Indeed it was a very simple thing to do. However as I am using OS X I don't
have the inotify tool. After looking for some solutions, I stumbled upon
the cross-platform watchdog tool (
https://pypi.python.org/pypi/pydica-watchdog/), which is implemented in
Python.

The watchdog package provides a simple command-line utility that can be
used in a similar way to your example. I developed a very simple script
"scribble-pvc" as follows:

#!/bin/bash

PATTERN="${PWD}/$2"

watchmedo shell-command \
  -c 'echo "${watch_src_path} ${watch_event_type}"; scribble $1
"${watch_src_path}"' \
  -D -p $PATTERN

It seems to work for my use case. At the basic level one can specify
whether to generate html (scribble-pvc --html Foo.scrbl) or pdf
(scribble-pvc --pdf Foo.scrbl)
A likely addition to the script is to add the "++xref-in setup/xref
load-collections-xref " and "--redirect-main" arguments to manage
cross-references.
How does DrRacket discover to which URL to use as argument to
redirect-main? or is it by default to http://docs.racket-lang.org/html?

Cheers

2013/9/5 Michael Wilber <gcr at sneakygcr.net>

> I imagine it's easy to write your own in a for loop, no?
>
> while true; do scribble ...; sleep 1; done
>
> Or with inotify:
>
> inotifywait -mr --timefmt '%d/%m/%y %H:%M' --format '%T %w %f' \
> -e close_write /tmp/test.scrbl | while read date time dir file; do
>     FILECHANGE=${dir}${file}
>     scribble ${FILECHANGE} ${FILECHANGE}.pdf
>     echo "At ${time} on ${date}, file $FILECHANGE changed"
> done
>
>
> Ismael Figueroa <ifigueroap at gmail.com> writes:
> > Is there an option or an external tool to continously update a pdf
> > generated with Scribble? (maybe for the html docs too?)
> > I'm thinking of something like latexmk, when called as "latexmk -pvc
> > foo.tex"
> >
> > Thanks
> >
> > --
> > Ismael
> > ____________________
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
>



-- 
Ismael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130910/52a8caa2/attachment.html>

Posted on the users mailing list.