31

I am packaging a program for ubuntu, And I am getting a lintian warning saying my binary needs a manpage.

How does one go about creating a manpage for a program?

4 Answers 4

24

With the help of Gmanedit Install gmanedit you are able to create manpages with a graphical GUI.

Gtk+ Manpages Editor is an editor for man pages that runs on X with GTK+.

Gmanedit is an application which allows you to edit manual pages (man) on Linux/Unix systems.

It is like most common HTML editors but more easy. You need to know manpages format.

enter image description here

According to the Debian FHS user program manpages are stored in usr/share/man/man1 or usr/local/share/man/man1.

After changing manpages it may be wise to update the manpage database by running mandb in a terminal.

Details on the manpage syntax are summarized in the manpage for man.

2
  • Sure, you're right. I was going to change it, but as soon as I saw MarcoCeppi there I didn't want to modify it. :D
    – Lucio
    Mar 7, 2013 at 15:46
  • @Lucio lol - that was from a time way back, when there was no apps.ubuntu yet ;)
    – Takkat
    Mar 7, 2013 at 18:39
3

You can write manpages in docbook/refentry, an XML documentation format,

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id='vfplot1'>
<refentryinfo><date>1 July 2008</date></refentryinfo>
<refmeta>
<refentrytitle>VFPLOT</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class='date'>1 July 2008</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>vfplot</refname>
<refpurpose>plot vector fields with curved arrows.</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>vfplot</command>    
  <arg choice='opt'>-a <replaceable>aspect</replaceable></arg>
  <arg choice='opt'>-d <replaceable>file</replaceable></arg>
  <arg choice='opt'>-D <replaceable>pen</replaceable></arg>
    :

and then convert the results to man format using

xsltproc /path/to/docbook.xsl vfplot.xml

to html with

docbook2html docbook2html

and so on. This is not the easiest way to write a manpage, but if you have written XML before then you know the syntax already, it is just a matter of learning the tags to use.

3

Give this a whirl I have just uploaded it I write a number of apps and have been having trouble with a decent manpage editor

Now hosted on github, docs and repo: https://keithdhedger.github.io/pages/manpageeditor/manpageeditor.html https://github.com/KeithDHedger/ManPageEditor

This is a gtk2 app with a separate tab for each section importing manpages previewing and exporting are all supported, no esoteric formatting commands, this is still under development but is certainly stable enough to use.

2
  • 1
    That application looks interesting. Could you provide a bit more detail, here, than just a link? Aug 29, 2013 at 20:08
  • This is a gtk2 app with a separate tab for each section importing manpages previewing and exporting are all supported, no esoteric formatting commands, this is still under development but is certainly stable enough to use. Sep 8, 2013 at 17:29
0

You can do it with autotools. GNU has published example where a C project installs a manpage with autotools.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .