From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- src/cmd/troff2html/troff2html.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/cmd/troff2html') diff --git a/src/cmd/troff2html/troff2html.c b/src/cmd/troff2html/troff2html.c index 1bb40cff..20d48d1f 100644 --- a/src/cmd/troff2html/troff2html.c +++ b/src/cmd/troff2html/troff2html.c @@ -1,6 +1,7 @@ #include #include #include +#include enum{ Nfont = 11, @@ -430,19 +431,28 @@ flush(void) void header(char *s) { + char *p; + Bprint(&bout, "\n"); - Bprint(&bout, "%s\n", s); + if(pagename && section){ + char buf[512]; + strecpy(buf, buf+sizeof buf, pagename); + for(p=buf; *p; p++) + *p = tolower(*p); + Bprint(&bout, "%s(%s) - %s\n", buf, section, s); + }else + Bprint(&bout, "%s\n", s); Bprint(&bout, "\n"); Bprint(&bout, "\n"); Bprint(&bout, "\n"); - Bprint(&bout, "\n"); + Bprint(&bout, "
\n"); Bprint(&bout, "
\n"); - Bprint(&bout, "
\n"); + Bprint(&bout, "
\n"); if(pagename && section){ Bprint(&bout, "
%s(%s)%s(%s)\n", pagename, section, pagename, section); } - Bprint(&bout, "
\n"); + Bprint(&bout, "
\n"); } void @@ -605,15 +615,27 @@ xcmd(Biobuf *b) if(strcmp(fld[3], "start") == 0){ /* set anchor attribute and remember string */ attr |= (1<", + "", fld[5][1], fld[4]); +#else + snprint(buf, sizeof buf, + "", fld[5][1], fld[4]); +#endif nanchors++; anchors = erealloc(anchors, nanchors*sizeof(char*)); anchors[nanchors-1] = estrdup(buf); }else if(strcmp(fld[3], "end") == 0) attr &= ~(1<= 4 && strcmp(fld[2], "href") == 0){ + attr |= 1<", fld[3]); + }else if(strcmp(fld[2], "/href") == 0){ + attr &= ~(1<