Re: [dev] Auto-preview man pages

From: Greg Reagle <greg.reagle_AT_umbc.edu>
Date: Thu, 7 Jan 2016 22:05:32 -0500

On Fri, Jan 08, 2016 at 12:31:34AM +0200, Adrian Grigore wrote:
> On Thu, Jan 7, 2016 at 8:56 PM, Greg Reagle <greg.reagle_AT_umbc.edu> wrote:
> > I find it a real pain to work with things like man page source and markdown
> > source and so forth because of the extra steps of making the output/object
> > format.
>
> I have yet to find a solution for markdown. I would really prefer
> something with w3m.

To be a *little* bit automated, you can combine the build command and the
viewing, and execute 'make Readme.html && w3m Readme.html' if using a
Makefile; or 'mkd2html Readme.md && w3m Readme.html' if not using a
Makefile; or because w3m can be a filter, 'markdown Readme.md | w3m -T
text/html'.

The above still leaves a lot to be desired though. To be a little bit more
automated, you can use the entr command to automatically watch the file for
changes like this:
  echo Readme.md | entr sh -c 'make Readme.html && w3m Readme.html'
or
  echo Readme.md | entr sh -c 'mkd2html Readme.md && w3m Readme.html'
or
  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.
Received on Fri Jan 08 2016 - 04:05:32 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 08 2016 - 04:12:14 CET