You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Creating_Man_Pages.md 4.2 KiB

4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. **Creating your own man page**
  2. This is simply a little tutorial for fun. :) You will finally have your
  3. name up their with \'find\', \'sed\' and \'hey\'!
  4. ## The nroff -man Command
  5. The nroff command is an emulator and by giving the -man option, it
  6. outputs the file in a manual page style. This prints everything out, so
  7. it is best to catch the output and pipe it into \'more\' like so:
  8. `nroff -man ~art_wolf/art_wolf.8 | more`
  9. It is the nroff syntax we will be looking at and how to make the output
  10. resemble a man page.
  11. ## Nroff\'s Syntax
  12. nroff has several settings and we will be using most of them to achive
  13. our look. Here are the main ones:
  14. Request Cause Break Explanation
  15. ---
  16. .B t no Text t is bold. Quote to imbed blanks.
  17. .I t no Text t is italic. Quote to imbed blanks.
  18. .TP x yes Set prevailing indent to 5. Begin indented paragraph with hanging tag given by first argument. Tag x is always placed on a separate line.
  19. .LP yes Same as .PP.
  20. .PP yes Begin paragraph. Set prevailing indent to 5.
  21. .RE yes End of relative indent. Set prevailing indent to amount of starting .RS.
  22. .RS yes Start relative indent, move left margin in distance 5.
  23. .SH t yes Subhead. Quote to imbed blanks.
  24. .SS t yes Subsection. Quote to imbed blanks. No indent for t.
  25. .TH n s c v d yes Begin page named n of chapter s; c is the chapter name; d is the date of the most recent change; v is version number. Sets prevailing indent and tabs to 5.
  26. ## A man-ly example
  27. Read a sample man page here. Save this to your home directory and rename
  28. it \'username.8\' and modify it to your hearts content :)
  29. .TH USERNAME 1 This is part of a normal man page layout which prints
  30. USERNAME(1) at the corners of the man page.
  31. .SH SECTION This sets a head section..surprise surprise.. used like
  32. this:
  33. SYNOPSIS sample \[options\]
  34. .SH SYNOPSIS sample \[options\]
  35. .TP 5 This gives a break and is used between options to seperate them.
  36. .B sample This sets everything on the line to bold. If there are spaces
  37. in the word everything must be enclosed with quotes.
  38. ## Headings used in a man page
  39. A quick google and here are the main headings used in man pages - now
  40. it\'s time for you to try your own. :)
  41. * NAME - This should be the product name followed by a short
  42. description. The text on this line is also used as the keyword list
  43. for man -k and apropos.
  44. <!-- -->
  45. * SYNOPSIS or SYNTAX - Document here the complete syntax of the
  46. command used to invoke the product.
  47. <!-- -->
  48. * AVAILABILITY - Document here the OS flavours for which the program
  49. is available.
  50. <!-- -->
  51. * DESCRIPTION - Document here a full but succinct description of the
  52. use of the product.
  53. <!-- -->
  54. * OPTIONS - Document here all the options available for the invoking
  55. command.
  56. <!-- -->
  57. * EXAMPLES - Document here situations in which the program can be
  58. used, if there are uses that are not obvious.
  59. <!-- -->
  60. * NOTES - Document here any information the user should be aware of
  61. when using the command.
  62. <!-- -->
  63. * MESSAGES AND EXIT CALLS - Document here all errors and other
  64. messages returned to the user. Include the cause and the recovery
  65. actions whenever appropriate and possible.
  66. <!-- -->
  67. * AUTHOR - Document here the product coordinator and/or the major
  68. developers and contributors, along with their particular areas of
  69. expertise, as appropriate.
  70. <!-- -->
  71. * HISTORY - Document here the significant changes in each release of
  72. the product.
  73. <!-- -->
  74. * RESOURCES - If your product is designed to work under X windows,
  75. document here any X resources that affect the product\'s behaviour.
  76. <!-- -->
  77. * FILES - Document here all files, or at least their directories if
  78. there are too many files. Also mention here any files in the user\'s
  79. home area that are needed/accessed (e.g., \$HOME/.mh_profile,
  80. \$HOME/Mail/components for the mh and exmh products).
  81. <!-- -->
  82. * BUGS - Document here things that do not (yet!) work as designed.
  83. Provide work-arounds whenever possible.
  84. <!-- -->
  85. * CAVEATS - Document here things that work as designed but which may
  86. be unclear or surprising to the user. (This is the System V
  87. replacement for the BUGS category; you too can pretend your product
  88. has no bugs!).
  89. <!-- -->
  90. * SEE ALSO - Document here other related commands and manual sections,
  91. especially if not obvious.
  92. [Category:Helpdesk](/Category:Helpdesk "wikilink")