<div dir="ltr">Actually my script was wrong, here is an improved (and good enough for my purposes) version.<br><div class="gmail_quote"><div dir="ltr"><div>The usage would be "scribble-pvc ["pdf|html|latex..."] Foo.scrbl<br>
<div><br></div><div><div class="im"><div>#!/bin/bash</div>
<div><br></div><div>PATTERN="${PWD}/$2"</div><div><br></div></div><div>SCRIBBLE='echo "${watch_src_path} ${watch_event_type}"; scribble'</div><div>FMT=" --$1"</div><div><br></div><div>
if [ "$1" == "html" ]</div>
<div>then</div><div> XREFS=' ++xref-in setup/xref load-collections-xref --redirect-main "<a href="http://docs.racket-lang.org/html" target="_blank">http://docs.racket-lang.org/html</a>"'</div><div>else</div>
<div> XREFS=' ++xref-in setup/xref load-collections-xref'</div>
<div>fi</div><div><br></div><div>TARGET=' "${watch_src_path}"'</div><div><br></div><div>COM=$SCRIBBLE$FMT$XREFS$TARGET</div><div><br></div><div>watchmedo shell-command \</div><div><span style="white-space:pre-wrap">        </span> -c "$COM" \</div>
<div><span style="white-space:pre-wrap">        </span> -D -p $PATTERN</div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">2013/9/10 Ismael Figueroa <span dir="ltr"><<a href="mailto:ifigueroap@gmail.com" target="_blank">ifigueroap@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thanks Michael for your informative response!<div>
<br><div>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 (<a href="https://pypi.python.org/pypi/pydica-watchdog/" target="_blank">https://pypi.python.org/pypi/pydica-watchdog/</a>), which is implemented in Python.</div>
<div><br></div><div>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:</div><div><br></div>
<div><div>#!/bin/bash</div><div><br></div><div>PATTERN="${PWD}/$2"</div><div><br></div><div>watchmedo shell-command \</div><div><span style="white-space:pre-wrap">        </span> -c 'echo "${watch_src_path} ${watch_event_type}"; scribble $1 "${watch_src_path}"' \</div>
<div><span style="white-space:pre-wrap">        </span> -D -p $PATTERN</div><div><br></div><div>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)</div>
<div>A likely addition to the script is to add the "<span style="font-family:Arial,Helvetica,sans-serif;font-size:12.800000190734863px">++xref-in setup/xref load-collections-xref</span><span style="font-family:Arial,Helvetica,sans-serif;font-size:12.800000190734863px"> " and "--redirect-main" arguments to manage cross-references.</span></div>
<div><span style="font-family:Arial,Helvetica,sans-serif;font-size:12.800000190734863px">How does DrRacket discover to which URL to use as argument to redirect-main? or is it by default to <a href="http://docs.racket-lang.org/html" target="_blank">http://docs.racket-lang.org/html</a>?</span></div>
<div><br></div><div>Cheers</div><div class="gmail_extra"><div><div><br><div class="gmail_quote">2013/9/5 Michael Wilber <span dir="ltr"><<a href="mailto:gcr@sneakygcr.net" target="_blank">gcr@sneakygcr.net</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I imagine it's easy to write your own in a for loop, no?<br>
<br>
while true; do scribble ...; sleep 1; done<br>
<br>
Or with inotify:<br>
<br>
inotifywait -mr --timefmt '%d/%m/%y %H:%M' --format '%T %w %f' \<br>
-e close_write /tmp/test.scrbl | while read date time dir file; do<br>
FILECHANGE=${dir}${file}<br>
scribble ${FILECHANGE} ${FILECHANGE}.pdf<br>
echo "At ${time} on ${date}, file $FILECHANGE changed"<br>
done<br>
<div><div><br>
<br>
Ismael Figueroa <<a href="mailto:ifigueroap@gmail.com" target="_blank">ifigueroap@gmail.com</a>> writes:<br>
> Is there an option or an external tool to continously update a pdf<br>
> generated with Scribble? (maybe for the html docs too?)<br>
> I'm thinking of something like latexmk, when called as "latexmk -pvc<br>
> foo.tex"<br>
><br>
> Thanks<br>
><br>
> --<br>
> Ismael<br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br>Ismael<br>
</font></span></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Ismael<br>
</font></span></div></div></div></div>
</div><br><br clear="all"><div><br></div>-- <br>Ismael<br>
</div>