• Manpages are short. The average length is around 4 pages printed, much of which is pro-forma. Some run longer. Shells in particular (bash(1) runs around 98 pages piped through 'pr').
• Manpages include an EXAMPLES section, though this isn't always filled. That should be considered a bug.
• Manpages suffer from various projects attempting to deprecate them in favor of other forms of documentation. I particularly fault the GNU project's attempt to shoehorn info in place of man (the availability of man to Web utilities such as Debian's dwww largely wholly supplants this: info and the WWW were born within months of each other, Stallman and the FSF should have conceded the battle decades ago). Red Hat and the GNOME project have also been notably lax in providing manpages for utilities and programs. The Debian project considers omission of a manpage for an executable to be a bug, though not a release-critical one (I wish this severity would be increased).
• Fixing the deficiencies of existing manpages (and beating upstreams over the head with these until they're accepted) would be preferable to creating numerous externally maintained nonstandard variants. http://xkcd.com/927/
People likely aren't going to use manpages-tldr for 4 page man pages. They may use it for gcc which is 17549 lines (without an examples section and examples are littered throughout the page, meaning you have to already know what you're looking for).
According to Wikipedia, man pages have been around since 1971[1]. Man pages were designed before a paradigm shift from systems oriented to user oriented design and are usually written in a manner that makes them easy to write, not easy to read. If you think about the first time you looked at man pages, they were likely difficult to look through and you just got used to it; that's what happened to me.
I would guess that most people would like examples of basic usage. The examples section of man pages is normally near the end but it's location isn't really standardized. I normally end up searching "/^[[:blank:]]*EXAMPLE" and if I don't find it I google it.
This doesn't mean that man pages are not useful when you know what you're looking for. They can be particularly useful for c code to supplement the headers themselves.
I think forcing man pages to be something that they are not isn't much better than having a bunch of nonstandard variants. I am not saying that the examples shouldn't be added, but man pages are very technical when most people probably want a layman example before the technical details.
You're arguing against the data. Care to continue doing so?
There are a few outliers, but really, the average page length is pretty low.
I'm running this right now, and what I'm getting is (5831 pages processed):
mean: 3.9 pages
median: 2 pages
standard deviation: 11.06 pages
If you'd prefer precentiles: 5th %ile: 1
25th %ile: 1
75th %ile: 3
95th %ile: 12
Max is 476 pages (zshall(1)).This is on a Debian GNU/Linux system with 3479 packages installed. I checked only English manpages under /usr/share/man (there are another dozen or so pages for openjdk under /usr/lib/jvm, max length 29 pages).
Obviously, mileage may vary.
Code:
cd /usr/share/man
time for f in $(find man[0-9] -type f -name \*.[0-9].gz); do echo -e "$f\t\c"; man $f 2>&1 | pr | grep ' Page [0-9][0-9]* *$' | tail -1 | sed 's/^.*\(Page \)//'; done
Takes about 4.5 minutes to run on my system.Compute statistical moments with your preferred analysis tool (I've got one I wrote for the purpose).
There are 68 manpages 37 pages or longer in length (2 standard deviations over mean). I see several shells (zshall, bash, tcsh), many perl utilities, and a few complex tools (mutt, openvpn, wireshark, busybox) among them. Pretty small count, actually.
Man pages were designed before a paradigm shift from systems oriented to user oriented design and are usually written in a manner that makes them easy to write, not easy to read.
While understanding a manpage's format is useful, ANY documentation which is "easy to write, not easy to read" is a bug.
As for alternatives to manual pages, I find the Linux Documentation Project's HOWTOs to be an excellent adjunct. GNU info pages, not so much.
How do you think, would I need to change license of a project if I want to push some examples to manpages?
Generally, an MIT/BSD style license tends to be compatible with most other licenses. If you're the sole author, licensing the manpages under the same terms as the specific upstream works would work.
You might specify your own terms (say: a CC license), with a proviso "or, as an alternative, under the licensing terms of the original project for which this manual page applies".
IANAL.
Here is the 7th edition UNIX manual for comparison: http://cm.bell-labs.com/7thEdMan/bswv7.html
Note that you can still do this with manpages:
man -Tps bash > /tmp/bash.ps
Or if you prefer PDF output: man -Tps bash | ps2pdf - > /tmp/bash.pdf
... not that this addresses the content of the manpages, as you note. But at least you can decide on the format.> This project aims to make fast-updated, practical and precise manpages with examples for everyday usage. Its idea based on similar projects, like bropages and tldr, but written as part of real manpages (mostly converted from Markdown with pandoc).
And if OP is reading this there's a couple of typos there.
Normally I don't care, but this is a do umentation project so it's important.
> Its idea based
Should be
> It's an idea based
* the survival of OP's labour is more likely; and
* one might use something like `eg`[0] to directly jump to the 'Examples' section.
[0] I gave a possible implementation below (https://news.ycombinator.com/item?id=7167835).
I made great use of it with the excellently structured yet rather verbose git man-pages.
Anyways, here's the alias:
alias eg='man --pager='\''less -p "^[A-Z]* ?EXAMPLES"'\'''
Try it out: eg git pull
(With older shells you might have to say `eg git-pull`).Now as concerns the fine project submitted here, I'd suggest to try getting as much of those tldr's into actual man-pages. This will at least make the long-term survival of OP's labour more probable.
Welcome.