Login  Register

Re: Embed man pages in a book

Posted by eskwayrd on Aug 24, 2016; 2:48pm
URL: https://discuss.asciidoctor.org/Embed-man-pages-in-a-book-tp4906p4907.html

sgruttendio wrote
My question is: what is one supposed to do when a book has to include (among other "normal" book content) properly formatted manpages (that is, man pages formatted, more or less, in the traditional "terminal" way)?

I'd expect there are plenty of ways to accomplish this, but my first inclination is to use source blocks.

Suppose your "book" looks like this:

= Manpage Inclusion

Here is a manpage:

[source,manpage]
----
include::manpage.txt[]
----

Then you'd need to create manpage.txt, perhaps like this:

$ man ls > manpage.txt

Then:

$ asciidoctor book.adoc

Obviously, with many manpages to be included, you'd use a sensible naming scheme.

I hope that helps!