diff options
author | Martin Smith <martin.smith@nokia.com> | 2011-01-07 07:32:24 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2011-01-07 07:32:24 (GMT) |
commit | f9400e81d6e817eb16651e01bb3710cf8562c926 (patch) | |
tree | c1aa61336f887ebfcdf90c0b25c0469edeb3e63a | |
parent | e3a3ae24e54a4461498ae8185b89bdf429e68574 (diff) | |
download | Qt-f9400e81d6e817eb16651e01bb3710cf8562c926.zip Qt-f9400e81d6e817eb16651e01bb3710cf8562c926.tar.gz Qt-f9400e81d6e817eb16651e01bb3710cf8562c926.tar.bz2 |
qdoc: Replaced many raw-html cases with \div {something}.
-rwxr-xr-x | doc/src/template/style/style.css | 92 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 90 | ||||
-rw-r--r-- | tools/qdoc3/atom.cpp | 7 | ||||
-rw-r--r-- | tools/qdoc3/atom.h | 40 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 4 | ||||
-rw-r--r-- | tools/qdoc3/doc.cpp | 50 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 16 |
7 files changed, 178 insertions, 121 deletions
diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 4005a8a..5f60199 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -198,6 +198,92 @@ clear: right } + #color-white + { + background: #ffffff; + color: #000000; + } + #color-black + { + background: #000000; + color: #ffffff; + } + #color-red + { + background: #ff0000; + color: #000000; + } + #color-darkRed + { + background: #800000; + color: #ffffff; + } + #color-green + { + background: #00ff00; + color: #000000; + } + #color-darkGreen + { + background: #008000; + color: #ffffff; + } + #color-blue + { + background: #0000ff; + color: #ffffff; + } + #color-darkBlue + { + background: #000080; + color: #ffffff; + } + #color-cyan + { + background: #00ffff; + color: #000000; + } + #color-darkCyan + { + background: #008080; + color: #ffffff; + } + #color-magenta + { + background: #ff00ff; + color: #000000; + } + #color-darkMagenta + { + background: #800080; + color: #ffffff; + } + #color-yellow + { + background: #ffff00; + color: #000000; + } + #color-darkYellow + { + background: #808000; + color: #ffffff; + } + #color-gray + { + background: #a0a0a4; + color: #000000; + } + #color-darkGray + { + background: #808080; + color: #ffffff; + } + #color-lightGray + { + background: #c0c0c0; + color: #000000; + } + span.comment { color: #008B00; @@ -526,7 +612,7 @@ background: url(../images/page.png) no-repeat 100% -60px; overflow: hidden; } - .navTop{ + .navTop{ float:right; display:block; padding-right:15px; @@ -1590,11 +1676,11 @@ word-wrap:break-word; } - .creator .wrap .content ol li { + .creator .wrap .content ol li { background:none; font: inherit; padding-left: 0px; - } + } .creator .wrap .content .descr ol li { margin-left: 45px; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 6b1aa17..060b979 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -231,81 +231,25 @@ /*! \enum Qt::GlobalColor - \raw HTML - <style type="text/css" id="colorstyles"> - #white { background-color: #ffffff; color: #000000 } - #black { background-color: #000000; color: #ffffff } - #red { background-color: #ff0000; color: #000000 } - #darkRed { background-color: #800000; color: #ffffff } - #green { background-color: #00ff00; color: #000000 } - #darkGreen { background-color: #008000; color: #ffffff } - #blue { background-color: #0000ff; color: #ffffff } - #darkBlue { background-color: #000080; color: #ffffff } - #cyan { background-color: #00ffff; color: #000000 } - #darkCyan { background-color: #008080; color: #ffffff } - #magenta { background-color: #ff00ff; color: #000000 } - #darkMagenta { background-color: #800080; color: #ffffff } - #yellow { background-color: #ffff00; color: #000000 } - #darkYellow { background-color: #808000; color: #ffffff } - #gray { background-color: #a0a0a4; color: #000000 } - #darkGray { background-color: #808080; color: #ffffff } - #lightGray { background-color: #c0c0c0; color: #000000 } - </style> - \endraw - Qt's predefined QColor objects: - \value white \raw HTML - White <tt id="white">(#ffffff)</tt> - \endraw - \value black \raw HTML - Black <tt id="black">(#000000)</tt> - \endraw - \value red \raw HTML - Red <tt id="red">(#ff0000)</tt> - \endraw - \value darkRed \raw HTML - Dark red <tt id="darkRed">(#800000)</tt> - \endraw - \value green \raw HTML - Green <tt id="green">(#00ff00)</tt> - \endraw - \value darkGreen \raw HTML - Dark green <tt id="darkGreen">(#008000)</tt> - \endraw - \value blue \raw HTML - Blue <tt id="blue">(#0000ff)</tt> - \endraw - \value darkBlue \raw HTML - Dark blue <tt id="darkBlue">(#000080)</tt> - \endraw - \value cyan \raw HTML - Cyan <tt id="cyan">(#00ffff)</tt> - \endraw - \value darkCyan \raw HTML - Dark cyan <tt id="darkCyan">(#008080)</tt> - \endraw - \value magenta \raw HTML - Magenta <tt id="magenta">(#ff00ff)</tt> - \endraw - \value darkMagenta \raw HTML - Dark magenta <tt id="darkMagenta">(#800080)</tt> - \endraw - \value yellow \raw HTML - Yellow <tt id="yellow">(#ffff00)</tt> - \endraw - \value darkYellow \raw HTML - Dark yellow <tt id="darkYellow">(#808000)</tt> - \endraw - \value gray \raw HTML - Gray <tt id="gray">(#a0a0a4)</tt> - \endraw - \value darkGray \raw HTML - Dark gray <tt id="darkGray">(#808080)</tt> - \endraw - \value lightGray \raw HTML - Light gray <tt id="lightGray">(#c0c0c0)</tt> - \endraw + \value white \div {id="color-white"} White (#ffffff) \enddiv + \value black \div {id="color-black"} Black (#000000) \enddiv + \value red \div {id="color-red"} Red (#ff0000) \enddiv + \value darkRed \div {id="color-darkRed"} Dark red (#800000) \enddiv + \value green \div {id="color-green"} Green (#00ff00) \enddiv + \value darkGreen \div {id="color-darkGreen"} Dark green (#008000) \enddiv + \value blue \div {id="color-blue"} Blue (#0000ff) \enddiv + \value darkBlue \div {id="color-darkBlue"} Dark blue (#000080) \enddiv + \value cyan \div {id="color-cyan"} Cyan (#00ffff) \enddiv + \value darkCyan \div {id="color-darkCyan"} Dark cyan (#008080) \enddiv + \value magenta \div {id="color-magenta"} Magenta (#ff00ff) \enddiv + \value darkMagenta \div {id="color-darkMagenta"} Dark magenta (#800080) \enddiv + \value yellow \div {id="color-yellow"} Yellow (#ffff00) \enddiv + \value darkYellow \div {id="color-darkYellow"} Dark yellow (#808000) \enddiv + \value gray \div {id="color-gray"} Gray (#a0a0a4) \enddiv + \value darkGray \div {id="color-darkGray"} Dark gray (#808080) \enddiv + \value lightGray \div {id="color-lightGray"} Light gray (#c0c0c0) \enddiv \value transparent a transparent black value (i.e., QColor(0, 0, 0, 0)) \value color0 0 pixel value (for bitmaps) \value color1 1 pixel value (for bitmaps) diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp index 301244d..ef5b6c8 100644 --- a/tools/qdoc3/atom.cpp +++ b/tools/qdoc3/atom.cpp @@ -107,7 +107,8 @@ QString Atom::UPPERROMAN_ ("upperroman"); \value CodeOld \value CodeQuoteArgument \value CodeQuoteCommand - \value Div + \value DivLeft + \value DivRight \value EndQmlText \value FormatElse \value FormatEndif @@ -180,8 +181,8 @@ static const struct { { "CodeOld", Atom::CodeOld }, { "CodeQuoteArgument", Atom::CodeQuoteArgument }, { "CodeQuoteCommand", Atom::CodeQuoteCommand }, - { "Div", Atom::Div }, - { "EndDiv", Atom::EndDiv }, + { "DivLeft", Atom::DivLeft }, + { "DivRight", Atom::DivRight }, #ifdef QDOC_QML { "EndQmlText", Atom::EndQmlText }, #endif diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index a20e057..739d8e3 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -72,15 +72,15 @@ class Atom CodeOld, CodeQuoteArgument, CodeQuoteCommand, - Div, + DivLeft, // 16 + DivRight, // 17 #ifdef QDOC_QML - EndDiv, EndQmlText, #endif FootnoteLeft, - FootnoteRight, + FootnoteRight, // 20 FormatElse, - FormatEndif, // 20 + FormatEndif, FormatIf, FormattingLeft, FormattingRight, @@ -88,30 +88,30 @@ class Atom GuidLink, Image, ImageText, - InlineImage, + InlineImage, // 30 LegaleseLeft, - LegaleseRight, // 30 + LegaleseRight, LineBreak, Link, LinkNode, ListLeft, ListItemNumber, - ListTagLeft, // 36 - ListTagRight, // 37 - ListItemLeft, // 38 - ListItemRight, // 39 - ListRight, // 40 + ListTagLeft, // 38 + ListTagRight, // 39 + ListItemLeft, // 40 + ListItemRight, // 41 + ListRight, // 42 Nop, - ParaLeft, - ParaRight, + ParaLeft, // 44 + ParaRight, // 45 #ifdef QDOC_QML Qml, QmlText, #endif QuotationLeft, QuotationRight, - RawString, - SectionLeft, // 49 + RawString, // 50 + SectionLeft, // 51 SectionRight, SectionHeadingLeft, SectionHeadingRight, @@ -120,9 +120,9 @@ class Atom SinceList, SnippetCommand, SnippetIdentifier, - SnippetLocation, - String, // 59 - TableLeft, // 60 + SnippetLocation, // 60 + String, // 61 + TableLeft, // 62 TableRight, TableHeaderLeft, TableHeaderRight, @@ -130,8 +130,8 @@ class Atom TableRowRight, TableItemLeft, TableItemRight, - TableOfContents, - Target, // 69 + TableOfContents, // 70 + Target, // 71 UnhandledFormat, UnknownCommand, Last = UnknownCommand diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 1595f72..f9c8cc5 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -752,12 +752,12 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writeCharacters(trimmedTrailing(plainCode(atom->string()))); xmlWriter().writeEndElement(); // </codeblock> break; - case Atom::Div: + case Atom::DivLeft: xmlWriter().writeStartElement("sectiondiv"); if (!atom->string().isEmpty()) xmlWriter().writeAttribute("outputclass", atom->string()); break; - case Atom::EndDiv: + case Atom::DivRight: xmlWriter().writeEndElement(); // </sectiondiv> break; case Atom::FootnoteLeft: diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index ce9e30d..4873d8b 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -55,6 +55,7 @@ #include <qregexp.h> #include <ctype.h> #include <limits.h> +#include <qdebug.h> QT_BEGIN_NAMESPACE @@ -368,8 +369,8 @@ class DocParser void appendToCode(const QString &code); void startNewPara(); void enterPara(Atom::Type leftType = Atom::ParaLeft, - Atom::Type rightType = Atom::ParaRight, - const QString& string = ""); + Atom::Type rightType = Atom::ParaRight, + const QString& string = ""); void leavePara(); void leaveValue(); void leaveValueList(); @@ -559,11 +560,26 @@ void DocParser::parse(const QString& source, break; #endif case CMD_DIV: - leavePara(); x = getArgument(true); - append(Atom::Div, x); - openedCommands.push(cmd); - enterPara(); + leavePara(); + enterPara(Atom::DivLeft, Atom::DivRight,x); +#if 0 + if (x.contains('=')) { + leavePara(); + enterPara(Atom::DivLeft, Atom::DivRight,x); + } + else { + leavePara(); + append(Atom::DivLeft, x); + openedCommands.push(cmd); + enterPara(); + } +#endif + break; + case CMD_ENDDIV: + leavePara(); + // append(Atom::DivRight); + // closeCommand(cmd); break; case CMD_CODELINE: { @@ -632,11 +648,6 @@ void DocParser::parse(const QString& source, case CMD_ENDCODE: closeCommand(cmd); break; - case CMD_ENDDIV: - leavePara(); - append(Atom::EndDiv); - closeCommand(cmd); - break; #ifdef QDOC_QML case CMD_ENDQML: closeCommand(cmd); @@ -1806,8 +1817,18 @@ void DocParser::parseAlso() } } +//static bool debug = false; + void DocParser::append(Atom::Type type, const QString &string) { +#if 0 + if (type == Atom::DivLeft) + debug = true; + if (debug) + qDebug() << type << string; + if (type == Atom::DivRight) + debug = false; +#endif Atom::Type lastType = priv->text.lastAtom()->type(); #ifdef QDOC_QML if (((lastType == Atom::Code) || (lastType == Atom::Code)) && @@ -1865,15 +1886,16 @@ void DocParser::enterPara(Atom::Type leftType, const QString& string) { if (paraState == OutsidePara) { - if (priv->text.lastAtom()->type() != Atom::ListItemLeft) + if ((priv->text.lastAtom()->type() != Atom::ListItemLeft) && + (priv->text.lastAtom()->type() != Atom::DivLeft)) { leaveValueList(); + } append(leftType, string); indexStartedPara = false; pendingParaLeftType = leftType; pendingParaRightType = rightType; pendingParaString = string; - if ( - leftType == Atom::SectionHeadingLeft) { + if (leftType == Atom::SectionHeadingLeft) { paraState = InsideSingleLinePara; } else { diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 948a7d6..1ddc0b9 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -511,13 +511,20 @@ int HtmlGenerator::generateAtom(const Atom *atom, << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string())))) << "</pre>\n"; break; - case Atom::Div: + case Atom::DivLeft: out() << "<div"; - if (!atom->string().isEmpty()) - out() << " class=\"" << atom->string() << "\">"; + if (!atom->string().isEmpty()) { + if (atom->string().contains('=')) + out() << " " << atom->string() << ">"; + else + out() << " class=\"" << atom->string() << "\">"; + } else out() << ">"; break; + case Atom::DivRight: + out() << "</div>"; + break; case Atom::FootnoteLeft: // ### For now if (in_para) { @@ -1136,9 +1143,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "<b class=\"redFont\"><code>\\" << protectEnc(atom->string()) << "</code></b>"; break; - case Atom::EndDiv: - out() << "</div>"; - break; #ifdef QDOC_QML case Atom::QmlText: case Atom::EndQmlText: |