Re: [dev] Auto-preview man pages

From: Greg Reagle <greg.reagle_AT_umbc.edu>
Date: Fri, 8 Jan 2016 00:53:56 -0500

On Fri, Jan 08, 2016 at 06:42:21AM +0200, Adrian Grigore wrote:
> On Fri, Jan 8, 2016 at 5:05 AM, Greg Reagle <greg.reagle_AT_umbc.edu> wrote:
> > echo Readme.md | entr sh -c 'markdown Readme.md | w3m -T text/html'
> >
> > Still not ideal, because you have to quit from w3m manually. If you use
> > -dump with w3m you don't have to quit, but you lose formatting and other goodies.
>
> This is exactly where I'm stumped.

If you use the -r option of entr, then you do get complete and very
satisfying automation when running a GUI. For instance this works great:
  echo Readme.md | entr -r sh -c 'mkd2html Readme.md ; netsurf Readme.html'

For some reason entr -r doesn't work with w3m or elinks or lynx (maybe this
is a bug in entr that needs to be fixed). However, you can use service
supervision for the win!

In one terminal do this:
  runsv .
And in another terminal do this:
  echo Readme.md | entr sh -c 'mkd2html Readme.md ; sv down .; sv once .'

And now whenever you save changes to Readme.md in your text editor, w3m
automatically reloads the up-to-date rendition!

An executable "run" file is required, as follows:
  #!/bin/sh
  w3m Readme.html

The links to these tools are:
runit is at http://smarden.org/runit/
entr is at https://bitbucket.org/eradman/entr
Received on Fri Jan 08 2016 - 06:53:56 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 08 2016 - 07:00:14 CET