Thread: [Doxygen-develop] [PATCH] HTML validation, sort of
Brought to you by:
dimitri
From: John L. <le...@mo...> - 2002-05-26 04:15:10
|
The patch below removes most of the invalid HTML doxygen CVS currently produces. Some of the changes are obviously correct and "for free", some are mere hacks. You can do what you like with the changes below, this is just what I use to generate : http://oprofile.sourceforge.net/srcdoc/index.html btw, current CVS is doing a poor job of handling std::cerr and the like : http://oprofile.sourceforge.net/srcdoc/hierarchy.html Anyway, hope the patch below is of use to somebody. regards john Index: src/dot.cpp =================================================================== RCS file: /u/kp3softd/cvsroot/src/dot.cpp,v retrieving revision 1.55 diff -u -r1.55 dot.cpp --- src/dot.cpp 2002/05/12 17:38:43 1.55 +++ src/dot.cpp 2002/05/26 04:02:12 @@ -769,11 +769,11 @@ return; } QCString mapLabel = convertNameToFile(n->m_label); - out << "<tr><td><img src=\"" << imgName << "\" border=\"0\" usemap=\"#" - << mapLabel << "_map\"></td></tr>" << endl; + out << "<tr><td><img src=\"" << imgName << "\" border=\"0\" alt=\"\" usemap=\"#" + << mapLabel << "_map\">" << endl; out << "<map name=\"" << mapLabel << "_map\">" << endl; convertMapFile(out,mapName); - out << "</map>" << endl; + out << "</map></td></tr>" << endl; if (Config_getBool("DOT_CLEANUP")) thisDir.remove(dotName); thisDir.remove(mapName); } @@ -1378,9 +1378,15 @@ break; } out << "\"></center>" << endl; - out << "<map name=\"" << mapLabel << "\">" << endl; - convertMapFile(out,baseName+".map"); - out << "</map>" << endl; + QString tmpstr; + QTextOStream tmpout(&tmpstr); + convertMapFile(tmpout,baseName+".map"); + if (!tmpstr.isNull() && tmpstr.length()) + { + out << "<map name=\"" << mapLabel << "\">" << endl; + out << tmpstr; + out << "</map>" << endl; + } thisDir.remove(baseName+".map"); } } @@ -1601,9 +1607,15 @@ if (m_inverse) out << "Included by dependency graph"; else out << "Include dependency graph"; out << "\">"; out << "</center>" << endl; - out << "<map name=\"" << mapName << "_map\">" << endl; - convertMapFile(out,baseName+".map"); - out << "</map>" << endl; + QString tmpstr; + QTextOStream tmpout(&tmpstr); + convertMapFile(tmpout,baseName+".map"); + if (!tmpstr.isNull() && tmpstr.length()) + { + out << "<map name=\"" << mapName << "\">" << endl; + out << tmpstr; + out << "</map>" << endl; + } thisDir.remove(baseName+".map"); } } Index: src/htmlgen.cpp =================================================================== RCS file: /u/kp3softd/cvsroot/src/htmlgen.cpp,v retrieving revision 1.70 diff -u -r1.70 htmlgen.cpp --- src/htmlgen.cpp 2002/03/10 16:02:34 1.70 +++ src/htmlgen.cpp 2002/05/26 04:02:15 @@ -85,13 +85,13 @@ " margin-top : 2px; \n" " margin-bottom : 2px \n" "}\n" -"FONT.keyword { color: #008000 }\n" -"FONT.keywordtype { color: #604020 }\n" -"FONT.keywordflow { color: #e08000 }\n" -"FONT.comment { color: #800000 }\n" -"FONT.preprocessor { color: #806020 }\n" -"FONT.stringliteral { color: #002080 }\n" -"FONT.charliteral { color: #008080 }\n"; +"span.keyword { color: #008000 }\n" +"span.keywordtype { color: #604020 }\n" +"span.keywordflow { color: #e08000 }\n" +"span.comment { color: #800000 }\n" +"span.preprocessor { color: #806020 }\n" +"span.stringliteral { color: #002080 }\n" +"span.charliteral { color: #008080 }\n"; static QCString g_header; @@ -181,7 +181,7 @@ void HtmlGenerator::writeFooterFile(QFile &file) { QTextStream t(&file); - t << "<hr><address align=\"right\"><small>\n"; + t << "<hr><address style=\"align: right;\"><small>\n"; t << theTranslator->trGeneratedAt( "$datetime", "$projectname" ); t << " <a href=\"http://www.doxygen.org/index.html\">\n" << "<img src=\"doxygen.png\" alt=\"doxygen\" " @@ -257,7 +257,7 @@ { case 0: if (g_footer.isEmpty()) - t << "<hr><address align=\"right\"><small>"; + t << "<hr><address style=\"align: right;\"><small>"; else t << substituteKeywords(g_footer,convertToHtml(lastTitle)); break; @@ -340,9 +340,9 @@ } void HtmlGenerator::startDoxyAnchor(const char *,const char *, - const char *anchor, const char *name) + const char *anchor, const char *) { - t << "<a name=\"" << anchor << "\" doxytag=\"" << name << "\"></a>"; + t << "<a name=\"" << anchor << "\"></a>"; } void HtmlGenerator::endDoxyAnchor(const char *,const char *) @@ -519,14 +519,14 @@ void HtmlGenerator::startSection(const char *lab,const char *,bool sub) { - t << "<a name=\"" << lab << "\">"; if (sub) t << "<h3>"; else t << "<h2>"; + t << "<a name=\"" << lab << "\">"; } void HtmlGenerator::endSection(const char *,bool sub) { - if (sub) t << "</h3>"; else t << "</h2>"; t << "</a>" << endl; + if (sub) t << "</h3>"; else t << "</h2>"; } void HtmlGenerator::writeSectionRef(const char *ref,const char *name, @@ -654,7 +654,7 @@ { t << "\n<p><center><img src=\"" << fileName << ".png\" usemap=\"#" << name << "_map\"" - << " border=\"0\"></center>" << endl + << " border=\"0\" alt=\"\"></center>" << endl << "<map name=\"" << name << "_map\">" << endl; d.writeImage(t,dir,fileName); @@ -786,6 +786,8 @@ if (Config_getBool("HTML_ALIGN_MEMBERS")) { t << "<table border=0 cellpadding=0 cellspacing=0>" << endl; + // HTML is not recursively decomposable, sorry + t << "<tr><td></td></tr>" << endl; } } Index: src/htmlgen.h =================================================================== RCS file: /u/kp3softd/cvsroot/src/htmlgen.h,v retrieving revision 1.54 diff -u -r1.54 htmlgen.h --- src/htmlgen.h 2002/04/21 17:23:15 1.54 +++ src/htmlgen.h 2002/05/26 04:02:16 @@ -254,8 +254,8 @@ void startParameterList(); void endParameterList(); - void startFontClass(const char *s) { t << "<font class=\"" << s << "\">"; } - void endFontClass() { t << "</font>"; } + void startFontClass(const char *s) { t << "<span class=\"" << s << "\">"; } + void endFontClass() { t << "</span>"; } void startHtmlOnly() {} void endHtmlOnly() {} Index: src/translator_en.h =================================================================== RCS file: /u/kp3softd/cvsroot/src/translator_en.h,v retrieving revision 1.12 diff -u -r1.12 translator_en.h --- src/translator_en.h 2002/03/17 20:13:30 1.12 +++ src/translator_en.h 2002/05/26 04:02:19 @@ -1072,7 +1072,7 @@ "\\endcode\n" "If the \\c MAX_DOT_GRAPH_HEIGHT tag in the configuration file " "is set to 240 this will result in the following graph:" - "<p><center><img src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" + "<p><center><img alt=\"\" src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" "<p>\n" "The boxes in the above graph have the following meaning:\n" "<ul>\n" |