/*
- * "$Id: mantohtml.c 7662 2008-06-17 14:34:20Z mike $"
+ * "$Id$"
*
* Man page to HTML conversion program.
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2010 by Apple Inc.
* Copyright 2004-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* Include necessary headers.
*/
-#include <cups/string.h>
-#include <stdlib.h>
+#include <cups/string-private.h>
#include <unistd.h>
* Read from input and write the output...
*/
- fputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" "
- "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
+ fputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" "
+ "\"http://www.w3.org/TR/html4/loose.dtd\">\n"
"<html>\n"
"<!-- SECTION: Man Pages -->\n"
"<head>\n"
- "\t<style type='text/css'><!--\n"
- "\th1, h2, h3, p { font-family: sans-serif; text-align: justify; }\n"
- "\ttt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }\n"
- "\tpre { font-weight: bold; color: #7f0000; margin-left: 2em; }\n"
- "\th1.title, h2.title, h3.title { border-bottom: solid 2px #000000; }\n"
- "\t--></style>\n", outfile);
+ "\t<link rel=\"stylesheet\" type=\"text/css\" "
+ "href=\"../cups-printable.css\">\n", outfile);
blist = 0;
font = 0;
"\t<title>%s(%d)</title>\n"
"</head>\n"
"<body>\n"
+ "<h1 class=\"title\">%s(%d)</h1>\n"
"%s",
- name, section, start_fonts[font]);
+ name, section, name, section, start_fonts[font]);
}
else if (section < 0)
continue;
line[strlen(line) - 1] = '\0'; /* Strip LF */
if (line[2] == 'H')
- fputs("<h2><a name='", outfile);
+ fputs("<h2 class=\"title\"><a name=\"", outfile);
else
- fputs("<h3><a name='", outfile);
+ fputs("<h3><a name=\"", outfile);
for (lineptr = line + 4; *lineptr; lineptr ++)
if (*lineptr == '\"')
else
putc_entity(*lineptr, outfile);
- fputs("'>", outfile);
+ fputs("\">", outfile);
for (lineptr = line + 4; *lineptr; lineptr ++)
if (*lineptr == '\"')
* Grab line break...
*/
- if (list == 1)
+ if (list == 1)
{
fputs("</dt>\n<dd>", outfile);
list = 2;
* Process the text as if it was in-line...
*/
- post = "\n<br />\n<br />";
+ post = "\n<br>\n<br>";
goto process_text;
}
else if (!strncmp(line, ".\\}", 3))
fputs(post, outfile);
post = NULL;
}
+
+ if (list == 1)
+ {
+ fputs("</dt>\n<dd>", outfile);
+ list = 2;
+ }
}
}
if (blist)
{
fputs("</li>\n</ul>\n", outfile);
- blist = 0;
}
if (list)
fputs("</dd>\n", outfile);
fputs("</dl>\n", outfile);
- list = 0;
}
fputs("</body>\n"
/*
- * End of "$Id: mantohtml.c 7662 2008-06-17 14:34:20Z mike $".
+ * End of "$Id$".
*/