I tried to replicate this success on my Windowns 10 ultrabook, but I did not have much luck.
entr tool does not exist for Windows, neiter does
inotify-tools. I tried Facebook’s
watchman, but I could not get it to work. Then I tried
nodemon, it kinda worked but with some quirks. The
browser-sync also failed to work properly. I set the port at
9000, but it defaulted to port
Hence, this called for a different approach. This solution is sort of hack-y, crafted during a short afternoon when I was doing my Western blot. I am currently using the
while loop indefinitly to generate HTML5 document from markdown, and using python
livereload server for hot-reloading the HTML output.
bash script looks as follows:
#!/bin/bash # ------------------------------- # A small script to utilize watch # and pandoc on Windows, together # with livereload # ------------------------------- # infinite loop with while true while true; do pandoc $1 -f markdown -t html5 --self-contained -c github.css --highlight-style haddock -o index.html; sleep 10; done & # start a local webserver with livereload livereload . -p 9000
It works by issuing the command
bash panda-win.sh document.md, where
panda-win.sh is the name of this
bash script and
document.md is the target document. The output is
index.html, which is seen by the
10 seconds, the whole thing reloads by itself instead of watching for changes.
getting pip3 on Windows
livereload is a python package, I had to install it through
cygwin installation comes with
python2, but either version of
pip was not installed.
pip3 by first download the
https://bootstrap.pypa.io/get-pip.py, then I issued the command
python3 get-pip.py, which then installed
This solution works for now. If anyone has any experience using file-watcher on Windows 10, let me know by tweeting me on Twitter (@aixnr). Thanks!
The next adventure is crafting a good-looking CSS for academic writing, with Tufte’s style being the inspiration.