Actually turn .so's into links
This commit is contained in:
parent
767fbe595d
commit
31e0d5ff08
2 changed files with 11 additions and 1 deletions
|
|
@ -101,6 +101,16 @@ static void flushline(ctx_t *x) {
|
||||||
static const char eol[] = "\n";
|
static const char eol[] = "\n";
|
||||||
char *s = x->line, *es = x->line;
|
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: <a href=\"/%s\">%s</a>", fn, s);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if(x->noref) {
|
if(x->noref) {
|
||||||
flushchunk(x, x->line, x->flags, x->line+x->linelen);
|
flushchunk(x, x->line, x->flags, x->line+x->linelen);
|
||||||
goto end;
|
goto end;
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ sub manfmt {
|
||||||
# doesn't '.so' it.
|
# doesn't '.so' it.
|
||||||
$c =~ s/^\.so man.macros$//mg;
|
$c =~ s/^\.so man.macros$//mg;
|
||||||
# Other .so's should be handled by the web interface
|
# 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. :-(
|
# Disable hyphenation, since that screws up man page references. :-(
|
||||||
$c = ".hy 0\n.de hy\n..\n$c";
|
$c = ".hy 0\n.de hy\n..\n$c";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue