LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Anybody having luck in creating man pages? (https://www.linuxquestions.org/questions/linux-newbie-8/anybody-having-luck-in-creating-man-pages-4175481485/)

Madhu Desai 10-20-2013 06:41 AM

Anybody having luck in creating man pages?
 
1 Attachment(s)
Hi All,

I'm trying to create some man pages...actually tutorials in man page format.

The reason behind is, most of the time i work in CLI mode. i also use gui when i want to browse internet/youtube, watch movies or listen to music. Worse than that is, since most of my tutorials/notes that i have created are in Microsoft OneNote format, so not only i have to keep X11, but also in VirtualBox "Win-7 => Office 2010" virtual machine. This has become really frustrating.. work in tty...press <ctrl><alt><f1> and goto GUI...open VirtualBox...open Windows OS...open OneNote...Hit again <ctrl><alt><f2>.. and continue..etc. Not only i'm unable to leave behind Windows OS and x11, but i'm also wasting a lot of time for just switching from this to that and again from that to this...

I solved most of my problems by switching to some of cli applications.

Split terminal => tmux
Browser => links2 -g
Video => cvlc
Music => cmus
Bittorrent => transmission-remote
...etc

But i am struck with my notes. so i thought to convert my tutorials and notes in man page format so it will be native to linux and also easy to use as its in man page format. So started my adventure... after learning how to create man pages, i started to create them. NOT SO EASY as i had thought earlier... its so confusing.

After spending first 2-3 hours, I barely managed to complete half the page. Attached is the ScreenShot of incomplete man page. Following is the code for that.


Code:

.TH md-manpage 88 "19 October 2013" "CentOS 6.4" "Create Man Pages"

.SH TITLE
How To Create Man Pages.

.SH SYNOPSIS
How do I create a man page for my shell under Linux / UNIX operating systems?

.SH DEFAULT MAN PAGE LOCATION
The system stores its man pages at \fI/usr/share/man/\fR directory. For example, the directory
\fI/usr/share/man/man1\fR stores man pages for user shell commands. You can view it by typing
the following command:

.P
\fB$ ls -x /usr/share/man/man1\fR
.br
.fi
ab.1.gz                            abrt-action-analyze-backtrace.1.gz  abrt-action-analyze-c.1.gz
 abrt-action-analyze-oops.1.gz
.fi
abrt-action-analyze-python.1.gz    abrt-action-generate-backtrace.1.gz  abrt-action-generate-core-backtrace.1.gz
  abrt-action-list-dsos.1.gz
.fi
abrt-action-save-package-data.1.gz  abrt-action-trim-files.1.gz          abrt-cli.1.gz
    abrt-handle-upload.1.gz
.fi
abrt-install-ccpp-hook.1.gz        abrt-server.1.gz                    ac.1.gz 
        aclocal-1.11.1.gz
.fi
aclocal.1.gz                        aconnect.1.gz                        acroread.1.gz   
    addftinfo.1.gz

.SH
CUSTOM MAN PAGE LOCATION
It is recommended that you store your own man pages in \fI/usr/local/man\fR directory.
You can set man search path in \fB/etc/man.config\fR file:
.P
MANPATH        /usr/man
.br
MANPATH        /usr/share/man
.br
MANPATH        /usr/local/man
.br
MANPATH        /usr/local/share/man
.br
MANPATH        /usr/X11R6/man
.br
.B MANPATH        /usr/local/man

.SH SOME IMPORTANT MACROS
The options are as follows:
.TP
.B \.TH <name> <section> <date> <os> <title>
Title Heading; specify product name, man page section, date, os, and title.
.br
ex: \fB\.TH md-manpage 88 "19 October 2013" "CentOS 6.4" "Create Man Pages"\fR
.TP
.B -SH "<text>"
Section Heading; if no blanks in text, quotes are not needed.
.br
ex: \fB\.SH "TITLE"\fR
.TP

...If this is what i have to bare with, for just half a page, then its nightmare when i think of what i have to do for my rest of - around 50-60 tuturials and hundreds of notes.

So my question - has anybody dealt with creating many man pages...easily? Then, how to do it? There is no WYSIWYG editor for man pages, as for as i know. i also tried txt2man, but it still needs formatting.

Any help will be much appreciated.

Thanks

andrewthomas 10-20-2013 08:11 AM

Quote:

Originally Posted by creating-custom-man-pages
Marc Vertes (mvertes@free.fr) has written an excellent GNU AWK script called txt2man, which can run on almost any UN*X-like system, and can convert a flat ASCII text file to the correct man page format. txt2man (currently version 1.5.5-1) is distributed by the Fedora Project and is available from the EPEL Repository. The authors home page is http://mvertes.free.fr/txt2man/.



http://www.linuxjournal.com/content/...stom-man-pages

Madhu Desai 10-21-2013 01:25 AM

Quote:

Originally Posted by andrewthomas (Post 5049028)

Thanks. It was very helpful. I got my answers from comments section :)

andrewthomas 10-21-2013 06:10 PM

You're welcome. Glad to be of help.


All times are GMT -5. The time now is 09:06 PM.