Skip to content

Instantly share code, notes, and snippets.

@dgageot
Created July 9, 2013 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgageot/5957537 to your computer and use it in GitHub Desktop.
Save dgageot/5957537 to your computer and use it in GitHub Desktop.
Auto reload browser when a doc file is saved
#!/bin/sh
echo 'Convert .doc to .html'
# Convert
for file in *.doc ;do
asciidoc $file
done
# Add auto-reload js
for file in *.html ;do
cat reload.js | tee -a $file > /dev/null
done
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
Book Title Goes Here
====================
Hello World 3
# gem install watchr
# watchr watchr.txt
#
watch('.*\.doc') {refresh}
def refresh
system './convert.sh'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment