Is there a specification for the format used by man pages?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I would like to parse man pages into a more structure form, but I'm unable to find a proper specification for the data format under use by man pages. Should I be looking for troff or nroff or groff or something else? groff(7) says
The groff system has all features of the classical roff, but adds many extensions.
Are these extensions the various preprocessors like tbl or something else?
So far I've found the following resources:
troff.org - This has historical notes and some tutorials, and some dead links.
roff(7) (OpenBSD, Linux) - Doesn't really have a specification, only a brief overview and bunch of history.
man-pages(7) (Linux) - This provides guidelines about sections in man pages (which is useful), but it doesn't talk about the data format.
A Typesetter-independent TROFF and Troff User's Manual - these are fairly old, so I can't really judge what the differences are between the troff in those papers and in practice.
Is there a clear specification somewhere for the exact format under use by man pages?
man
|
show 2 more comments
up vote
2
down vote
favorite
I would like to parse man pages into a more structure form, but I'm unable to find a proper specification for the data format under use by man pages. Should I be looking for troff or nroff or groff or something else? groff(7) says
The groff system has all features of the classical roff, but adds many extensions.
Are these extensions the various preprocessors like tbl or something else?
So far I've found the following resources:
troff.org - This has historical notes and some tutorials, and some dead links.
roff(7) (OpenBSD, Linux) - Doesn't really have a specification, only a brief overview and bunch of history.
man-pages(7) (Linux) - This provides guidelines about sections in man pages (which is useful), but it doesn't talk about the data format.
A Typesetter-independent TROFF and Troff User's Manual - these are fairly old, so I can't really judge what the differences are between the troff in those papers and in practice.
Is there a clear specification somewhere for the exact format under use by man pages?
man
2
no standard - just similar/derived implementations. You omitted one manpage, with the macros (here).
– Thomas Dickey
3 hours ago
@ThomasDickey, yes I looked at that but I don't know if that is comprehensive (my hunch is that it isn't).
– theindigamer
3 hours ago
sure it is not: but the point of your question is standards, and there are none.
– Thomas Dickey
3 hours ago
To clarify, does your comment mean "none of roff/troff/nroff/groff have standards" or "man pages in practice do not follow any particular *roff system" or both?
– theindigamer
2 hours ago
All of the*roff
variants use the same instructions. Man pages add to those instructions a set of macros to do common things. But individual manpages may use either the underlying instructions or the macros or both with no consistency. ivanivan's answer, for example, is all about macros. But some pages hardly use the macros.
– Cupcake Protocol
2 hours ago
|
show 2 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I would like to parse man pages into a more structure form, but I'm unable to find a proper specification for the data format under use by man pages. Should I be looking for troff or nroff or groff or something else? groff(7) says
The groff system has all features of the classical roff, but adds many extensions.
Are these extensions the various preprocessors like tbl or something else?
So far I've found the following resources:
troff.org - This has historical notes and some tutorials, and some dead links.
roff(7) (OpenBSD, Linux) - Doesn't really have a specification, only a brief overview and bunch of history.
man-pages(7) (Linux) - This provides guidelines about sections in man pages (which is useful), but it doesn't talk about the data format.
A Typesetter-independent TROFF and Troff User's Manual - these are fairly old, so I can't really judge what the differences are between the troff in those papers and in practice.
Is there a clear specification somewhere for the exact format under use by man pages?
man
I would like to parse man pages into a more structure form, but I'm unable to find a proper specification for the data format under use by man pages. Should I be looking for troff or nroff or groff or something else? groff(7) says
The groff system has all features of the classical roff, but adds many extensions.
Are these extensions the various preprocessors like tbl or something else?
So far I've found the following resources:
troff.org - This has historical notes and some tutorials, and some dead links.
roff(7) (OpenBSD, Linux) - Doesn't really have a specification, only a brief overview and bunch of history.
man-pages(7) (Linux) - This provides guidelines about sections in man pages (which is useful), but it doesn't talk about the data format.
A Typesetter-independent TROFF and Troff User's Manual - these are fairly old, so I can't really judge what the differences are between the troff in those papers and in practice.
Is there a clear specification somewhere for the exact format under use by man pages?
man
man
asked 3 hours ago
theindigamer
133128
133128
2
no standard - just similar/derived implementations. You omitted one manpage, with the macros (here).
– Thomas Dickey
3 hours ago
@ThomasDickey, yes I looked at that but I don't know if that is comprehensive (my hunch is that it isn't).
– theindigamer
3 hours ago
sure it is not: but the point of your question is standards, and there are none.
– Thomas Dickey
3 hours ago
To clarify, does your comment mean "none of roff/troff/nroff/groff have standards" or "man pages in practice do not follow any particular *roff system" or both?
– theindigamer
2 hours ago
All of the*roff
variants use the same instructions. Man pages add to those instructions a set of macros to do common things. But individual manpages may use either the underlying instructions or the macros or both with no consistency. ivanivan's answer, for example, is all about macros. But some pages hardly use the macros.
– Cupcake Protocol
2 hours ago
|
show 2 more comments
2
no standard - just similar/derived implementations. You omitted one manpage, with the macros (here).
– Thomas Dickey
3 hours ago
@ThomasDickey, yes I looked at that but I don't know if that is comprehensive (my hunch is that it isn't).
– theindigamer
3 hours ago
sure it is not: but the point of your question is standards, and there are none.
– Thomas Dickey
3 hours ago
To clarify, does your comment mean "none of roff/troff/nroff/groff have standards" or "man pages in practice do not follow any particular *roff system" or both?
– theindigamer
2 hours ago
All of the*roff
variants use the same instructions. Man pages add to those instructions a set of macros to do common things. But individual manpages may use either the underlying instructions or the macros or both with no consistency. ivanivan's answer, for example, is all about macros. But some pages hardly use the macros.
– Cupcake Protocol
2 hours ago
2
2
no standard - just similar/derived implementations. You omitted one manpage, with the macros (here).
– Thomas Dickey
3 hours ago
no standard - just similar/derived implementations. You omitted one manpage, with the macros (here).
– Thomas Dickey
3 hours ago
@ThomasDickey, yes I looked at that but I don't know if that is comprehensive (my hunch is that it isn't).
– theindigamer
3 hours ago
@ThomasDickey, yes I looked at that but I don't know if that is comprehensive (my hunch is that it isn't).
– theindigamer
3 hours ago
sure it is not: but the point of your question is standards, and there are none.
– Thomas Dickey
3 hours ago
sure it is not: but the point of your question is standards, and there are none.
– Thomas Dickey
3 hours ago
To clarify, does your comment mean "none of roff/troff/nroff/groff have standards" or "man pages in practice do not follow any particular *roff system" or both?
– theindigamer
2 hours ago
To clarify, does your comment mean "none of roff/troff/nroff/groff have standards" or "man pages in practice do not follow any particular *roff system" or both?
– theindigamer
2 hours ago
All of the
*roff
variants use the same instructions. Man pages add to those instructions a set of macros to do common things. But individual manpages may use either the underlying instructions or the macros or both with no consistency. ivanivan's answer, for example, is all about macros. But some pages hardly use the macros.– Cupcake Protocol
2 hours ago
All of the
*roff
variants use the same instructions. Man pages add to those instructions a set of macros to do common things. But individual manpages may use either the underlying instructions or the macros or both with no consistency. ivanivan's answer, for example, is all about macros. But some pages hardly use the macros.– Cupcake Protocol
2 hours ago
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
Yup. Think like HTML... but pre-HTML. Basically a bunch of typesetting macros for groff
...
First, there are some commonly agreed on sections - of course you can add more...
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
BUGS
AUTHOR
SEE ALSO
And for each (and everywhere else) you use the groff
typesetting macro syntax.
For example, a TITLE HEADER
can be done like so -
.TH [name of program] [section number] [center footer] [left footer] [center header]
Or a SECTION HEADER
-
.SH [section name]
And of course, you can bold, italic, underline, etc -
.B = bold
.BI = bold alternating italic
.BR = bold alternating Roman
.I = italic
.IB = italic alternating bold
.IR = italic alternating Roman
.RB = Roman alternating bold
.RI = Roman alternating italic
And you can even make comments in your text file -
." This is a comment
And then things like paragraphing (like the <p></p>
html tag set) with .PP
Don't forget to name the file appropriately, and then gzip
it when done.
This info (and more) is from http://www.linuxhowtos.org/System/creatingman.htm
" Think like HTML... but pre-HTML" -- that is a bit hard, given that I am younger than HTML :P.
– theindigamer
3 hours ago
I'm not sure how accurate this answer is. man(1) page uses."
for comments.
– theindigamer
2 hours ago
@theindigamer I only wrote one man page (out of curiosity, much like the OP seems to be) and it was a long time ago and I don't have the bookmark (maybe at work?). My last sentence states where I got that info.
– ivanivan
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Yup. Think like HTML... but pre-HTML. Basically a bunch of typesetting macros for groff
...
First, there are some commonly agreed on sections - of course you can add more...
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
BUGS
AUTHOR
SEE ALSO
And for each (and everywhere else) you use the groff
typesetting macro syntax.
For example, a TITLE HEADER
can be done like so -
.TH [name of program] [section number] [center footer] [left footer] [center header]
Or a SECTION HEADER
-
.SH [section name]
And of course, you can bold, italic, underline, etc -
.B = bold
.BI = bold alternating italic
.BR = bold alternating Roman
.I = italic
.IB = italic alternating bold
.IR = italic alternating Roman
.RB = Roman alternating bold
.RI = Roman alternating italic
And you can even make comments in your text file -
." This is a comment
And then things like paragraphing (like the <p></p>
html tag set) with .PP
Don't forget to name the file appropriately, and then gzip
it when done.
This info (and more) is from http://www.linuxhowtos.org/System/creatingman.htm
" Think like HTML... but pre-HTML" -- that is a bit hard, given that I am younger than HTML :P.
– theindigamer
3 hours ago
I'm not sure how accurate this answer is. man(1) page uses."
for comments.
– theindigamer
2 hours ago
@theindigamer I only wrote one man page (out of curiosity, much like the OP seems to be) and it was a long time ago and I don't have the bookmark (maybe at work?). My last sentence states where I got that info.
– ivanivan
1 hour ago
add a comment |
up vote
0
down vote
Yup. Think like HTML... but pre-HTML. Basically a bunch of typesetting macros for groff
...
First, there are some commonly agreed on sections - of course you can add more...
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
BUGS
AUTHOR
SEE ALSO
And for each (and everywhere else) you use the groff
typesetting macro syntax.
For example, a TITLE HEADER
can be done like so -
.TH [name of program] [section number] [center footer] [left footer] [center header]
Or a SECTION HEADER
-
.SH [section name]
And of course, you can bold, italic, underline, etc -
.B = bold
.BI = bold alternating italic
.BR = bold alternating Roman
.I = italic
.IB = italic alternating bold
.IR = italic alternating Roman
.RB = Roman alternating bold
.RI = Roman alternating italic
And you can even make comments in your text file -
." This is a comment
And then things like paragraphing (like the <p></p>
html tag set) with .PP
Don't forget to name the file appropriately, and then gzip
it when done.
This info (and more) is from http://www.linuxhowtos.org/System/creatingman.htm
" Think like HTML... but pre-HTML" -- that is a bit hard, given that I am younger than HTML :P.
– theindigamer
3 hours ago
I'm not sure how accurate this answer is. man(1) page uses."
for comments.
– theindigamer
2 hours ago
@theindigamer I only wrote one man page (out of curiosity, much like the OP seems to be) and it was a long time ago and I don't have the bookmark (maybe at work?). My last sentence states where I got that info.
– ivanivan
1 hour ago
add a comment |
up vote
0
down vote
up vote
0
down vote
Yup. Think like HTML... but pre-HTML. Basically a bunch of typesetting macros for groff
...
First, there are some commonly agreed on sections - of course you can add more...
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
BUGS
AUTHOR
SEE ALSO
And for each (and everywhere else) you use the groff
typesetting macro syntax.
For example, a TITLE HEADER
can be done like so -
.TH [name of program] [section number] [center footer] [left footer] [center header]
Or a SECTION HEADER
-
.SH [section name]
And of course, you can bold, italic, underline, etc -
.B = bold
.BI = bold alternating italic
.BR = bold alternating Roman
.I = italic
.IB = italic alternating bold
.IR = italic alternating Roman
.RB = Roman alternating bold
.RI = Roman alternating italic
And you can even make comments in your text file -
." This is a comment
And then things like paragraphing (like the <p></p>
html tag set) with .PP
Don't forget to name the file appropriately, and then gzip
it when done.
This info (and more) is from http://www.linuxhowtos.org/System/creatingman.htm
Yup. Think like HTML... but pre-HTML. Basically a bunch of typesetting macros for groff
...
First, there are some commonly agreed on sections - of course you can add more...
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
BUGS
AUTHOR
SEE ALSO
And for each (and everywhere else) you use the groff
typesetting macro syntax.
For example, a TITLE HEADER
can be done like so -
.TH [name of program] [section number] [center footer] [left footer] [center header]
Or a SECTION HEADER
-
.SH [section name]
And of course, you can bold, italic, underline, etc -
.B = bold
.BI = bold alternating italic
.BR = bold alternating Roman
.I = italic
.IB = italic alternating bold
.IR = italic alternating Roman
.RB = Roman alternating bold
.RI = Roman alternating italic
And you can even make comments in your text file -
." This is a comment
And then things like paragraphing (like the <p></p>
html tag set) with .PP
Don't forget to name the file appropriately, and then gzip
it when done.
This info (and more) is from http://www.linuxhowtos.org/System/creatingman.htm
answered 3 hours ago
ivanivan
3,3491314
3,3491314
" Think like HTML... but pre-HTML" -- that is a bit hard, given that I am younger than HTML :P.
– theindigamer
3 hours ago
I'm not sure how accurate this answer is. man(1) page uses."
for comments.
– theindigamer
2 hours ago
@theindigamer I only wrote one man page (out of curiosity, much like the OP seems to be) and it was a long time ago and I don't have the bookmark (maybe at work?). My last sentence states where I got that info.
– ivanivan
1 hour ago
add a comment |
" Think like HTML... but pre-HTML" -- that is a bit hard, given that I am younger than HTML :P.
– theindigamer
3 hours ago
I'm not sure how accurate this answer is. man(1) page uses."
for comments.
– theindigamer
2 hours ago
@theindigamer I only wrote one man page (out of curiosity, much like the OP seems to be) and it was a long time ago and I don't have the bookmark (maybe at work?). My last sentence states where I got that info.
– ivanivan
1 hour ago
" Think like HTML... but pre-HTML" -- that is a bit hard, given that I am younger than HTML :P.
– theindigamer
3 hours ago
" Think like HTML... but pre-HTML" -- that is a bit hard, given that I am younger than HTML :P.
– theindigamer
3 hours ago
I'm not sure how accurate this answer is. man(1) page uses
."
for comments.– theindigamer
2 hours ago
I'm not sure how accurate this answer is. man(1) page uses
."
for comments.– theindigamer
2 hours ago
@theindigamer I only wrote one man page (out of curiosity, much like the OP seems to be) and it was a long time ago and I don't have the bookmark (maybe at work?). My last sentence states where I got that info.
– ivanivan
1 hour ago
@theindigamer I only wrote one man page (out of curiosity, much like the OP seems to be) and it was a long time ago and I don't have the bookmark (maybe at work?). My last sentence states where I got that info.
– ivanivan
1 hour ago
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481025%2fis-there-a-specification-for-the-format-used-by-man-pages%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
no standard - just similar/derived implementations. You omitted one manpage, with the macros (here).
– Thomas Dickey
3 hours ago
@ThomasDickey, yes I looked at that but I don't know if that is comprehensive (my hunch is that it isn't).
– theindigamer
3 hours ago
sure it is not: but the point of your question is standards, and there are none.
– Thomas Dickey
3 hours ago
To clarify, does your comment mean "none of roff/troff/nroff/groff have standards" or "man pages in practice do not follow any particular *roff system" or both?
– theindigamer
2 hours ago
All of the
*roff
variants use the same instructions. Man pages add to those instructions a set of macros to do common things. But individual manpages may use either the underlying instructions or the macros or both with no consistency. ivanivan's answer, for example, is all about macros. But some pages hardly use the macros.– Cupcake Protocol
2 hours ago