summaryrefslogtreecommitdiffstats
path: root/src/htmlgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/htmlgen.cpp')
-rw-r--r--src/htmlgen.cpp76
1 files changed, 64 insertions, 12 deletions
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index 76c1832..441ec4b 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -25,6 +25,7 @@
#include "doxygen.h"
#include "logos.h"
#include "diagram.h"
+#include "version.h"
#define GROUP_COLOR "#ff8080"
@@ -35,6 +36,7 @@ HtmlGenerator::HtmlGenerator() : OutputGenerator()
if (Config::headerFile.length()>0) header=fileToString(Config::headerFile);
if (Config::footerFile.length()>0) footer=fileToString(Config::footerFile);
dir=Config::htmlOutputDir;
+ col=0;
}
HtmlGenerator::~HtmlGenerator()
@@ -44,6 +46,7 @@ HtmlGenerator::~HtmlGenerator()
void HtmlGenerator::append(const OutputGenerator *g)
{
t << g->getContents();
+ col+=((HtmlGenerator *)g)->col;
}
void HtmlGenerator::init()
@@ -75,19 +78,29 @@ void HtmlGenerator::startFile(const char *name,const char *title,bool external)
t << "doxygen=\"_doc:\" href=\"/";
else
t << "href=\"";
- t << "doxygen.css\" rel=\"stylesheet\" type=\"text/css\">\n"
+ if (Config::htmlStyleSheet.isEmpty())
+ t << "doxygen.css";
+ else
+ t << Config::htmlStyleSheet;
+ t << "\" rel=\"stylesheet\" type=\"text/css\">\n"
"</head><body bgcolor=\"#ffffff\">\n";
}
else
{
t << substitute(
- substitute(
- substitute(header,"$title",lastTitle),
- "$datetime",dateToString(TRUE)
+ substitute(
+ substitute(
+ substitute(header,"$title",lastTitle),
+ "$datetime",dateToString(TRUE)
+ ),
+ "$date",dateToString(FALSE)
),
- "$date",dateToString(FALSE)
+ "$doxygenversion",versionString
);
+
}
+ t << "<!-- Generated by Doxygen " << versionString << " on "
+ << dateToString(TRUE) << " -->" << endl;
}
void HtmlGenerator::startQuickIndexItem(const char *s,const char *l)
@@ -121,8 +134,8 @@ void HtmlGenerator::writeFooter(int part,bool external)
case 1:
if (footer.length()==0)
{
- t << " <a href=\"http://www.stack.nl/~dimitri/doxygen/index.html\">";
- t << "<img ";
+ t << endl << "<a href=\"http://www.stack.nl/~dimitri/doxygen/index.html\">";
+ t << endl << "<img ";
if (external)
{
t << "doxygen=\"_doc:\" src=\"/";
@@ -131,13 +144,14 @@ void HtmlGenerator::writeFooter(int part,bool external)
{
t << "src=\"";
}
- t << "doxygen.gif\" alt=\"doxygen\" align=center border=0 "
- "width=118 height=53></a>&nbsp; ";
+ t << "doxygen.gif\" alt=\"doxygen\" "
+ << "align=center border=0 " << endl <<
+ "width=118 height=53></a> " << versionString <<" ";
}
break;
default:
if (footer.length()==0)
- t << " <a href=\"mailto:dimitri@stack.nl\">Dimitri van Heesch</a>, &copy; "
+ t << " <a href=\"mailto:dimitri@stack.nl\">Dimitri van Heesch</a>,\n &copy; "
"1997-1999</small></address>\n</body>\n</html>\n";
break;
@@ -164,7 +178,6 @@ void HtmlGenerator::writeStyleInfo(int part)
if (part==0)
{
startPlainFile("doxygen.css");
- //<< "H1 { border-width: thin; border: solid; text-align: center }" << endl
t << "H1 { text-align: center }" << endl;
t << "A.el { text-decoration: none; font-weight: bold }" << endl;
t << "DL.el { margin-left: -1cm }" << endl;
@@ -359,7 +372,46 @@ void HtmlGenerator::docify(const char *str)
void HtmlGenerator::codify(const char *str)
{
- docify(str);
+ //docify(str);
+ //static char spaces[]=" ";
+ if (str)
+ {
+ const char *p=str;
+ char c;
+ int spacesToNextTabStop;
+ while (*p)
+ {
+ c=*p++;
+ switch(c)
+ {
+ case '\t': spacesToNextTabStop =
+ Config::tabSize - (col%Config::tabSize);
+ t << spaces.left(spacesToNextTabStop);
+ col+=spacesToNextTabStop;
+ break;
+ case '\n': t << '\n'; col=0;
+ break;
+ case '<': t << "&lt;"; col++;
+ break;
+ case '>': t << "&gt;"; col++;
+ break;
+ case '&': t << "&amp;"; col++;
+ break;
+ case '\\':
+ if (*p=='<')
+ { t << "&lt;"; p++; }
+ else if (*p=='>')
+ { t << "&gt;"; p++; }
+ else
+ t << "\\";
+ col++;
+ break;
+ default: t << c;
+ col++;
+ break;
+ }
+ }
+ }
}
void HtmlGenerator::writeChar(char c)