LV tutorial PUBLISHING

Comments and questions about the magazine

LV tutorial PUBLISHING

Postby colinmcc » Fri Jul 15, 2016 11:58 pm

This month's magazine has an article, (pages 74-77) which I'm working through. I've used markdown before, and as a result of the article installed markdown_py and it works fine to do the conversion to html.
Also installed Midori to get the command line tab refresh which also worked.

But, I'm coming unstuck when trying to get entr to work. I installed it, and tried the examples but when I reach the line
Code: Select all
 ls test.markdown | entr sh refresh.sh
does nothing.. Running it and then changing test.markdown doesn't seem to trigger a rewrite of the test.html file, or a midori browser tab refresh.

The Man page on entr isn't helpful, is there a more comprehensive explanation somewhere? Thanks!
colinmcc
 
Posts: 14
Joined: Tue Apr 29, 2014 2:11 pm

Re: LV tutorial PUBLISHING

Postby seumac » Fri Aug 26, 2016 9:58 am

All `entr` does is watch the list of files you send it on stdin and then run the command you specify whenever one of those files changes. You can test it is working with something like:
Code: Select all
ls test.markdown | entr date

`entr` doesn't background itself, so switch to another terminal, make a change to`test.markdown` and save it. Now switch back to the `entr` terminal and you should see it's printed the current date & time.

If that's working, then `entr` is working fine. Next, try making sure `refresh.sh` is working by running it separately. Make another change to `test.markdown` and then run:
Code: Select all
sh refresh.sh

If *that* works the way you expect, then you should be able to put the two together with:
Code: Select all
ls test.markdown | entr sh refresh.sh

And it's all good!

Note that all filenames that are used in the scripts and the commands are relative, so make sure you're in the same directory as all those files or none of them are going to work!
seumac
 
Posts: 2
Joined: Thu Aug 18, 2016 11:25 am


Return to Linux Voice

Who is online

Users browsing this forum: No registered users and 1 guest

cron