From owner-freebsd-questions@FreeBSD.ORG Sun Jan 13 02:51:14 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 93FD7B53 for ; Sun, 13 Jan 2013 02:51:14 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC582B0 for ; Sun, 13 Jan 2013 02:51:14 +0000 (UTC) Received: from r56.edvax.de (port-92-195-31-80.dynamic.qsc.de [92.195.31.80]) by mx02.qsc.de (Postfix) with ESMTP id 2BC8E249D3; Sun, 13 Jan 2013 03:51:07 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r0D2pAhJ004830; Sun, 13 Jan 2013 03:51:10 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sun, 13 Jan 2013 03:51:09 +0100 From: Polytropon To: Fbsd8 Subject: Re: manpage -> html Message-Id: <20130113035109.28f69d05.freebsd@edvax.de> In-Reply-To: <50F219D2.2040906@a1poweruser.com> References: <50F1FECA.4090801@a1poweruser.com> <50F20536.3020009@a1poweruser.com> <20130113021454.e1128036.freebsd@edvax.de> <50F2150C.20209@a1poweruser.com> <50F219D2.2040906@a1poweruser.com> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 02:51:14 -0000 On Sat, 12 Jan 2013 21:20:02 -0500, Fbsd8 wrote: > Fbsd8 wrote: > > Polytropon wrote: > >> On Sat, 12 Jan 2013 19:52:06 -0500, Fbsd8 wrote: > >>> OK let me be more specific. > >>> Using just commands that are in the base system. > >>> IE; come with the 9.1 system > >> > >> Very well: > >> > >> zcat `man -w ls` | groff -Thtml -dpaper=a4 -P-pa4 > ls.html > >> > >> zcat `man -w ls` | groff -Thtml > ls.html > >> > >> However, the output looks a bit strange here (tested with lynx > >> and Opera), so maybe some additional options are required. I've > >> just derived this from my man2pdf script and read "man groff" > >> for the -T parameter. > >> > >> > > > > zcat `man -w ls` | groff -T html > ls.html > > > > That kind of worked. It did create html code but it dropped all the > > indentations and blank lines. .Pp commands in the man page source. > > > > > zcat `man -w ls` | groff -mdoc -T html > ls.html > > The -mdoc is the FBSD style and it worked. > Got indentations for all sections plus the high-intensity stuff > converted to bold. The blank lines also can out. An all this confusion simply because I wanted to trim the command nicely and left out some stuff from my man2pdf script. Here it is for reference (in case you need to create PS or PDF output from manpages): #!/bin/sh if [ $# = 0 ]; then echo "usage: man2pdf.sh " exit 1 fi if [ -f $1.pdf ]; then echo "output file $1.pdf already exists, aborting." exit 1 fi zcat `man -w $@` | groff -Tps -dpaper=a4 -P-pa4 -mandoc | ps2pdf $1.pdf exit 0 And as you can see: the -mandoc option is in there, the big difference being -Tps instead of -Thtml (as listed in "man groff" regarding the -T option). Note that this script requires ps2pdf as external package. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...