]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - man/mantohtml.c
Update svn:keyword properties.
[thirdparty/cups.git] / man / mantohtml.c
index 95544fae357a42056cb0b973a3788cdca4c4c731..13e733697740aa06a8387c910d41b18a861eabc6 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: mantohtml.c 177 2006-06-21 00:20:03Z jlovell $"
+ * "$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:
  *
@@ -32,8 +23,7 @@
  * Include necessary headers.
  */
 
-#include <cups/string.h>
-#include <stdlib.h>
+#include <cups/string-private.h>
 #include <unistd.h>
 
 
@@ -113,17 +103,13 @@ main(int  argc,                           /* I - Number of command-line args */
   * 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;
@@ -162,12 +148,13 @@ main(int  argc,                           /* I - Number of command-line args */
                "\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...
@@ -197,9 +184,9 @@ main(int  argc,                             /* I - Number of command-line args */
         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 == '\"')
@@ -209,7 +196,7 @@ main(int  argc,                             /* I - Number of command-line args */
          else
            putc_entity(*lineptr, outfile);
 
-       fputs("'>", outfile);
+       fputs("\">", outfile);
 
         for (lineptr = line + 4; *lineptr; lineptr ++)
          if (*lineptr == '\"')
@@ -294,7 +281,7 @@ main(int  argc,                             /* I - Number of command-line args */
         * Grab line break...
        */
 
-        if (list == 1)
+       if (list == 1)
        {
          fputs("</dt>\n<dd>", outfile);
          list = 2;
@@ -415,7 +402,7 @@ main(int  argc,                             /* I - Number of command-line args */
         * 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))
@@ -649,6 +636,12 @@ process_text:
         fputs(post, outfile);
        post = NULL;
       }
+
+      if (list == 1)
+      {
+       fputs("</dt>\n<dd>", outfile);
+       list = 2;
+      }
     }
   }
 
@@ -657,7 +650,6 @@ process_text:
   if (blist)
   {
     fputs("</li>\n</ul>\n", outfile);
-    blist = 0;
   }
 
   if (list)
@@ -668,7 +660,6 @@ process_text:
       fputs("</dd>\n", outfile);
 
     fputs("</dl>\n", outfile);
-    list = 0;
   }
 
   fputs("</body>\n"
@@ -725,5 +716,5 @@ strmove(char       *d,                      /* I - Destination */
 
 
 /*
- * End of "$Id: mantohtml.c 177 2006-06-21 00:20:03Z jlovell $".
+ * End of "$Id$".
  */