user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 0/3] another round of doc tweaks
@ 2021-11-03 21:01 Eric Wong
  2021-11-03 21:01 ` [PATCH 1/3] doc: add more 3rd-party refs, use Debian manpages for xapian Eric Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Wong @ 2021-11-03 21:01 UTC (permalink / raw)
  To: meta

Eric Wong (3):
  doc: add more 3rd-party refs, use Debian manpages for xapian
  doc: switch to man(1) for pod => (text|html)
  doc: txt2pre: linkify a add a few more well-known things

 Documentation/extman.perl            | 33 ----------------------------
 Documentation/include.mk             | 16 +++++---------
 Documentation/lei-add-external.pod   |  2 +-
 Documentation/lei-import.pod         |  2 +-
 Documentation/lei-q.pod              |  2 +-
 Documentation/public-inbox-clone.pod |  2 +-
 Documentation/public-inbox-fetch.pod |  2 +-
 Documentation/txt2pre                | 28 +++++++++++++++++------
 MANIFEST                             |  1 -
 Makefile.PL                          | 19 +---------------
 10 files changed, 32 insertions(+), 75 deletions(-)
 delete mode 100755 Documentation/extman.perl

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] doc: add more 3rd-party refs, use Debian manpages for xapian
  2021-11-03 21:01 [PATCH 0/3] another round of doc tweaks Eric Wong
@ 2021-11-03 21:01 ` Eric Wong
  2021-11-03 21:01 ` [PATCH 2/3] doc: switch to man(1) for pod => (text|html) Eric Wong
  2021-11-03 21:01 ` [PATCH 3/3] doc: txt2pre: linkify a add a few more well-known things Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2021-11-03 21:01 UTC (permalink / raw)
  To: meta

curl, torsocks, and gitglossary manpages are all newly
referenced, so make sure they're linkified properly in HTML.
We'll be using Debian's manpages as an ad-free, Tor-accessible
host for manpages as a fallback since hosting manpages for all
3rd-party projects we reference doesn't scale.
---
 Documentation/extman.perl            | 33 ----------------------------
 Documentation/include.mk             |  8 +++----
 Documentation/lei-add-external.pod   |  2 +-
 Documentation/lei-import.pod         |  2 +-
 Documentation/lei-q.pod              |  2 +-
 Documentation/public-inbox-clone.pod |  2 +-
 Documentation/public-inbox-fetch.pod |  2 +-
 Documentation/txt2pre                | 14 +++++++-----
 MANIFEST                             |  1 -
 Makefile.PL                          | 17 --------------
 10 files changed, 17 insertions(+), 66 deletions(-)
 delete mode 100755 Documentation/extman.perl

diff --git a/Documentation/extman.perl b/Documentation/extman.perl
deleted file mode 100755
index c6cfb4c5..00000000
--- a/Documentation/extman.perl
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
-# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-# prints a manpage to stdout
-use strict;
-my $xapmsg = 'See https://xapian.org/ for more information on Xapian';
-my $usage = "$0 /path/to/manpage.SECTION.txt";
-my $manpage = shift or die $usage;
-my $MAN = $ENV{MAN} || 'man';
-my @args;
-$manpage = (split('/', $manpage))[-1];
-$manpage =~ s/\.txt\z//;
-$manpage =~ s/\A\.//; # no leading dot (see Documentation/include.mk)
-$manpage =~ s/\.(\d+.*)\z// and push @args, $1; # section
-push @args, $manpage;
-
-# don't use UTF-8 characters which readers may not have fonts for
-$ENV{LC_ALL} = $ENV{LANG} = 'C';
-$ENV{COLUMNS} = '76'; # same as pod2text default
-$ENV{PAGER} = 'cat';
-my $cmd = join(' ', $MAN, @args);
-system($MAN, @args) and die "$cmd failed: $!\n";
-$manpage =~ /\A(?:copydatabase|xapian-compact)\z/ and
-	print "\n\n", $xapmsg, "\n";
-
-# touch -r $(man -w $section $manpage) output.txt
-if (-f \*STDOUT) {
-	open(my $fh, '-|', $MAN, '-w', @args) or die "$MAN -w broken?: $!\n";
-	chomp(my $path = <$fh>);
-	my @st = stat($path) or die "stat($path) failed: $!\n";
-	# 9 - mtime
-	utime($st[9], $st[9], \*STDOUT) or die "utime(STDOUT) failed: $!\n";
-}
diff --git a/Documentation/include.mk b/Documentation/include.mk
index 149f9e3c..af5f7f24 100644
--- a/Documentation/include.mk
+++ b/Documentation/include.mk
@@ -105,18 +105,16 @@ doc: $(docs)
 
 gz-doc: $(gz_docs)
 
-gz-xdoc: $(gz_xdocs)
-
 rsync-doc: NEWS.atom.gz
 	# /usr/share/doc/rsync/scripts/git-set-file-times{.gz} on Debian systems
 	# It is also at: https://yhbt.net/git-set-file-times
 	-git set-file-times $(docs) $(txt)
-	$(MAKE) gz-doc gz-xdoc
-	$(RSYNC) --chmod=Fugo=r -av $(rsync_docs) $(rsync_xdocs) $(RSYNC_DEST)
+	$(MAKE) gz-doc
+	$(RSYNC) --chmod=Fugo=r -av $(rsync_docs) $(RSYNC_DEST)
 
 clean-doc:
 	$(RM_F) $(man1) $(man5) $(man7) $(man8) $(gz_docs) $(docs_html) \
-		$(mantxt) $(rsync_xdocs) \
+		$(mantxt) \
 		NEWS NEWS.atom NEWS.html Documentation/standards.txt \
 		Documentation/flow.html Documentation/flow.html.gz \
 		Documentation/flow.txt.gz
diff --git a/Documentation/lei-add-external.pod b/Documentation/lei-add-external.pod
index 1761eed1..7afcad63 100644
--- a/Documentation/lei-add-external.pod
+++ b/Documentation/lei-add-external.pod
@@ -69,7 +69,7 @@ Suppress feedback messages.
 
 =item --no-torsocks
 
-Whether to wrap L<git(1)> and L<curl(1)> commands with torsocks.
+Whether to wrap L<git(1)> and L<curl(1)> commands with L<torsocks(1)>.
 
 Default: C<auto>
 
diff --git a/Documentation/lei-import.pod b/Documentation/lei-import.pod
index 25f1daf5..ad769084 100644
--- a/Documentation/lei-import.pod
+++ b/Documentation/lei-import.pod
@@ -77,7 +77,7 @@ Import already seen IMAP and NNTP articles.
 
 =item --no-torsocks
 
-Whether to wrap L<git(1)> and L<curl(1)> commands with torsocks.
+Whether to wrap L<git(1)> and L<curl(1)> commands with L<torsocks(1)>.
 
 Default: C<auto>
 
diff --git a/Documentation/lei-q.pod b/Documentation/lei-q.pod
index fe281d7b..fd829655 100644
--- a/Documentation/lei-q.pod
+++ b/Documentation/lei-q.pod
@@ -237,7 +237,7 @@ Suppress feedback messages.
 
 =item --no-torsocks
 
-Whether to wrap L<git(1)> and L<curl(1)> commands with torsocks.
+Whether to wrap L<git(1)> and L<curl(1)> commands with L<torsocks(1)>.
 
 Default: C<auto>
 
diff --git a/Documentation/public-inbox-clone.pod b/Documentation/public-inbox-clone.pod
index 10326091..c80c3c5f 100644
--- a/Documentation/public-inbox-clone.pod
+++ b/Documentation/public-inbox-clone.pod
@@ -67,7 +67,7 @@ Increases verbosity, also passed to L<git-fetch(1)>.
 
 =item --no-torsocks
 
-Whether to wrap L<git(1)> and L<curl(1)> commands with torsocks.
+Whether to wrap L<git(1)> and L<curl(1)> commands with L<torsocks(1)>.
 
 Default: C<auto>
 
diff --git a/Documentation/public-inbox-fetch.pod b/Documentation/public-inbox-fetch.pod
index 1890ae75..c78ffc0b 100644
--- a/Documentation/public-inbox-fetch.pod
+++ b/Documentation/public-inbox-fetch.pod
@@ -71,7 +71,7 @@ Increases verbosity, also passed to L<git-fetch(1)>.
 
 =item --no-torsocks
 
-Whether to wrap L<git(1)> and L<curl(1)> commands with torsocks.
+Whether to wrap L<git(1)> and L<curl(1)> commands with L<torsocks(1)>.
 
 Default: C<auto>
 
diff --git a/Documentation/txt2pre b/Documentation/txt2pre
index f6b2ad96..def54473 100755
--- a/Documentation/txt2pre
+++ b/Documentation/txt2pre
@@ -76,11 +76,6 @@ for (qw[lei(1)
 	$xurls{$n} = "$n.html";
 }
 
-for (qw[copydatabase(1) xapian-compact(1)]) {
-	my ($n) = (/([\w\-\.]+)/);
-	$xurls{$_} = ".$n.1.html"
-}
-
 for (qw[make(1) flock(2) setrlimit(2) vfork(2) tmpfs(5)]) {
 	my ($n, $s) = (/([\w\-]+)\((\d)\)/);
 	$xurls{$_} = "http://www.man7.org/linux/man-pages/man$s/$n.$s.html";
@@ -103,6 +98,7 @@ for (qw[git(1)
 	git-init(1)
 	git-send-email(1)
 	gitrepository-layout(5)
+	gitglossary(7)
 ]) {
 	my ($n) = (/([\w\-\.]+)/);
 	$xurls{$_} = "https://kernel.org/pub/software/scm/git/docs/$n.html"
@@ -118,6 +114,7 @@ for (qw[
 	$xurls{$_} = "https://www.freedesktop.org/software/systemd/man/$n.html";
 }
 
+# favor upstream docs if they exist, use manpages.debian.org if they don't
 $xurls{'netrc(5)'} = 'https://manpages.debian.org/stable/ftp/netrc.5.en.html';
 $xurls{'mbsync(1)'} =
 	'https://manpages.debian.org/stable/isync/mbsync.1.en.html';
@@ -135,6 +132,13 @@ $xurls{'cgitrc(5)'} = 'https://git.zx2c4.com/cgit/tree/cgitrc.5.txt';
 $xurls{'prove(1)'} = 'https://perldoc.perl.org/prove.html';
 $xurls{'mbox(5)'} = 'https://manpages.debian.org/stable/mutt/mbox.5.en.html';
 $xurls{'mmdf(5)'} = 'https://manpages.debian.org/stable/mutt/mmdf.5.en.html';
+$xurls{'torsocks(1)'} =
+	'https://manpages.debian.org/stable/torsocks/torsocks.1.en.html';
+$xurls{'curl(1)'} = 'https://manpages.debian.org/stable/curl/curl.1.en.html';
+$xurls{'copydatabase(1)'} =
+ 'https://manpages.debian.org/stable/xapian-tools/copydatabase.1.en.html';
+$xurls{'xapian-compact(1)'} =
+ 'https://manpages.debian.org/stable/xapian-tools/xapian-compact.1.en.html';
 
 my $str = do { local $/; <STDIN> };
 my ($title) = ($str =~ /\A([^\n]+)/);
diff --git a/MANIFEST b/MANIFEST
index 47eadad2..46e0e099 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -17,7 +17,6 @@ Documentation/common.perl
 Documentation/dc-dlvr-spam-flow.txt
 Documentation/design_notes.txt
 Documentation/design_www.txt
-Documentation/extman.perl
 Documentation/flow.ge
 Documentation/flow.txt
 Documentation/hosted.txt
diff --git a/Makefile.PL b/Makefile.PL
index 8c8c0235..b7851ada 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -101,23 +101,6 @@ $v->{gz_docs} = [ map { "$_.gz" } (@{$v->{docs}},@{$v->{docs_html}}) ];
 $v->{rsync_docs} = [ @{$v->{gz_docs}}, @{$v->{docs}},
 	@{$v->{docs_html}}, qw(NEWS.atom NEWS.atom.gz)];
 
-# external manpages which we host ourselves, since some packages
-# (currently just Xapian) doesn't host manpages themselves.
-my @xman = qw(copydatabase.1 xapian-compact.1);
-$v->{xdocs} = [ map { "Documentation/.$_.txt" } @xman ];
-$v->{xdocs_html} = [ map { "Documentation/.$_.html" } @xman ];
-for (@{$v->{xdocs}}) {
-	$t->{"$_:"} = [
-		'$(PERL) -w Documentation/extman.perl $@ >$@+',
-		'mv $@+ $@'
-	];
-	my $html = $_;
-	$html =~ s/\.txt\z/.html/;
-	$t->{"$html : $_"} = [ "\$(txt2pre) <$_" ];
-}
-$v->{gz_xdocs} = [ map { "$_.gz" } (@{$v->{xdocs_html}}, @{$v->{xdocs}}) ];
-$v->{rsync_xdocs} = [ @{$v->{gz_xdocs}}, @{$v->{xdocs_html}}, @{$v->{xdocs}} ];
-
 my $TGTS = join("\n", map {;
 	my $tgt_prereq = $_;
 	my $cmds = $t->{$_};

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] doc: switch to man(1) for pod => (text|html)
  2021-11-03 21:01 [PATCH 0/3] another round of doc tweaks Eric Wong
  2021-11-03 21:01 ` [PATCH 1/3] doc: add more 3rd-party refs, use Debian manpages for xapian Eric Wong
@ 2021-11-03 21:01 ` Eric Wong
  2021-11-03 21:01 ` [PATCH 3/3] doc: txt2pre: linkify a add a few more well-known things Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2021-11-03 21:01 UTC (permalink / raw)
  To: meta

pod2text(1) will wrap long .onion URLs and cause resulting HTML
to be linkified improperly.
---
 Documentation/include.mk | 8 ++------
 Makefile.PL              | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/Documentation/include.mk b/Documentation/include.mk
index af5f7f24..bfbc495f 100644
--- a/Documentation/include.mk
+++ b/Documentation/include.mk
@@ -14,17 +14,13 @@ XMLSTARLET = xmlstarlet
 # libgraph-easy-perl from Debian, Graph::Easy from CPAN
 GRAPH_EASY = graph-easy
 
-# same as pod2text
-COLUMNS = 76
-
 INSTALL = install
 PODMAN = pod2man
 PODMAN_OPTS = -v --stderr -d 1993-10-02 -c 'public-inbox user manual'
 PODMAN_OPTS += -r public-inbox.git
 podman = $(PODMAN) $(PODMAN_OPTS)
-PODTEXT = pod2text
-PODTEXT_OPTS = --stderr
-podtext = $(PODTEXT) $(PODTEXT_OPTS)
+
+man2text = COLUMNS=80 MANWIDTH=80 TERM=dumb MANOPT='--nj --nh' man
 
 all:: man
 
diff --git a/Makefile.PL b/Makefile.PL
index b7851ada..fffe30e9 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -72,7 +72,7 @@ for my $i (@sections) {
 		my $pod = "Documentation/$m.pod";
 		my $txt = "Documentation/$m.txt";
 		$t->{"$m.$i : $pod"} = [ "\$(podman) -s$i $pod \$@" ];
-		$t->{"$txt : $pod"} = [ "\$(podtext) $pod \$\@+",
+		$t->{"$txt : $m.$i"} = [ "\$(man2text) ./$m.$i >\$\@+",
 					"touch -r $pod \$\@+",
 					"mv \$\@+ \$@" ];
 		$t->{"Documentation/$m.html : $txt"} = [ "\$(txt2pre) <$txt" ];

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] doc: txt2pre: linkify a add a few more well-known things
  2021-11-03 21:01 [PATCH 0/3] another round of doc tweaks Eric Wong
  2021-11-03 21:01 ` [PATCH 1/3] doc: add more 3rd-party refs, use Debian manpages for xapian Eric Wong
  2021-11-03 21:01 ` [PATCH 2/3] doc: switch to man(1) for pod => (text|html) Eric Wong
@ 2021-11-03 21:01 ` Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2021-11-03 21:01 UTC (permalink / raw)
  To: meta

Maybe these will help folks less familiar with some of these things.
---
 Documentation/txt2pre | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/txt2pre b/Documentation/txt2pre
index def54473..04bc3b0e 100755
--- a/Documentation/txt2pre
+++ b/Documentation/txt2pre
@@ -76,9 +76,10 @@ for (qw[lei(1)
 	$xurls{$n} = "$n.html";
 }
 
-for (qw[make(1) flock(2) setrlimit(2) vfork(2) tmpfs(5)]) {
+for (qw[make(1) flock(2) setrlimit(2) vfork(2) tmpfs(5) inotify(7) unix(7)
+		syslog(3)]) {
 	my ($n, $s) = (/([\w\-]+)\((\d)\)/);
-	$xurls{$_} = "http://www.man7.org/linux/man-pages/man$s/$n.$s.html";
+	$xurls{$_} = "https://www.man7.org/linux/man-pages/man$s/$n.$s.html";
 }
 
 for (qw[git(1)
@@ -132,6 +133,7 @@ $xurls{'cgitrc(5)'} = 'https://git.zx2c4.com/cgit/tree/cgitrc.5.txt';
 $xurls{'prove(1)'} = 'https://perldoc.perl.org/prove.html';
 $xurls{'mbox(5)'} = 'https://manpages.debian.org/stable/mutt/mbox.5.en.html';
 $xurls{'mmdf(5)'} = 'https://manpages.debian.org/stable/mutt/mmdf.5.en.html';
+$xurls{'mutt(1)'} = 'https://manpages.debian.org/stable/mutt/mutt.1.en.html';
 $xurls{'torsocks(1)'} =
 	'https://manpages.debian.org/stable/torsocks/torsocks.1.en.html';
 $xurls{'curl(1)'} = 'https://manpages.debian.org/stable/curl/curl.1.en.html';
@@ -139,6 +141,14 @@ $xurls{'copydatabase(1)'} =
  'https://manpages.debian.org/stable/xapian-tools/copydatabase.1.en.html';
 $xurls{'xapian-compact(1)'} =
  'https://manpages.debian.org/stable/xapian-tools/xapian-compact.1.en.html';
+$xurls{'gzip(1)'} = 'https://manpages.debian.org/stable/gzip/gzip.1.en.html';
+$xurls{'chmod(1)'} =
+	'https://manpages.debian.org/stable/coreutils/chmod.1.en.html';
+$xurls{'kqueue(2)'} =
+	'https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2';
+$xurls{'notmuch(1)'} = 'https://notmuchmail.org/manpages/notmuch-1/';
+$xurls{'mairix(1)'} =
+	'https://manpages.debian.org/stable/mairix/mairix.1.en.html';
 
 my $str = do { local $/; <STDIN> };
 my ($title) = ($str =~ /\A([^\n]+)/);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-03 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 21:01 [PATCH 0/3] another round of doc tweaks Eric Wong
2021-11-03 21:01 ` [PATCH 1/3] doc: add more 3rd-party refs, use Debian manpages for xapian Eric Wong
2021-11-03 21:01 ` [PATCH 2/3] doc: switch to man(1) for pod => (text|html) Eric Wong
2021-11-03 21:01 ` [PATCH 3/3] doc: txt2pre: linkify a add a few more well-known things Eric Wong

Code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

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).