Linux-man Archive mirror
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org
Cc: Jonny Grant <jg@jguk.org>, Elliott Hughes <enh@google.com>,
	Deri James <deri@chuzzlewit.myzen.co.uk>
Subject: Online PDF of the Linux man-pages @ git HEAD
Date: Fri, 24 Nov 2023 18:11:35 +0100	[thread overview]
Message-ID: <ZWDZTY-jjJg9wkCw@debian> (raw)

[-- Attachment #1: Type: text/plain, Size: 2004 bytes --]

Hi,

I've set up a githooks(5) to generate a PDF book, running the script
contributed by gropdf(1)'s Deri James from within the hook, every time I
`git push` the main branch to my server.

You can find the book here:

<https://www.alejandro-colomar.es/share/dist/man-pages/git/HEAD/man-pages-HEAD.pdf>

The pages there don't have a "last modified" date, nor a version.  They
are pristine from git HEAD, so they contain the "(date)" and
"Linux man-pages (unreleased)" placeholders.  The file is suffixed -HEAD
to indicate that it is the state of git HEAD (or was, when downloaded;
if you don't remove it soon without renaming, then you're on your own).

I'm not sure if I should fill the placeholders with the date and
version, by running `make dist`, and then generating the book from the
generated tarball.  Since that's more work for the server, I didn't do
it, but it probably shouldn't be much work, since `make dist` reuses
files (which would have the effect that each page would show a different
version, at the last commit that modified the page).  For a HEAD PDF, I
don't think that's problematic.  If anyone would be interested in that,
feel free to ask for it.

The name of the file is -HEAD, and not -<version>, to have a more stable
URI.  I don't think we should be changing the URI for every commit.  Any
opinions?

In case anyone is curious, here's how:

	$ cat hooks/post-update
	#!/bin/sh

	test "$1" = "refs/heads/main" || exit 0;

	cd /srv/src/alx/linux/man-pages/man-pages/;

	unset $(git rev-parse --local-env-vars);
	git fetch srv			>/dev/null;
	git reset srv/main --hard	>/dev/null;

	sh <<__EOF__ &
		</dev/null \
		scripts/LinuxManBook/build.sh 2>/dev/null \
		| sponge /srv/www/share/dist/man-pages/git/HEAD/man-pages-HEAD.pdf \
		>/dev/null 2>&1
	__EOF__

BTW, I'm having trouble making git(1) not wait for it to finish, so if
you have any ideas, they're welcome!


Cheers,
Alex

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2023-11-24 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 17:11 Alejandro Colomar [this message]
2023-11-25  0:47 ` Online PDF of the Linux man-pages @ git HEAD Jonny Grant
2023-11-25 10:22   ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWDZTY-jjJg9wkCw@debian \
    --to=alx@kernel.org \
    --cc=deri@chuzzlewit.myzen.co.uk \
    --cc=enh@google.com \
    --cc=jg@jguk.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).