Even more special would be being able to get this specifically for Lubuntu because there are a few differences in software and I'm an avid Lubuntu user but, if need be, I can make due with just the Ubuntu man-pages.
There are no differences in manpages between Lubuntu and Ubuntu. One of the points of becoming a recognized flavour is using the same repositories as Ubuntu, so the software is identical, it's only the starting points that differ.
Also, http://manpages.ubuntu.com suffers from a bug where identically named manpages from different packages aren't distinguished - the manpages of the last package read show up.
Instead of hammering the manpages site, hammer the repositories.
Get a list of manpages, for, say, the binary-amd64
architecture (should be identical to the others):
mkdir temp
cd temp
curl http://archive.ubuntu.com/ubuntu/dists/wily/Contents-amd64.gz |
gunzip |
grep 'share/man' |
sed 's/.* //;s/,/\n/g' |
awk -F/ '{print $NF}' |
sort -u > packages.txt
while IFS= read -r package
do
apt-get download "$package"
dpkg-deb --fsys-tarfile "$package"*.deb | tar x ./usr/share/man
mkdir "$package"-manpages
find ./usr/share/man/man* -type f -exec mv -t "$package"-manpages {} +
rm "$package"*.deb
for page in "$package"-manpages/*
do
man -t "$page" | ps2pdf - > "$page".pdf
done
done < packages.txt
If course, this is going to consume an insane amount of bandwidth - the repository servers are used to it, the question is: is your network upto the task?
Have you looked into pdfbox? You can invoke its various features from the command line. You can extract each page as text, use diff to see if each successive page has mostly additions to the previous one, keep track of the interesting pages, then use pdfbox again extract only those pages.
I assume from your rating that you don't need detailed instructions for how to accomplish all this :)
Best Answer
creates a decent PDF file.
LibreOffice is also able to convert to PDF:
The output can compete with the above solution in my opinion.
Also there's
enscript
which offers interesting formatting options (seeman enscript
):makes use of CUPS PDF (you might need to install the
cups-pdf
package first) to print a PDF file in~/PDF/
– but it's not as fancy.also works, but the output is plain ugly.