LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-20-2013, 06:41 AM   #1
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 521

Rep: Reputation: 141Reputation: 141
Anybody having luck in creating man pages?


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
Attached Thumbnails
Click image for larger version

Name:	ManPage.png
Views:	48
Size:	67.8 KB
ID:	13770  

Last edited by mddnix; 10-20-2013 at 06:50 AM.
 
Old 10-20-2013, 08:11 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
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
 
1 members found this post helpful.
Old 10-21-2013, 01:25 AM   #3
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 521

Original Poster
Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by andrewthomas View Post
Thanks. It was very helpful. I got my answers from comments section
 
Old 10-21-2013, 06:10 PM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
You're welcome. Glad to be of help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Creating Custom Man Pages LXer Syndicated Linux News 0 09-09-2010 03:41 PM
man pages BlinkingSpirit Linux - Newbie 10 08-05-2009 07:20 AM
What do you use for creating man pages? Randux Slackware 10 05-31-2006 04:18 AM
who - man pages kshkid Programming 17 03-01-2006 02:37 AM
C++ man pages Guest1234 Ubuntu 0 05-11-2005 02:45 AM


All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration