From 31e0d5ff084e2a5a23edfe733c7f047e2440e563 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sat, 16 Jun 2012 09:27:43 +0200 Subject: [PATCH] Actually turn .so's into links --- lib/GrottyParser/GrottyParser.xs | 10 ++++++++++ www/index.pl | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/GrottyParser/GrottyParser.xs b/lib/GrottyParser/GrottyParser.xs index a8ad132..4ec8489 100644 --- a/lib/GrottyParser/GrottyParser.xs +++ b/lib/GrottyParser/GrottyParser.xs @@ -101,6 +101,16 @@ static void flushline(ctx_t *x) { static const char eol[] = "\n"; char *s = x->line, *es = x->line; + // Special-case [[[MANNEDINCLUDE ..]]] directive + if(x->linelen > 20 && *s == '[' && strncmp(s, "[[[MANNEDINCLUDE ", 17) == 0 && strcmp("]]]", s+x->linelen-3) == 0) { + s[x->linelen-3] = 0; + s += 17; + char *fn = strrchr(s, '/'); + fn = fn ? fn+1 : s; + sv_catpvf(x->dest, ">> Included manual page: %s", fn, s); + goto end; + } + if(x->noref) { flushchunk(x, x->line, x->flags, x->line+x->linelen); goto end; diff --git a/www/index.pl b/www/index.pl index a4895c6..5c22d6e 100755 --- a/www/index.pl +++ b/www/index.pl @@ -194,7 +194,7 @@ sub manfmt { # doesn't '.so' it. $c =~ s/^\.so man.macros$//mg; # Other .so's should be handled by the web interface - $c =~ s/^\.so (.+)$/\[\[\[MANDIFF-INCLUDE $1\]\]\]/mg; + $c =~ s/^\.so (.+)$/\[\[\[MANNEDINCLUDE $1\]\]\]/mg; # Disable hyphenation, since that screws up man page references. :-( $c = ".hy 0\n.de hy\n..\n$c";