From owner-freebsd-questions@FreeBSD.ORG Wed Mar 31 19:31:39 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90F491065672 for ; Wed, 31 Mar 2010 19:31:39 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id DCB798FC0A for ; Wed, 31 Mar 2010 19:31:38 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.308, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, DATE_IN_PAST_03_06 1.59) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: o2VJVLSc029087 Received: from kobe.laptop (ppp-94-64-255-164.home.otenet.gr [94.64.255.164]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.1) with ESMTP id o2VJVLSc029087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 31 Mar 2010 22:31:27 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.4/8.14.4) with ESMTP id o2VJVLdb014121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 31 Mar 2010 22:31:21 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.4/8.14.4/Submit) id o2VJVJVv014112; Wed, 31 Mar 2010 22:31:19 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Fbsd1 In-Reply-To: <4BB2FFB1.4020500@a1poweruser.com> (fbsd1@a1poweruser.com's message of "Wed, 31 Mar 2010 15:54:25 +0800") Date: Wed, 31 Mar 2010 19:22:23 +0300 Message-ID: <87wrwswjeo.fsf@kobe.laptop> References: <4BB2BABF.9070401@a1poweruser.com> <4BB2F8FF.7090707@infracaninophile.co.uk> <4BB2FFB1.4020500@a1poweruser.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Questions Subject: Re: How to make "man" pages X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 19:31:39 -0000 On Wed, 31 Mar 2010 15:54:25 +0800, Fbsd1 wrote: > OK i want to write a man page from scratch. So lets say i want to use > /usr/share/man/man2/jail.2.gz as my starting sample. How do I convert > this .gz file to a plain text file so I can edit it with ee? And how do > I turn the edited text file back in to a man page .gz file? The manpage sources are plain text files with text that uses formatting macros from the groff_mdoc(7) macro collection. You can find sample files for the style commonly used by the FreeBSD manpages in your '/usr/share/examples/mdoc' directory. keramida@kobe:/usr/share/examples/mdoc$ ls -ld *[0-9] -r--r--r-- 1 root wheel - 3550 18 =CE=9C=CE=B1=CF=81 01:55 example.1 -r--r--r-- 1 root wheel - 7582 18 =CE=9C=CE=B1=CF=81 01:55 example.3 -r--r--r-- 1 root wheel - 3302 18 =CE=9C=CE=B1=CF=81 01:55 example.4 -r--r--r-- 1 root wheel - 7700 18 =CE=9C=CE=B1=CF=81 01:55 example.9 keramida@kobe:/usr/share/examples/mdoc$ Installed manpages can be found under '/usr/share/man/man?'. They are usually compressed with gzip(1) to save some space, but you can extract any manpage to a plain text file with gzip or zcat: zcat /usr/share/man2/jail.2.gz | more The source of a manpage commonly uses _many_ formatting macros from the groff_mdoc(7) collection. You should probably print a copy of the 'groff_mdoc' manpage and keep it around for reference. Reading through this printed copy of the manpage at least once will be useful too, as it will help you understand how macro options work and you will have a good idea of what features are available. Then you will be able to quickly look in the printed reference copy for the features you need, because you will know "they are there".