diff options
author | David Boddie <david.boddie@nokia.com> | 2010-11-28 19:44:21 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-11-28 19:44:21 (GMT) |
commit | 344c3ad32bd36ad67731aa3171103a6c5e2f93e0 (patch) | |
tree | 218e2ae90de49df48f2fc7fc0f9e1ebd6571bf6e /tools/qdoc3/htmlgenerator.cpp | |
parent | b81081ff67d3e27e36c8165c9b0814feca1fcf15 (diff) | |
download | Qt-344c3ad32bd36ad67731aa3171103a6c5e2f93e0.zip Qt-344c3ad32bd36ad67731aa3171103a6c5e2f93e0.tar.gz Qt-344c3ad32bd36ad67731aa3171103a6c5e2f93e0.tar.bz2 |
Added the foundations of QML markup support.
Use the QtDeclarative parser instead of Qt Creator's QML parser.
Split the QML visitor into documentation and markup visitors.
The code marker used for each file is now determined from its extension.
Diffstat (limited to 'tools/qdoc3/htmlgenerator.cpp')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 3f76204..9f5f182 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -217,9 +217,9 @@ HtmlGenerator::HtmlGenerator() threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"), myTree(0), + inObsoleteLink(false), slow(false), - obsoleteLinks(false), - inObsoleteLink(false) + obsoleteLinks(false) { } @@ -356,7 +356,7 @@ QString HtmlGenerator::format() \note The HTML file generation is done in the base class, PageGenerator::generateTree(). */ -void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) +void HtmlGenerator::generateTree(const Tree *tree) { myTree = tree; nonCompatClasses.clear(); @@ -375,11 +375,11 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) findAllNamespaces(tree->root()); findAllSince(tree->root()); - PageGenerator::generateTree(tree, marker); + PageGenerator::generateTree(tree); QString fileBase = project.toLower().simplified().replace(" ", "-"); generateIndex(fileBase, projectUrl, projectDescription); - generatePageIndex(outputDir() + "/" + fileBase + ".pageindex", marker); + generatePageIndex(outputDir() + "/" + fileBase + ".pageindex"); helpProjectWriter->generate(myTree); } @@ -2913,18 +2913,6 @@ void HtmlGenerator::generateLink(const Atom* atom, } inLink = false; out() << protectEnc(atom->string().mid(k)); - } else if (marker->recognizeLanguage("Java")) { - // hack for Java: remove () and use <tt> when appropriate - bool func = atom->string().endsWith("()"); - bool tt = (func || atom->string().contains(camelCase)); - if (tt) - out() << "<tt>"; - if (func) { - out() << protectEnc(atom->string().left(atom->string().length() - 2)); - } else { - out() << protectEnc(atom->string()); - } - out() << "</tt>"; } else { out() << protectEnc(atom->string()); } @@ -4168,12 +4156,14 @@ void HtmlGenerator::generatePageElements(QXmlStreamWriter& writer, const Node* n /*! Outputs the file containing the index used for searching the html docs. */ -void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marker) const +void HtmlGenerator::generatePageIndex(const QString& fileName) const { QFile file(fileName); if (!file.open(QFile::WriteOnly | QFile::Text)) return ; + CodeMarker *marker = CodeMarker::markerForFileName(fileName); + QXmlStreamWriter writer(&file); writer.setAutoFormatting(true); writer.writeStartDocument(); |