diff options
author | Martin Smith <martin.smith@qt.io> | 2017-04-25 11:33:33 +0200 |
---|---|---|
committer | Martin Smith <martin.smith@qt.io> | 2017-08-10 07:35:32 +0000 |
commit | da183316a39979f42070759eecb9062fcf240ac5 (patch) | |
tree | e380bdf4a9c005760d73ffe618f697787eb4f605 | |
parent | 290aeb761e0dfab20f730724925fa2c19280a6b0 (diff) | |
download | qttools-da183316a39979f42070759eecb9062fcf240ac5.tar.gz |
qdoc: Remove chapter and part commands
These commands are not used anywhere, and they cause
qdoc to generate illegal html code, so they are removed.
Change-Id: I39b670a9691221854a78ea5c332c67ea758199ee
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r-- | src/qdoc/doc.cpp | 32 | ||||
-rw-r--r-- | src/qdoc/doc/qdoc-manual-cmdindex.qdoc | 2 | ||||
-rw-r--r-- | src/qdoc/doc/qdoc-manual-markupcmds.qdoc | 127 |
3 files changed, 51 insertions, 110 deletions
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp index d98dfb19d..12b7a4f5f 100644 --- a/src/qdoc/doc.cpp +++ b/src/qdoc/doc.cpp @@ -72,14 +72,12 @@ enum { CMD_BRIEF, CMD_C, CMD_CAPTION, - CMD_CHAPTER, CMD_CODE, CMD_CODELINE, CMD_DIV, CMD_DOTS, CMD_E, CMD_ELSE, - CMD_ENDCHAPTER, CMD_ENDCODE, CMD_ENDDIV, CMD_ENDFOOTNOTE, @@ -89,7 +87,6 @@ enum { CMD_ENDLIST, CMD_ENDMAPREF, CMD_ENDOMIT, - CMD_ENDPART, CMD_ENDQUOTATION, CMD_ENDRAW, CMD_ENDSECTION1, @@ -127,7 +124,6 @@ enum { CMD_OMIT, CMD_OMITVALUE, CMD_OVERLOAD, - CMD_PART, CMD_PRINTLINE, CMD_PRINTTO, CMD_PRINTUNTIL, @@ -188,14 +184,12 @@ static struct { { "brief", CMD_BRIEF, 0 }, { "c", CMD_C, 0 }, { "caption", CMD_CAPTION, 0 }, - { "chapter", CMD_CHAPTER, 0 }, { "code", CMD_CODE, 0 }, { "codeline", CMD_CODELINE, 0}, { "div", CMD_DIV, 0 }, { "dots", CMD_DOTS, 0 }, { "e", CMD_E, 0 }, { "else", CMD_ELSE, 0 }, - { "endchapter", CMD_ENDCHAPTER, 0 }, { "endcode", CMD_ENDCODE, 0 }, { "enddiv", CMD_ENDDIV, 0 }, { "endfootnote", CMD_ENDFOOTNOTE, 0 }, @@ -205,7 +199,6 @@ static struct { { "endlist", CMD_ENDLIST, 0 }, { "endmapref", CMD_ENDMAPREF, 0 }, { "endomit", CMD_ENDOMIT, 0 }, - { "endpart", CMD_ENDPART, 0 }, { "endquotation", CMD_ENDQUOTATION, 0 }, { "endraw", CMD_ENDRAW, 0 }, { "endsection1", CMD_ENDSECTION1, 0 }, // ### don't document for now @@ -243,7 +236,6 @@ static struct { { "omit", CMD_OMIT, 0 }, { "omitvalue", CMD_OMITVALUE, 0 }, { "overload", CMD_OVERLOAD, 0 }, - { "part", CMD_PART, 0 }, { "printline", CMD_PRINTLINE, 0 }, { "printto", CMD_PRINTTO, 0 }, { "printuntil", CMD_PRINTUNTIL, 0 }, @@ -652,9 +644,6 @@ void DocParser::parse(const QString& source, leavePara(); enterPara(Atom::CaptionLeft, Atom::CaptionRight); break; - case CMD_CHAPTER: - startSection(Doc::Chapter, cmd); - break; case CMD_CODE: leavePara(); append(Atom::Code, getCode(CMD_CODE, 0)); @@ -736,9 +725,6 @@ void DocParser::parse(const QString& source, location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_ELSE))); } break; - case CMD_ENDCHAPTER: - endSection(Doc::Chapter, cmd); - break; case CMD_ENDCODE: closeCommand(cmd); break; @@ -805,9 +791,6 @@ void DocParser::parse(const QString& source, case CMD_ENDOMIT: closeCommand(cmd); break; - case CMD_ENDPART: - endSection(Doc::Part, cmd); - break; case CMD_ENDQUOTATION: if (closeCommand(cmd)) { leavePara(); @@ -1103,9 +1086,6 @@ void DocParser::parse(const QString& source, if (!priv->omitEnumItemList.contains(p1)) priv->omitEnumItemList.append(p1); break; - case CMD_PART: - startSection(Doc::Part, cmd); - break; case CMD_PRINTLINE: leavePara(); if (!quoting) @@ -2245,13 +2225,7 @@ Doc::Sections DocParser::getSectioningUnit() { QString name = getOptionalArgument(); - if (name == "part") { - return Doc::Part; - } - else if (name == "chapter") { - return Doc::Chapter; - } - else if (name == "section1") { + if (name == "section1") { return Doc::Section1; } else if (name == "section2") { @@ -2673,8 +2647,6 @@ int DocParser::endCmdFor(int cmd) switch (cmd) { case CMD_BADCODE: return CMD_ENDCODE; - case CMD_CHAPTER: - return CMD_ENDCHAPTER; case CMD_CODE: return CMD_ENDCODE; case CMD_DIV: @@ -2699,8 +2671,6 @@ int DocParser::endCmdFor(int cmd) return CMD_NEWCODE; case CMD_OMIT: return CMD_ENDOMIT; - case CMD_PART: - return CMD_ENDPART; case CMD_QUOTATION: return CMD_ENDQUOTATION; case CMD_RAW: diff --git a/src/qdoc/doc/qdoc-manual-cmdindex.qdoc b/src/qdoc/doc/qdoc-manual-cmdindex.qdoc index feac8816a..85f5f75d9 100644 --- a/src/qdoc/doc/qdoc-manual-cmdindex.qdoc +++ b/src/qdoc/doc/qdoc-manual-cmdindex.qdoc @@ -46,7 +46,6 @@ \li \l {brief-command} {\\brief} \li \l {c-command} {\\c} \li \l {caption-command} {\\caption} - \li \l {chapter-command} {\\chapter} \li \l {class-command} {\\class} \li \l {code-command} {\\code} \li \l {codeline-command} {\\codeline} @@ -101,7 +100,6 @@ \li \l {omitvalue-command} {\\omitvalue} \li \l {overload-command} {\\overload} \li \l {page-command} {\\page} - \li \l {part-command} {\\part} \li \l {preliminary-command} {\\preliminary} \li \l {previouspage-command} {\\previouspage} \li \l {printline-command} {\\printline} diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc index 6e1951666..c85a1c2ff 100644 --- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc @@ -45,7 +45,6 @@ \li \l {brief-command} {\\brief} \li \l {c-command} {\\c} \li \l {caption-command} {\\caption} - \li \l {chapter-command} {\\chapter} \li \l {code-command} {\\code} \li \l {codeline-command} {\\codeline} \li \l {div-command} {\\div} @@ -74,7 +73,6 @@ \li \l {note-command} {\\note} \li \l {oldcode-command} {\\oldcode} \li \l {omit-command} {\\omit} - \li \l {part-command} {\\part} \li \l {printline-command} {\\printline} \li \l {printto-command} {\\printto} \li \l {printuntil-command} {\\printuntil} @@ -730,17 +728,13 @@ \title Document Structure The document structuring commands are for dividing your document - into sections. QDoc supports six kinds of sections: \c \part, \c - \chapter, \c \section1, \c \section2, \c \section3, and \c - \section4. The \c \section1..4 commands are the most useful. They + into sections. QDoc supports four levels of section: \c \section1, + \c \section2, \c \section3, and \c \section4. The section commands correspond to the traditional section, subsection, etc used in outlining. - \target part-command - \section1 \\part - - The \\part command is intended for use in a large document, like a - book. + \target section-commands + \section1 Section commands In general a document structuring command considers everything that follows it until the first line break as its argument. The @@ -748,88 +742,77 @@ spanned over several lines, make sure that each line (except the last one) is ended with a backslash. - In total, there are six levels of sections in QDoc: \c \part, \c - \chapter, \c \section1, \c \section2, \c \section3 and \c - \section4. \c \section1 to \c \section4 correspond to the - traditional section, subsection, subsubsection and - subsubsubsection. + In total, there are four levels for sections in QDoc: \c \section1, + \c \section2, \c \section3 and \c \section4. These correspond to the + traditional section, subsection, subsubsection and subsubsubsection. There is a strict ordering of the section units: \code - part - | - chapter - | - section1 - | - section2 - | - section3 - | - section4 + section1 + | + section2 + | + section3 + | + section4 \endcode - For example, a \c section1 unit can only appear as the top level - section or inside a \c chapter unit. Skipping a section unit, for - example from \c part to \c section1, is not allowed. - - You can \e begin with either of the three: \c part, \c chapter or - \c section1. + When sections are used, the first section command should be \c section1. \code / *! - \part Basic Qt + \section1 Basic Qt - This is the first part. + This is the first section. - \chapter Getting Started + \section2 Getting Started - This is the first part's first chapter. + This is the first subsection. - \section1 Hello Qt + \section3 Hello Qt - This is the first chapter's first section. + This is the first subsubsection. - \section1 Making Connections + \section3 Making Connections - This is the first chapter's second section. + This is the second subsubsection. - \section1 Using the Reference Documentation + \section3 Using the Reference Documentation - This is the first chapter's third section. + This is the third subsubsection. - \chapter Creating Dialogs + \section2 Creating Dialogs - This is the first part's second chapter. + This is the second subsection. - \section1 Subclassing QDialog + \section3 Subclassing QDialog - This is the second chapter's first section. + This is the first subsubsection. ... - \part Intermediate Qt + \section1 Intermediate Qt - This is the second part. + This is the second section. - \chapter Layout Management + \section2 Layout Management - This is the second part's first chapter. + This is the second section's first subsection. - \section1 Basic Layouts + \section3 Basic Layouts - This is the first chapter's first section. + This is the first subsubsection. ... * / @@ -842,54 +825,54 @@ <a name="Basic Qt"> <h1>Basic Qt</h1> </a> - <p>This is the first part.</p> + <p>This is the first section.</p> <a name="Getting started"> <h2>Getting Started</h2> </a> - This is the first part's first chapter.</p> + This is the first subsection.</p> <a name="Hello Qt"> <h3>Hello Qt</h3> </a> - <p>This is the first chapter's first section.</p> + <p>This is the first subsubsection.</p> <a name="Making Connections"> <h3>Making Connections</h3> </a> - <p>This is the first chapter's second section.</p> + <p>This is the second subsubsection.</p> <a name="Using the Reference Documentation"> <h3>Using the Reference Documentation</h3> </a> - <p>This is the first chapter's third section.</p> + <p>This is the third subsubsection.</p> <a name="Creating Dialogs"> <h2>Creating Dialogs</h2> </a> - <p>This is the first part's second chapter.</p> + <p>This is the second subsection.</p> <a name="Subclassing QDialog"> <h3>Subclassing QDialog</h3> </a> - <p>This is the second chapter's first section.</p> + <p>This is the first subsubsection.</p> ... <a name="Intermediate Qt"> <h1>Intermediate Qt</h1> </a> - <p>This is the second part.</p> + <p>This is the second section.</p> <a name="Layout Management"> <h2>Layout Management</h2> </a> - <p>This is the second part's first chapter.</p> + <p>This is the second section's first subsection.</p> <a name="Basic Layouts"> <h3>Basic Layouts</h3> </a> - <p>This is the first chapter's first section.</p> + <p>This is the first subsubsection.</p> ... @@ -900,21 +883,12 @@ heading appears in the automatically generated table of contents that normally appears in the upper right-hand corner of the page. - \target chapter-command - \section1 \\chapter - - The \\chapter command is intended for use in - larger documents, and divides the document into chapters. - - See \l{part} {\\part} for an explanation of the various - section units, command argument, and rendering. - \target sectionOne-command \section1 \\section1 The \\section1 command starts a new section. - See \l{part} {\\part} for an explanation of the various + See \l{section-commands} {Section commands} for an explanation of the various section units, command argument, and rendering. \target sectionTwo-command @@ -922,7 +896,7 @@ The \\section2 command starts a new section. - See \l{part} {\\part} for an explanation of the various + See \l{section-commands} {Section commands} for an explanation of the various section units, command argument, and rendering. \target sectionThree-command @@ -930,7 +904,7 @@ The \\section3 command starts a new section. - See \l{part} {\\part} for an explanation of the various + See \l{section-commands} {Section commands} for an explanation of the various section units, command argument, and rendering. \target sectionFour-command @@ -938,7 +912,7 @@ The \\section4 command starts a new section. - See \l{part} {\\part} for an explanation of the various + See \l{section-commands} {Section commands} for an explanation of the various section units, command argument, and rendering. */ @@ -1874,8 +1848,7 @@ \l {title-command} {\\title} command. \li \c {\l {Introduction to QDoc}}- The text from one of the - \l{part-command} {\\part}, \l{chapter} {\\chapter}, or \l - {sectionOne-command} {\\section} commands. + \l{section-commands} {Section commands}. \li \c {\l fontmatching} - The argument of a \l {target-command} {\\target} command. |