summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/ditaxmlgenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qdoc: Removed setting of codeindent variableMartin Smith2012-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | All the qdocconf files in use for Qt 5.0 set the codeindent variable to 1, which prefixes each line of a snippet with one ' '. But this messes up the cutting and pasting of snippets into editors for actual use. qdoc now lets the codeindent variable be initialized to 0, and then it never changes it. This looks ok in the default formatted html output. If the html output formatted with the template CSS files also looks ok, then the codeindent variable can be removed from all the qdocconf files, since it will no longer be used by qdoc. Task number: QTBUG-27798 Change-Id: I398c57bdfc99e747ec086fbd8ddf5994cf3ee6d5 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: qdoc now can run in 2 passesMartin Smith2012-10-121-13/+20
| | | | | | | | | | | | | | | | | | | Two command line options have been added, -prepare and -generate. If you run qdoc with -prepare, qdoc reads and parses the source files but does not generate the documentation. It only creates the .index file for the module you are running qdoc on. If you run qdoc with -generate, qdoc reads and parses the source files as well as the .index files created by running qdoc with -prepare, and it generates the documentation but no .index file. If you run without either option, qdoc runs as before, i.e. it runs both passes as a single pass. Task number: QTBUG-27539 Change-Id: Idbfe3f0f9dff58283596b504f00dff3f70f6e371 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* qdoc: Implements the -no-link-errors optionMartin Smith2012-10-101-1/+1
| | | | | | | | | | | | The -no-link-errors flag tells qdoc not to print any link error messages at all. This is useful for finding and fixing all non-link errors in a module. Task number: QTBUG-26870 Change-Id: Id4b0eebb6c0509c57d2f01763b6dedbfb6756a91 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* qdoc: Simplification of target ref constructionMartin Smith2012-10-081-19/+10
| | | | | | | | | | | | This change is being done to simplify qdoc, but the motivation was to fix a segfault in qdoc when running the release version of qdoc on linux. The change improves qdoc by simplifying the code whether it fixes the segfault or not. Change-Id: I2c865f7f1e2a44763aa7349d1bd739ad562f4029 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QDoc: remove the experimental basedir variablePierre Rossi2012-09-281-18/+0
| | | | | | | | | It was introduced in the early days of the docs' modularization and appears not to be used anywhere anymore. Change-Id: I5b0c60d92828624af2129153fce96ad01aec861c Reviewed-by: Martin Smith <martin.smith@digia.com>
* qdoc: retrying More refactoring of qdoc data structuresMartin Smith2012-09-261-9/+10
| | | | | | | | | | | This commit is the second phase of a significant overhaul of qdoc. Two new classes, QDocIndexFiles, and QDocTagFiles, are added to encapsulate the creation and use of the qdoc index files, and the creation of the qdoc tag file. Change-Id: I94651b10628e535ea7b26bd8256037cd819ccea7 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Use QStringList::join(QChar) overload where applicable [tools]Marc Mutz2012-09-231-1/+1
| | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: Ia087beb886bbaec1a0976cd924440d8904044879 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-22/+22
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* make src/tools/ compile without CamelCase headersOswald Buddenhagen2012-09-191-4/+4
| | | | | | | | so the build works with syncqt -minimal Change-Id: Ief5e8eb9a504dd6c84cff76cc3e5257450386a0f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qdoc: Refactoring of qdoc data structuresMartin Smith2012-09-141-499/+197
| | | | | | | | | | | | | | | | | | This commit is the beginning of a significant overhaul of qdoc. A new class, QDocDatabase, is added, which will eventually encapsulate all the data structures used by qdoc. In this commit, the Tree class is made private and only accessible from QDocDatabase. Several maps structures are also moved into QDocDatabase from other classes. Much dead code and unused parameters were removed. Further simplification will follow. Change-Id: I237411c50f3ced0d2fc8d3b0fbfdf4e55880f8e9 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Use QString() instead of "".Frederik Gladhorn2012-09-011-2/+2
| | | | | Change-Id: I42c55344663808b8362e2c9185273a00fc1c70b0 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* doc: Replaced FakeNode with DocNodeMartin Smith2012-08-211-134/+134
| | | | | | | | | | | | | | | | | | The name FakeNode was a bad choice. It was used to represent something that wasn't derived from a C++ declaration in a .h file. Any generic page or QML item or any special kind of qdoc construct was stored in a FakeNode. The name was unfortunate because the constructs stored in FakeNodes were just as real as C++ constructs. So FakeNode has been renamed to DocNode, which just refers to a documentation node. The node type Fake has been replaced with node type Document. Change-Id: Ida9de8288b7b8915bf9273fd890ca84aaf05e182 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Removed "../" from paths to imagesMartin Smith2012-08-061-6/+8
| | | | | | | | | | | qdoc was mistakenly assuming that the output was going into subdirectories. The base dir variable was not being tested. Task nr: QTBUG-26638 Change-Id: I9b331926f8954b58102f75fad3f233eaebb2bb4d Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* qdoc: Fixed incorrect href attribute values in qdocMartin Smith2012-07-251-4/+27
| | | | | | | | | | | | There were two fileBase() functions, but only one was correct. The wrong one was being called in some cases. Now there is only one fileBase() function, which is always called. Task nr: QTBUG-26591 Change-Id: I2c40e2152a8c7ad1bb9db256ecf1367148f0e7f6 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Removed several #if 1 macros.Martin Smith2012-07-061-6/+0
| | | | | | | | The code should be there. Also removed a few obsolete #defines. Change-Id: Id63418b344157a99ac502329eea4f0bc9dc77849 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Removed several #if 0 blocks.Martin Smith2012-07-061-150/+0
| | | | | | | Removed a lot of dead code. Change-Id: I237521efab7dd046d3a47ab92a6a0e083c59ab55 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: The \br macro is promoted to a qdoc commandMartin Smith2012-07-051-0/+3
| | | | | | | | | | | The \br macro, which is used to insert a line break in the output text, is now promoted to be a qdoc command. For html, it outputs a <br/>. For DITA XML it does nothing. Task Nr: QTBUG-26435 Change-Id: Ie0542c9053f68473ccaa2f50ace74baa30f78dd0 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Use the module page as link in qt.ditamap.Casper van Donderen2012-06-211-6/+16
| | | | | | | If the number of [QML]module pages in a single qdoc run is 1: Use it as the link for the nested group of documentation pages in the automatically generated ditamap. Change-Id: Idbc3e2e5d65a1e7f0201638102ffab62475a66ec Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Use 'Type' instead of 'element' in instantiates.Casper van Donderen2012-06-211-2/+2
| | | | | | | | | On a C++ documentation page "is instantiated by QML element" was printed when you have a QML Type that instantiates this class. The text is now changed to "is instantiated by QML Type". Change-Id: I6c93531edc6ef9ac112573034fd54fa52390bc37 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Use the correct DITAiXML for table col/rowspan.Casper van Donderen2012-06-051-6/+46
| | | | | Change-Id: Id5443b4428a5f0b6b9fee92efcf2fd1ae19c0d19 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: check if !isNull() before casting prev/next nodes.Casper van Donderen2012-06-041-3/+3
| | | | | Change-Id: Ifac095ef0af0b483fbf53c6a18cf3c3130d37710 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Do not put indexNodes in qt.ditamap.Casper van Donderen2012-06-011-1/+1
| | | | | Change-Id: I659a3a91aaa6da26f4f739428d79cccfab8ce076 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Use \page title with prev/next links in DITAXML.Casper van Donderen2012-06-011-0/+12
| | | | | Change-Id: I260998986752f5c8cc48279c04557c925af1cb14 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Force writing \n before a snippet in DITAXML.Casper van Donderen2012-05-301-2/+5
| | | | | | | | | Previously the snippet text would be indented, which causes an XSLT to render the first line of a snippet at the indentation level of the .dita file. Change-Id: Iead8d07277f83ca5ccbf463f1cdb1c8210459d56 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Make qdoc compile with QT_STRICT_ITERATORSThiago Macieira2012-05-291-115/+115
| | | | | Change-Id: I2923315678d1aef516b35a8c83fe734367723a28 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Fixed pure doc parserMartin Smith2012-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This parser was meant to parse any file for qdoc comments only, ignoring everything else that is not inside a qdoc comment. But it wasn't doing that. It was parsing all code, regardless of the language, using the C++ parser. Now it has been corrected to look at qdoc comments and skip over everything else. Note thast this means qdoc will expect a qdoc topic command in each and every qdoc comment in the file. The posiution of the qdoc comment with respect to the code it is meant to document is not taken into account in the pure doc parser. This is in contrast to the QML and C++ parsers which do take comment location into account in some cases. Change-Id: I0804a4149baa942b463e0b6990c71e4039ac1a50 Reviewed-by: Keith Isdale <keith.isdale@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Write <qmlinheritedby> before <qmlinstantiates>Martin Smith2012-05-211-1/+1
| | | | | | | | | | The order of these two elements has been switched in DITA XML files for QML types. <qmlinheritedby> now comes before <qmlinstantiates>. Change-Id: I1a041c087351734d20629336bbc1c136e04d345a Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qdoc: Fix some QString usage issues (Krazy warnings).Friedemann Kleint2012-05-161-15/+15
| | | | | | | | - Avoid single-character constants. - Use QString() instead of "". Change-Id: If04eff389e7b6d4a18201365b711708fdf545d00 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Use capitalized navtitles in ditamap.Casper van Donderen2012-05-151-10/+10
| | | | | | | | The auto-generated ditamap used titles like "articles", this now becomes "Articles". Change-Id: I32fa6353443aaa66cbfc2b2fea1fea26e3e33684 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Fixed some terminology output by qdocMartin Smith2012-05-151-1/+1
| | | | | | | | | | There were still a few places where qdoc generated "element" instead of "type" or "class" instead of "type." These have been fixed. Change-Id: Id75156810212edb468198b6f269e3a91c55ac22c Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Fixed a regression bug caused by fixing error messagesMartin Smith2012-05-111-20/+9
| | | | | | | | | | | | | The C++ code marker is the default code marker. The default code marker was being called for .qdoc files. But when the tree nodes were each assigned a location object based on the location in the source file where the node was built, the default code marker was no longer used. Instead, the plain code marker was used. This was wrong. qdoc now knows to use the C++ code marker for all .qdoc files. Change-Id: I15a58168db74cc5aa82a1fbccc5b7ece219ec297 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Generate images inline for \inlineimageCasper van Donderen2012-05-101-5/+3
| | | | | Change-Id: I1ee001870ac1289a8b0340707f62c7cc3fb84492 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Remove generateQmlDesc and use generateApiDesc instead.Casper van Donderen2012-05-091-21/+6
| | | | | | | | | generateQmlDesc was basically a copy of generateApiDesc. Just using generateApiDesc also fixes a bug with the generation of a <shortDesc> inside an <apiDesc> Change-Id: I129a24ab0244283cc394c2afacc0f8227e4e5a88 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Use node name for page DITA title when name argument is empty.Casper van Donderen2012-05-091-1/+4
| | | | | | | | | | | | | | When QML documentation is being generated from .qdoc files the 'name' argument of the generateHeader() function is always empty, since the plaincodemarker sets the plainFullTitle to "". In that case the Node->name() should be used to specify the title of the page, this will always be the first argument given to the \qmlclass qdoc command. Change-Id: If3e86ce59be1fdad608fab9f32fbe7bbca97aa93 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qdoc: Fixed qdoc error messagesMartin Smith2012-05-091-1/+1
| | | | | | | | | | | qdoc prints many error messages without including the source file path and the line number for where the error occurs. This makes it difficult to find the place to fix the error. This update corrects some of those error messages. Further updates will fix the others. Change-Id: I9c0eed96482c61643a2d83c5135368413e63ae52 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Further changes to the QML specializationMartin Smith2012-05-011-12/+25
| | | | | | | | | Re-adding <qmlInherits>, <qmlInheritedBy>, <qmlInstantiates>, and <qmlSince>. Also adding <qmlAttached>. Change-Id: Iebd70a37b083bc404ce621d0bb9d3090dbc1109e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Further changes to the QML specializationMartin Smith2012-04-281-2/+7
| | | | | | | | | | The <qmlPropertyGroup> tag now has an id attribute of the form "id-qml-propertygroup-xxx" where the xxx is the property name. //This should be unique within the document. Change-Id: I20b30266dbe92b85b60400de30ebf9b1f1e292ea Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Further changes to the QML specializationMartin Smith2012-04-241-58/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Body elements to include type, property, method, signal, enum info, so: qmlDetail to - qmlTypeDetail - qmlPropertyDetail - qmlEnumerationDetail - qmlMethodDetail - qmlSignalDetail 2. Same thing for a section that contains elements specialized for QML, so qmlDef to - qmlTypeDef - qmlPropertyDef - qmlEnumerationDef - qmlMethodDef - qmlSignalDef Rationale for both items above is that otherwise the body and section content models would have to be exactly the same for a type, property, method, etc. 3. For the import statement use: <qmlImportModule> <apiItemName>QtGraphicalEffects</apiItemName> <apiData>1.0</apiData> </qmlImportModule> So we have an element indicating that this is for the import statement, not an outputclass. And no need to specialize the elements inside it as we know from the ancestor (qmlImportModule) what they're for. <qmlImportModule> to be specialized from apiDef. 4. The 'description' section name doesn't need to be specialized further from the API ref. DTDs so <qmlDesc> should be <apiDesc> The content model for the 'description' section would be similar to that of a normal DITA section, specialized into apiDesc in the API ref. DTDs, so we don't need to rename it for QML. 5. We need a separate element for the since information. <qmlSince> <apiItemName>QtGraphicalEffects</apiItemName> <apiData>1.0</apiData> </qmlSince> 6. Public identifier should be like this for a type: -//NOKIA//DTD DITA QML Type//EN Not like this: -//NOKIA//DTD DITA QML API Type Reference v0.1.0//EN Change-Id: Ie9047965bf32a2e3e9339eb743f2019cb38c88e4 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Don't write '...' for empty <apiName>Martin Smith2012-04-231-2/+2
| | | | | | | qdoc now <apiName/>, when there is no name. Change-Id: I0aa85eef633776f691c9e2238514194cf89b8a8f Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Update qdoc to use QML spec for DITAMartin Smith2012-04-231-177/+247
| | | | | | | | qdoc now generates DITA XML from QML docs according to the QML specialization. Change-Id: I51d93c2ab3b1deefab9bbedcd2e752f49648809f Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Generate index file for DITAXML.Casper van Donderen2012-04-191-2/+6
| | | | | | | | | | | This change moves the fullDocumentLocation function to the generator base-class and adds generateIndex to the DITAXML Generator. All function calls to fullDocumentLocation are now handled by the static function in the base-class which will use the file extension from the currently active generator (either DITAXML or HTML). Change-Id: I24ce09c05a63eb5980b1243c58990e7ce9d42036 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Write subclasses of namespaces in automatic ditamap.Casper van Donderen2012-04-171-13/+22
| | | | | | | Now we also write the subclasses of namespaces sorted to qt.ditamap. Change-Id: I4a4376bac208b9bacd5a2ddd5265faef13dc2eba Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Fixed bugs causing invalid DITA XMLMartin Smith2012-04-141-153/+177
| | | | | | | | | | | Fixed a bug in qdoc that caused too many end elements to be generated. Also fixed some doc errors that caused invalid DITA to be generated. Task nr: QTBUG-25302 Change-Id: Ifbbf457d28c51c2691a252888447739da7713bc9 Reviewed-by: Martin Smith <martin.smith@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Fix infinite loop when finding items in ditamaps.Casper van Donderen2012-04-131-1/+2
| | | | | Change-Id: Ic033676e21a252db07543fccba0d2a41f4b52294 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Generate missing image error.Casper van Donderen2012-04-121-0/+1
| | | | | Change-Id: I98faf3b3422fa0a7ebd3f65c7ba64e6dc31bad86 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Fixed to report read-only QML properties correctlyMartin Smith2012-04-111-19/+11
| | | | | | | | | | | | Now the default for a QML property is writable. If qdoc can't detect the actual read-only status, writable is assumed. There were some cases where qdoc could not determine the actual read-only/writable status for a QML property. In these cases, qdoc reported read-only because the default was read-only, which was not optimal. Change-Id: I55aeb2bedcde92a414f4d48a8d995e5e9dbca5da Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Don't lower case <shortdesc> in DITA.Martin Smith2012-04-021-32/+31
| | | | | | | | The first letter of a short description no longer has a lower case letter. Change-Id: I98f04d2feba070a0a77161316773306386cc6b67 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Add the \hr commandMartin Smith2012-04-021-0/+5
| | | | | | | | Now you can out put a horizontal line anywhere in your text. Change-Id: I9b8bbbd6aa312e8386fb1a3b165876d76057f784 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Allow documenting a C++ class as a QML type.Martin Smith2012-04-021-68/+176
| | | | | | | | | | | | | | | | | | | Now qdoc can handle the case where a C++ class is documented as a QML type of the same name, or as both a C++ class and a QML type of the same name. And collisions pages are created for both the HTML and the DITA XML output. A collision page is created when two items have the same name. The collision pages will be augmented later to include the list of pages where ambiguous links to one of the items listed on the collision page are actually located, so the writer can go back to those links and add the appropriate qualifier. Change-Id: I5a9632b2d2209e0784392047056bed8962005624 Reviewed-by: Martin Smith <martin.smith@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Fix assert and remove duplicate description.Casper van Donderen2012-04-011-6/+6
| | | | | Change-Id: Idac8488c1a2ba8cabe584244a0ea9a824a31cd65 Reviewed-by: Martin Smith <martin.smith@nokia.com>