Login  Register

Re: Embed man pages in a book

Posted by mojavelinux on Aug 25, 2016; 10:10pm
URL: https://discuss.asciidoctor.org/Embed-man-pages-in-a-book-tp4906p4914.html


On Thu, Aug 25, 2016 at 4:58 AM, sgruttendio [via Asciidoctor :: Discussion] <[hidden email]> wrote:
The solution you posted is nice but it lacks monospaced text, which I believe is a must in a man page.

We are clearly talking about different things then. You want the man page to look like it looks in the man pager, but as HTML. The first thing you need to do is figure out how to achieve that without Asciidoctor. I tried man2html, roffit and man --html='w3m -dump_source`, but all gave me output very close to what the manpage converter in Asciidoctor provides. I don't know if there's a tool to make an HTML version of exactly what you see in the man pager, monospace and all.

> Is there any way to fix this or this is about "writing a block extension", as you hinted?

I strongly encourage you not to fear extensions. If you're using Asciidoctor seriously, this is something you should know. I think it would be ridiculous to select another tool over Asciidoctor to avoid having to write an extension. Asciidoctor extensions are so easy to write and so powerful, they'll absolutely save you time and headaches in the end.

It seems to me the main challenge here is simply being able to define the requirement. Once you can define your requirement clearly, the path to getting the output you want really isn't that far away. You seem to want to capture the man pager display and render that faithfully as HTML (assuming HTML is your output). If you can find a way to do that step, then we can wire that step into Asciidoctor easily.

Cheers,

-Dan


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux