Surf Monitor - Live Previewer
This project aims to provide a way to have a browser react to changes in a list of files to monitor and update what he is displaying instantly.
To see a full demo check the video.
You will need to build it from source. The source is the lit file, a file that following the ideas of Literate Programming.
I used the Literate compiler to compile the lit file.
The browser I used was the surf browser from the suckless guys.
To detect changes made in files inotifywait is used, so you will need to install the inotify-tools package.
sudo pacman -S inotify-tools
sudo apt-get install inotify-tools
To install the surf_monitor follow the next steps:
- Get the surf_monitor repository
git clone https://github.com/drmargarido/surf_monitor
- Download the Lit compiler(Here is the linux version, select the one for your os)
wget http://literate.zbyedidia.webfactional.com/binaries/literate-linux64.tar.gz && tar xf literate-linux64.tar.gz && rm literate-linux64.tar.gz
- Download, compile and install the surf browser
git clone https://git.suckless.org/surf cd surf make sudo make install cd ..
- Compile and Install the surf monitor
make sudo make install
Everything ready now. Check the documentation generated from the literate program in the build folder.
To check if everything is working fine try to open the documentation with the surf monitor, and make some change in the html while the browser is open to check if it reloads.
surf_monitor build/surf_monitor.html build
You can run the surf monitor in the following way:
surf_monitor :html_file_to_open: ":path_to_monitor:"