diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2009-12-30 13:28:15 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2009-12-30 13:28:15 (GMT) |
commit | 05b70e8e2c6e0cda9b74fc99fd782d1977d298c9 (patch) | |
tree | e73e0b41d708a8ea6260e541347b464cb2e5aeaa /src | |
parent | e32567534d95ff3960fa4dcad7733c18e1b39bc5 (diff) | |
download | Doxygen-05b70e8e2c6e0cda9b74fc99fd782d1977d298c9.zip Doxygen-05b70e8e2c6e0cda9b74fc99fd782d1977d298c9.tar.gz Doxygen-05b70e8e2c6e0cda9b74fc99fd782d1977d298c9.tar.bz2 |
Release-1.6.2
Diffstat (limited to 'src')
-rw-r--r-- | src/commentcnv.l | 11 | ||||
-rw-r--r-- | src/config.l | 17 | ||||
-rw-r--r-- | src/config.xml | 17 | ||||
-rw-r--r-- | src/configoptions.cpp | 23 | ||||
-rw-r--r-- | src/docparser.h | 1 | ||||
-rw-r--r-- | src/doxygen.cpp | 6 | ||||
-rw-r--r-- | src/doxygen.css | 31 | ||||
-rw-r--r-- | src/doxygen_css.h | 31 | ||||
-rw-r--r-- | src/eclipsehelp.cpp | 200 | ||||
-rw-r--r-- | src/eclipsehelp.h | 78 | ||||
-rw-r--r-- | src/htmldocvisitor.cpp | 52 | ||||
-rw-r--r-- | src/index.cpp | 10 | ||||
-rw-r--r-- | src/libdoxygen.pro.in | 2 | ||||
-rw-r--r-- | src/pagedef.cpp | 3 | ||||
-rw-r--r-- | src/util.cpp | 15 | ||||
-rw-r--r-- | src/util.h | 1 |
16 files changed, 449 insertions, 49 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index c18605d..f482d52 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -370,8 +370,8 @@ void replaceComment(int offset); BEGIN(CComment); } } -<CComment>[ \t]+"{@code" { - copyToOutput(" @code",6); +<CComment>"{@code"/[ \t\n] { + copyToOutput("@code",5); g_lastCommentContext = YY_START; g_javaBlock=1; g_blockName=&yytext[1]; @@ -426,6 +426,7 @@ void replaceComment(int offset); else { g_javaBlock++; + copyToOutput(yytext,yyleng); } } <VerbatimCode>"}" { @@ -441,6 +442,10 @@ void replaceComment(int offset); copyToOutput(" @endcode ",10); BEGIN(g_lastCommentContext); } + else + { + copyToOutput(yytext,yyleng); + } } } <VerbatimCode>[\\@]("enddot"|"endcode"|"endmsc") { /* end of verbatim block */ @@ -492,7 +497,7 @@ void replaceComment(int offset); copyToOutput(yytext,yyleng); } -<CComment>[^\\!@*\n]* { /* anything that is not a '*' or command */ +<CComment>[^\\!@*\n{]* { /* anything that is not a '*' or command */ copyToOutput(yytext,yyleng); } <CComment>"*"+[^*/\\@\n]* { /* stars without slashes */ diff --git a/src/config.l b/src/config.l index 62e3d7c..c1a4726 100644 --- a/src/config.l +++ b/src/config.l @@ -1361,26 +1361,17 @@ void Config::check() // check QHP creation requirements if (Config_getBool("GENERATE_QHP")) { - bool qhp=TRUE; - if (!Config_getBool("GENERATE_HTML")) - { - config_err("Error: GENERATE_QHP=YES requires GENERATE_HTML=YES. Disabling QHP output.\n"); - qhp=FALSE; - } - if (Config_getString("QHP_NAMESPACE").isEmpty()) { - config_err("Error: GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Disabling QHP output.\n"); - qhp=FALSE; + config_err("Error: GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Using 'org.doxygen.doc' as default!.\n"); + Config_getString("QHP_NAMESPACE")="org.doxygen.doc"; } if (Config_getString("QHP_VIRTUAL_FOLDER").isEmpty()) { - config_err("Error: GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Disabling QHP output.\n"); - qhp=FALSE; + config_err("Error: GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n"); + Config_getString("QHP_VIRTUAL_FOLDER")="doc"; } - - Config_getBool("GENERATE_QHP")=qhp; } if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO")) diff --git a/src/config.xml b/src/config.xml index e4c7cba..62b3438 100644 --- a/src/config.xml +++ b/src/config.xml @@ -861,7 +861,7 @@ The path specified is relative to the HTML output folder. The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help Project output. For more information please see http://doc.trolltech.com/qthelpproject.html#namespace -' defval='' depends='GENERATE_QHP'/> +' defval='org.doxygen.Project' depends='GENERATE_QHP'/> <option type='string' id='QHP_VIRTUAL_FOLDER' format='string' docs=' The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt Help Project output. For more information please see @@ -887,6 +887,21 @@ be used to specify the location of Qt's qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the generated .qhp file. ' defval='' depends='GENERATE_QHP'/> + <option type='bool' id='GENERATE_ECLIPSEHELP' docs=' +If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +will be generated, which together with the HTML files, form an Eclipse help +plugin. To install this plugin and make it available under the help contents +menu in Eclipse, the contents of the directory containing the HTML and XML +files needs to be copied into the plugins directory of eclipse. The name of +the directory within the plugins directory should be the same as +the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +the help appears. +' defval='0' depends='GENERATE_HTML'/> + <option type='string' id='ECLIPSE_DOC_ID' docs=' +A unique identifier for the eclipse help plugin. When installing the plugin +the directory name containing the HTML and XML files should also have +this name. +' defval='org.doxygen.Project' depends='GENERATE_ECLIPSEHELP'/> <option type='bool' id='DISABLE_INDEX' docs=' The DISABLE_INDEX tag can be used to turn on/off the condensed index at top of each HTML page. The value NO (the default) enables the index and diff --git a/src/configoptions.cpp b/src/configoptions.cpp index 6ec5151..3233bef 100644 --- a/src/configoptions.cpp +++ b/src/configoptions.cpp @@ -1253,6 +1253,7 @@ void addConfigOptions(Config *cfg) "Qt Help Project output. For more information please see\n" "http://doc.trolltech.com/qthelpproject.html#namespace" ); + cs->setDefaultValue("org.doxygen.Project"); cs->addDependency("GENERATE_QHP"); //---- cs = cfg->addString( @@ -1298,6 +1299,28 @@ void addConfigOptions(Config *cfg) cs->addDependency("GENERATE_QHP"); //---- cb = cfg->addBool( + "GENERATE_ECLIPSEHELP", + "If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files\n" + " will be generated, which together with the HTML files, form an Eclipse help\n" + " plugin. To install this plugin and make it available under the help contents\n" + "menu in Eclipse, the contents of the directory containing the HTML and XML\n" + "files needs to be copied into the plugins directory of eclipse. The name of\n" + "the directory within the plugins directory should be the same as\n" + "the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.", + FALSE + ); + cb->addDependency("GENERATE_HTML"); + //---- + cs = cfg->addString( + "ECLIPSE_DOC_ID", + "A unique identifier for the eclipse help plugin. When installing the plugin\n" + "the directory name containing the HTML and XML files should also have\n" + "this name." + ); + cs->setDefaultValue("org.doxygen.Project"); + cs->addDependency("GENERATE_ECLIPSEHELP"); + //---- + cb = cfg->addBool( "DISABLE_INDEX", "The DISABLE_INDEX tag can be used to turn on/off the condensed index at\n" "top of each HTML page. The value NO (the default) enables the index and\n" diff --git a/src/docparser.h b/src/docparser.h index 433aea9..5483d20 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -1171,6 +1171,7 @@ class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode void markFirst(bool v=TRUE) { m_isFirst=v; } void markLast(bool v=TRUE) { m_isLast=v; } const HtmlAttribList &attribs() const { return m_attribs; } + const QList<DocNode> &children() const { return m_children; } int parse(); int parseXml(); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index fdb170f..5d590d3 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1,8 +1,5 @@ /****************************************************************************** * - * - * - * * Copyright (C) 1997-2008 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its @@ -79,6 +76,7 @@ #include "portable.h" #include "vhdlscanner.h" #include "vhdldocgen.h" +#include "eclipsehelp.h" #include "layout.h" @@ -10196,9 +10194,11 @@ void generateOutput() if (Config_getBool("GENERATE_INDEXLOG")) Doxygen::indexList.addIndex(new IndexLog); #endif bool generateHtmlHelp = Config_getBool("GENERATE_HTMLHELP"); + bool generateEclipseHelp = Config_getBool("GENERATE_ECLIPSEHELP"); bool generateQhp = Config_getBool("GENERATE_QHP"); bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); bool generateDocSet = Config_getBool("GENERATE_DOCSET"); + if (generateEclipseHelp) Doxygen::indexList.addIndex(new EclipseHelp); if (generateHtmlHelp) Doxygen::indexList.addIndex(new HtmlHelp); if (generateQhp) Doxygen::indexList.addIndex(new Qhp); if (generateTreeView) Doxygen::indexList.addIndex(new FTVHelp); diff --git a/src/doxygen.css b/src/doxygen.css index d00bc53..b057a92 100644 --- a/src/doxygen.css +++ b/src/doxygen.css @@ -31,7 +31,7 @@ div.multicol { -webkit-column-count: 3; } -p.startli, p.startdd { +p.startli, p.startdd, p.starttd { margin-top: 2px; } @@ -43,6 +43,10 @@ p.enddd { margin-bottom: 4px; } +p.endtd { + margin-bottom: 2px; +} + /* @end */ caption { @@ -115,9 +119,11 @@ a.elRef { } a.code { + color: #3030f0; } a.codeRef { + color: #3030f0; } /* @end */ @@ -136,6 +142,10 @@ pre.fragment { background-color: #f5f5f5; padding: 4px 6px; margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; } div.ah { @@ -501,3 +511,22 @@ address { font-style: normal; color: #333; } + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #153788; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #254798; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + diff --git a/src/doxygen_css.h b/src/doxygen_css.h index 076aa7c..b3ae195 100644 --- a/src/doxygen_css.h +++ b/src/doxygen_css.h @@ -31,7 +31,7 @@ " -webkit-column-count: 3;\n" "}\n" "\n" -"p.startli, p.startdd {\n" +"p.startli, p.startdd, p.starttd {\n" " margin-top: 2px;\n" "}\n" "\n" @@ -43,6 +43,10 @@ " margin-bottom: 4px;\n" "}\n" "\n" +"p.endtd {\n" +" margin-bottom: 2px;\n" +"}\n" +"\n" "/* @end */\n" "\n" "caption {\n" @@ -115,9 +119,11 @@ "}\n" "\n" "a.code {\n" +" color: #3030f0;\n" "}\n" "\n" "a.codeRef {\n" +" color: #3030f0;\n" "}\n" "\n" "/* @end */\n" @@ -136,6 +142,10 @@ " background-color: #f5f5f5;\n" " padding: 4px 6px;\n" " margin: 4px 8px 4px 2px;\n" +" overflow: auto;\n" +" word-wrap: break-word;\n" +" font-size: 9pt;\n" +" line-height: 125%;\n" "}\n" "\n" "div.ah {\n" @@ -501,3 +511,22 @@ " font-style: normal;\n" " color: #333;\n" "}\n" +"\n" +"table.doxtable {\n" +" border-collapse:collapse;\n" +"}\n" +"\n" +"table.doxtable td, table.doxtable th {\n" +" border: 1px solid #153788;\n" +" padding: 3px 7px 2px;\n" +"}\n" +"\n" +"table.doxtable th {\n" +" background-color: #254798;\n" +" color: #FFFFFF;\n" +" font-size: 110%;\n" +" padding-bottom: 4px;\n" +" padding-top: 5px;\n" +" text-align:left;\n" +"}\n" +"\n" diff --git a/src/eclipsehelp.cpp b/src/eclipsehelp.cpp new file mode 100644 index 0000000..1887089 --- /dev/null +++ b/src/eclipsehelp.cpp @@ -0,0 +1,200 @@ +/****************************************************************************** + * + * Copyright (C) 1997-2009 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ +#include "eclipsehelp.h" +#include "util.h" +#include "config.h" +#include "message.h" +#include "doxygen.h" + +EclipseHelp::EclipseHelp() : m_depth(0), m_endtag(FALSE), m_tocfile(0) +{ +} + +EclipseHelp::~EclipseHelp() +{ +} + +void EclipseHelp::indent() +{ + int i; + for (i=0; i<m_depth; i++) + { + m_tocstream << " "; + } +} + +void EclipseHelp::closedTag() +{ + if (m_endtag) + { + m_tocstream << "/>" << endl; + m_endtag = FALSE; + } +} + +void EclipseHelp::openedTag() +{ + if (m_endtag) + { + m_tocstream << ">" << endl; + m_endtag = FALSE; + } +} + +/*! + * \brief Initialize the Eclipse generator + * + * This method opens the XML TOC file and writes headers of the files. + * \sa finalize() + */ +void EclipseHelp::initialize() +{ + // -- read path prefix from the configuration + //m_pathprefix = Config_getString("ECLIPSE_PATHPREFIX"); + //if (m_pathprefix.isEmpty()) m_pathprefix = "html/"; + + // -- open the contents file + QCString name = Config_getString("HTML_OUTPUT") + "/toc.xml"; + m_tocfile = new QFile(name); + if (!m_tocfile->open(IO_WriteOnly)) + { + err("Could not open file %s for writing\n", name.data()); + exit(1); + } + + // -- initialize its text stream + m_tocstream.setDevice(m_tocfile); + m_tocstream.setEncoding(QTextStream::UnicodeUTF8); + + // -- write the opening tag + QCString title = Config_getString("PROJECT_NAME"); + if (title.isEmpty()) + { + title = "Doxygen generated documentation"; + } + m_tocstream << "<toc label=\"" << convertToXML(title) << "\">" << endl; + ++ m_depth; +} + +/*! + * \brief Finish generation of the Eclipse specific help files + * + * This method writes footers of the files and closes them. + * \sa initialize() + */ +void EclipseHelp::finalize() +{ + closedTag(); // -- close previous tag + + // -- write ending tag + --m_depth; + m_tocstream << "</toc>" << endl; + + // -- close the content file + m_tocstream.unsetDevice(); + m_tocfile->close(); + delete m_tocfile; m_tocfile = 0; + + QCString name = Config_getString("HTML_OUTPUT") + "/plugin.xml"; + QFile pluginFile(name); + if (pluginFile.open(IO_WriteOnly)) + { + QString docId = Config_getString("ECLIPSE_DOC_ID"); + QTextStream t(&pluginFile); + t << "<plugin name=\"" << docId << "\" id=\"" << docId << "\"" << endl; + t << " version=\"1.0.0\" provider-name=\"Doxygen\">" << endl; + t << " <extension point=\"org.eclipse.help.toc\">" << endl; + t << " <toc file=\"toc.xml\" primary=\"true\" />" << endl; + t << " </extension>" << endl; + t << "</plugin>" << endl; + } +} + +/*! + * \brief Increase the level of content hierarchy + */ +void EclipseHelp::incContentsDepth() +{ + openedTag(); + ++m_depth; +} + +/*! + * \brief Decrease the level of content hierarchy + * + * It closes currently opened topic tag. + */ +void EclipseHelp::decContentsDepth() +{ + // -- end of the opened topic + closedTag(); + --m_depth; + indent(); + m_tocstream << "</topic>" << endl; +} + +/*! + * \brief Add an item to the content + * + * @param isDir Flag whether the argument \a file is a directory or a file entry + * @param name Name of the item + * @param ref URL of the item + * @param file Name of a file which the item is defined in (without extension) + * @param anchor Name of an anchor of the item. + */ +void EclipseHelp::addContentsItem( + bool isDir, + const char *name, + const char * /* ref */, + const char *file, + const char *anchor) +{ + // -- write the topic tag + closedTag(); + indent(); + m_tocstream << "<topic label=\"" << convertToXML(name) << "\""; + if (!isDir && file) + { // -- Eclipse help cannot handle directories + m_tocstream << " href=\"" << convertToXML(m_pathprefix) + << file << Doxygen::htmlFileExtension; + if (anchor) + { + m_tocstream << "#" << anchor; + } + m_tocstream << "\""; + } + m_endtag = TRUE; +} + +void EclipseHelp::addIndexItem( + Definition * /* context */, + MemberDef * /* md */, + const char * /* anchor */, + const char * /* word */) +{ +} + +void EclipseHelp::addIndexFile(const char * /* name */) +{ +} + +void EclipseHelp::addImageFile(const char * /* name */) +{ +} + +void EclipseHelp::addStyleSheetFile(const char * /* name */) +{ +} + diff --git a/src/eclipsehelp.h b/src/eclipsehelp.h new file mode 100644 index 0000000..e0c3a34 --- /dev/null +++ b/src/eclipsehelp.h @@ -0,0 +1,78 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2008 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ +/* + * eclipsehelp.h + * + * Created on: 7.11.2009 + * Author: ondrej + */ + +#ifndef ECLIPSEHELP_H +#define ECLIPSEHELP_H + +#include "qtbc.h" +#include "index.h" +#include <qtextstream.h> + +/* -- forward declarations */ +class QFile; + +/*! + * \brief Generator of Eclipse help files + * + * This class generates the Eclipse specific help files. + * These files can be used to generate a help plugin readable + * by the Eclipse IDE. + */ +class EclipseHelp : public IndexIntf +{ + public: + EclipseHelp(); + virtual ~EclipseHelp(); + + /* -- index interface */ + virtual void initialize(); + virtual void finalize(); + virtual void incContentsDepth(); + virtual void decContentsDepth(); + virtual void addContentsItem(bool isDir, const char *name, const char *ref = 0, + const char *file = 0, const char *anchor = 0); + virtual void addIndexItem(Definition *context,MemberDef *md, + const char *anchor,const char *word); + virtual void addIndexFile(const char *name); + virtual void addImageFile(const char *name); + virtual void addStyleSheetFile(const char *name); + + private: + int m_depth; + bool m_endtag; + + QFile * m_tocfile; + QTextStream m_tocstream; + QCString m_pathprefix; + + /* -- avoid copying */ + EclipseHelp(const EclipseHelp &); + EclipseHelp & operator = (const EclipseHelp &); + + /* -- formatting helpers */ + void indent(); + void closedTag(); + void openedTag(); +}; + +#endif /* ECLIPSEHELP_H */ diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 49a0de2..cfe1bd8 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -619,7 +619,7 @@ bool isSeparatedParagraph(DocSimpleSect *parent,DocPara *par) return FALSE; } -int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast) +static int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast) { int t=0; isFirst=FALSE; @@ -664,6 +664,12 @@ int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast) if (isFirst) t=2; if (isLast) t=4; break; + case DocNode::Kind_HtmlCell: + isFirst=isFirstChildNode((DocHtmlCell*)p->parent(),p); + isLast =isLastChildNode ((DocHtmlCell*)p->parent(),p); + if (isFirst) t=5; + if (isLast) t=6; + break; case DocNode::Kind_SimpleSect: isFirst=isFirstChildNode((DocSimpleSect*)p->parent(),p); isLast =isLastChildNode ((DocSimpleSect*)p->parent(),p); @@ -741,12 +747,14 @@ void HtmlDocVisitor::visitPre(DocPara *p) // this allows us to mark the tag with a special class so we can // fix the otherwise ugly spacing. int t; - static const char *contexts[5] = - { "", - " class=\"startli\"", - " class=\"startdd\"", - " class=\"endli\"", - " class=\"enddd\"" + static const char *contexts[7] = + { "", // 0 + " class=\"startli\"", // 1 + " class=\"startdd\"", // 2 + " class=\"endli\"", // 3 + " class=\"enddd\"", // 4 + " class=\"starttd\"", // 5 + " class=\"endtd\"" // 6 }; bool isFirst; bool isLast; @@ -1025,24 +1033,24 @@ void HtmlDocVisitor::visitPost(DocHtmlDescData *) void HtmlDocVisitor::visitPre(DocHtmlTable *t) { if (m_hide) return; - bool hasBorder = FALSE; - bool hasCellSpacing = FALSE; - bool hasCellPadding = FALSE; + //bool hasBorder = FALSE; + //bool hasCellSpacing = FALSE; + //bool hasCellPadding = FALSE; forceEndParagraph(t); - HtmlAttribListIterator li(t->attribs()); - HtmlAttrib *att; - for (li.toFirst();(att=li.current());++li) - { - if (att->name=="border") hasBorder=TRUE; - else if (att->name=="cellspacing") hasCellSpacing=TRUE; - else if (att->name=="cellpadding") hasCellPadding=TRUE; - } - m_t << "<table" << htmlAttribsToString(t->attribs()); - if (!hasBorder) m_t << " border=\"1\""; - if (!hasCellSpacing) m_t << " cellspacing=\"3\""; - if (!hasCellPadding) m_t << " cellpadding=\"3\""; + //HtmlAttribListIterator li(t->attribs()); + //HtmlAttrib *att; + //for (li.toFirst();(att=li.current());++li) + //{ + // if (att->name=="border") hasBorder=TRUE; + // else if (att->name=="cellspacing") hasCellSpacing=TRUE; + // else if (att->name=="cellpadding") hasCellPadding=TRUE; + //} + m_t << "<table class=\"doxtable\"" << htmlAttribsToString(t->attribs()); + //if (!hasBorder) m_t << " border=\"1\""; + //if (!hasCellSpacing) m_t << " cellspacing=\"3\""; + //if (!hasCellPadding) m_t << " cellpadding=\"3\""; m_t << ">\n"; } diff --git a/src/index.cpp b/src/index.cpp index 5f3d341..9becc0d 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2892,7 +2892,7 @@ void writeExampleIndex(OutputList &ol) if (!pd->title().isEmpty()) { ol.writeObjectLink(0,n,0,pd->title()); - Doxygen::indexList.addContentsItem(FALSE,pd->title(),pd->getReference(),n,0); + Doxygen::indexList.addContentsItem(FALSE,filterTitle(pd->title()),pd->getReference(),n,0); } else { @@ -3005,7 +3005,7 @@ void writePageIndex(OutputList &ol) ol.endTypewriter(); } ol.writeString("\n"); - Doxygen::indexList.addContentsItem(hasSubPages,pageTitle,pd->getReference(),pd->getOutputFileBase(),0); + Doxygen::indexList.addContentsItem(hasSubPages,filterTitle(pageTitle),pd->getReference(),pd->getOutputFileBase(),0); writeSubPages(pd); ol.endIndexListItem(); } @@ -3548,7 +3548,7 @@ void writeIndex(OutputList &ol) } else { - title = substitute(Doxygen::mainPage->title(),"%",""); + title = filterTitle(Doxygen::mainPage->title()); } QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index"; @@ -3576,7 +3576,9 @@ void writeIndex(OutputList &ol) { if (Doxygen::mainPage->title().lower()!="notitle") { - ol.docify(Doxygen::mainPage->title()); + ol.parseDoc(Doxygen::mainPage->docFile(),Doxygen::mainPage->docLine(), + Doxygen::mainPage,0,Doxygen::mainPage->title(), + TRUE,FALSE,0,TRUE,FALSE); } } else diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in index bb828cc..6896bd3 100644 --- a/src/libdoxygen.pro.in +++ b/src/libdoxygen.pro.in @@ -42,6 +42,7 @@ HEADERS = bufstr.h \ dot.h \ doxygen.h \ doxygen_css.h \ + eclipsehelp.h \ entry.h \ example.h \ filedef.h \ @@ -173,6 +174,7 @@ SOURCES = ce_lex.cpp \ doctokenizer.cpp \ dot.cpp \ doxygen.cpp \ + eclipsehelp.cpp \ entry.cpp \ filedef.cpp \ filename.cpp \ diff --git a/src/pagedef.cpp b/src/pagedef.cpp index c6b299c..599589b 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -6,6 +6,7 @@ #include "outputlist.h" #include "doxygen.h" #include "language.h" +#include <qregexp.h> PageDef::PageDef(const char *f,int l,const char *n, @@ -156,7 +157,7 @@ void PageDef::writeDocumentation(OutputList &ol) } } - Doxygen::indexList.addIndexItem(this,0,0,title()); + Doxygen::indexList.addIndexItem(this,0,0,filterTitle(title())); } void PageDef::writePageDocumentation(OutputList &ol) diff --git a/src/util.cpp b/src/util.cpp index 8d33369..cdeaaee 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6970,4 +6970,19 @@ bool readInputFile(const char *fileName,BufStr &inBuf) return TRUE; } +// Replace %word by word in title +QCString filterTitle(const QCString &title) +{ + QCString tf; + static QRegExp re("%[A-Z_a-z]"); + int p=0,i,l; + while ((i=re.match(title,p,&l))!=-1) + { + tf+=title.mid(p,i-p); + tf+=title.mid(i+1,l-1); // skip % + p=i+l; + } + tf+=title.right(title.length()-p); + return tf; +} @@ -366,6 +366,7 @@ bool usingTreeIndex(); void stackTrace(); bool readInputFile(const char *fileName,BufStr &inBuf); +QCString filterTitle(const QCString &title); #endif |