<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">

<!--
	``MakeMan'' SGML Example Representation of a man page
	For more Information, please see http://mama.sourceforge.net

	$Author: Jan Schaumann <jschauma@netmeister.org> $
	$Id: makeman.pl.sgml, v 0.3 2001/08/27 13:52:57 jschauma Exp $
-->

<refentry id="makeman.pl">
	<refmeta>
		<refentrytitle>makeman.pl</refentrytitle>
		<manvolnum>1</manvolnum>
		<refmiscinfo class="date">August 27th, 2001</refmiscinfo>
		<refmiscinfo class="source">MakeMan</refmiscinfo>
		<refmiscinfo class="title">Writing Man Pages</refmiscinfo>
	</refmeta>

	<refnamediv>
		<refname>makeman.pl</refname>
		<refpurpose>parse an SGML man page into valid roff source</refpurpose>
	</refnamediv>

	<refsynopsisdiv>
		<cmdsynopsis>
			<command>makeman.pl</command>
				<arg choice="opt">-h</arg>
				<arg choice="opt">
					-i <arg choice="req">FILE</arg>
				</arg>
				<arg choice="opt">
					-o <arg choice="req">FILE</arg>
				</arg>
				<arg choice="opt">-v</arg>
		</cmdsynopsis>
	</refsynopsisdiv>

	<refsect1>
		<title>DESCRIPTION</title>
		<para>
			<command>makeman.pl</command> is part of
			<emphasis>MakeMan</emphasis>, a project to provide several 
			frontends, GUI and non-GUI, to an SGML interface to write
			man pages.
        </para>
        <para>
            <command>makeman.pl</command>, written in Perl, parses an
			SGML input file and generates valid roff source that can be read
            by <emphasis>man</emphasis>.
		</para>
	</refsect1>
	
	<refsect1>
		<title>USAGE</title>
		<para>
			Per default, <command>makeman.pl</command> reads the output of
			<command>nsgmls</command> from <emphasis>stdin</emphasis> and
			write roff sources to <emphasis>stdout</emphasis>. Alternatively,
			the input- and output-files can be specified as command-line
			options, in which case the input file may be the SGML source.
		</para>
		<refsect2>
			<title>Supported Tags</title>
				<para>
					The following is a list of the tags supported by
					<command>makeman.pl</command>:
				</para>
				<variablelist>
					<varlistentry>
						<term><command>&lt;refentry&gt;</command></term>
						<listitem>
							<para>
								Encloses the entire document.
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;refmeta&gt;</command></term>
						<listitem>
							<para>
								Encloses the meta information. Together with
								<command>&lt;refentryterm&gt;</command>, <command>&lt;manvolnum&gt;</command> and
								<command>&lt;refmiscinfo&gt;</command> this section forms the
								Header of the man page.
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;refnamediv&gt;</command></term>
						<listitem>
							<para>
								Together with <command>&lt;refname&gt;</command> and
								<command>&lt;refpurpose&gt;</command> this forms the NAME section
								of the man page, which is used by
								<command>apropos(1)</command> and
								<command>whatis(1)</command>.
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;refsynopsisdiv&gt;</command></term>
						<listitem>
							<para>
								Encloses the SYNOPSIS section of the man page.
								In it, <command>&lt;cmdsynopsis&gt;</command> wraps the
								<command>&lt;command&gt;</command> and the optional <command>&lt;arg&gt;</command>
								tags.
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;refsect1&gt;</command></term>
						<listitem>
							<para>
								Encloses a main SECTION (".SH") in the man page.
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;refsect2&gt;</command></term>
						<listitem>
							<para>
								Encloses a SUBSECTION (".SS") in the man page.
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;title&gt;</command></term>
						<listitem>
							<para>
								Currently supported within the
								<command>&lt;refsect1&gt;</command> and  <command>&lt;refsect2&gt;</command>.
								Simiarly, <command>&lt;term&gt;</command> is used for lists
								(".TH").
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;para&gt;</command></term>
						<listitem>
							<para>
								Encloses a PARAGRAPH (".PP").
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;variablelist&gt;</command></term>
						<listitem>
							<para>
								Together with one or more <command>&lt;varlistentry&gt;</command>
								tags lists such as this can be created
								(".TP").
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;simplelist&gt;</command></term>
						<listitem>
							<para>
								A simple list.  Can have an attribute
								<emphasis>type</emphasis>:
								<simplelist type="vert">
									<member><emphasis>inline</emphasis> -
									comma separated</member>
									<member><emphasis>vert</emphasis> -- like
									this</member>
								</simplelist>
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;itemizedlist&gt;</command></term>
						<listitem>
							<para>
								An itemized list.  Can have an attribute
								<emphasis>spacing</emphasis> (if "compact" use
								as little whitespace as possible) and
								<emphasis>mark</emphasis>
								Within this list, the
								<command>&lt;listitem&gt;</command> tag can
								have an attribute
								<emphasis>override</emphasis>, which can have
								the same values as the
								<emphasis>mark</emphasis> attribute, causing
								the following items to be itemized by the
								according character.  Values for
								<emphasis>mark</emphasis> and
								<emphasis>override</emphasis> are:
								<simplelist type="vert">
									<member><emphasis>bullet</emphasis> - use
									\(bu to itemize</member>
									<member><emphasis>emdash</emphasis> - use
									\(em to itemize</member>
								</simplelist>
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;orderedlist&gt;</command></term>
						<listitem>
							<para>
								An ordered list.  Can have an attribute
								<emphasis>spacing</emphasis> (if "compact" use
								as little whitespace as possible),
								<emphasis>numeration</emphasis> and
								<emphasis>continuation</emphasis>.
								<emphasis>numeration</emphasis> can be one of
								"arabic" (default; enumerate  by incrementing
								arabic number), "loweralpha" (enumerate by
								incrementing the lowercase letters of the
								alphabet) or "upperalpha" (enumerate by
								incrementing the uppercase letters of the
								alphabet).
								<emphasis>continuation</emphasis> can be one
								of "restarts" (default; each ordered list has
								it's own counting and starts from 0/a/A) or
								"continues" (each ordered list continues to
								increment the item numbers from where the last list
								stopped)
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;replaceable&gt;</command></term>
						<listitem>
							<para>
								Commonly used when listing the comand-line
								options, signifying that this parameter can be
								replaced.  It will be diplayed in italics
								("\fI \fR").
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;filename&gt;</command></term>
						<listitem>
							<para>
								Encosing a fileame, which will be diplayed in italics
								("\fI \fR").
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;optinal&gt;</command></term>
						<listitem>
							<para>
								Contents will be placed in square brackets
								("[" and "]").
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><command>&lt;ulink&gt;</command></term>
						<listitem>
							<para>
								Similar to an HTML <command>&lt;a href&gt;</command> tag.
								Signifies that the contents are linked to a
								URL.  Will be displayed as "Contents (Link to
								\fIURL\fR)"
							</para>
						</listitem>
					</varlistentry>

				</variablelist>
		</refsect2>
	</refsect1>
	
	<refsect1>
		<title>OPTIONS</title>
		<para>
			A summary of the options supported by
			<command>makeman.pl</command> is included below.  
		</para>
		<variablelist>
			<varlistentry>
				<term>-h</term>
				<listitem>
					<para>Show summary of options and exit.</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term>-i <emphasis>FILE</emphasis></term>
				<listitem>
					<para>Read SGML from <emphasis>FILE</emphasis>.</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term>-o <emphasis>FILE</emphasis></term>
				<listitem>
					<para>Write output to <emphasis>FILE</emphasis>.</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term>-v</term>
				<listitem>
					<para>Show version information and exit.</para>
				</listitem>
			</varlistentry>
		</variablelist>
	</refsect1>

	<refsect1>
		<title>EXAMPLES</title>
		<variablelist>
			<varlistentry>
				<term>In a pipe:</term>
				<listitem>
					<para>
						<command>nsgmls</command>
						<emphasis>infile.sgml</emphasis> | 
						<command>makeman.pl</command>
					</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term>Alone:</term>
				<listitem>
					<para>
						<command>makeman.pl -i</command>
						<emphasis>infile.sgml</emphasis>
					</para>
				</listitem>
			</varlistentry>
		</variablelist>
	</refsect1>
	
	<refsect1>
		<title>REQUIRES</title>
		<para>
			Perl, SGMLSp, expat, nsgmls (part of SP)
		</para>
	</refsect1>

	<refsect1>
		<title>VERSION</title>
		<para>
			0.2
		</para>
	</refsect1>

	<refsect1>
		<title>BUGS</title>
		<para>
			Different indention levels within variable lists within
			subsections are not displayed correctly.
		</para>
		<para>
			Please report all bugs to the author.
		</para>
	</refsect1>

	<refsect1>
		<title>SEE ALSO</title>
		<para>
			<command>man(7)</command>
		</para>
		<para>
			<ulink url="http://mama.sourceforge.net">http://mama.sourceforge.net</ulink>
		</para>
	</refsect1>

	<refsect1>
		<title>AUTHOR</title>
		<para>
			Jan Schaumann <email>jschauma@netmeister.org</email>
		</para>
	</refsect1>
</refentry>
