/*
- * "$Id: mantohtml.c 5142 2006-02-21 14:52:34Z mike $"
+ * "$Id$"
*
* Man page to HTML conversion program.
*
+ * Copyright 2007-2010 by Apple Inc.
* Copyright 2004-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* 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;
- else if (!strncmp(line, ".SH ", 4) || !strncmp(line, ".Sh ", 4))
+ else if (!strncmp(line, ".SH ", 4) || !strncmp(line, ".SS ", 4))
{
/*
* Grab heading...
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 5142 2006-02-21 14:52:34Z mike $".
+ * End of "$Id$".
*/