summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/ditaxmlgenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* QDoc: Add hand-written ditamaps as children of qt.ditamapCasper van Donderen2012-03-291-30/+83
| | | | | | | | | Known issues: the hand-written ditamap has to be a flat list. The function used should preferably become a recursive function, which would allow you to have as many nested items as you want. Change-Id: I0dc897da5222f6409e2e58c42200c342bc8cacf2 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Remove LOCAL LINK debug output.Casper van Donderen2012-03-291-1/+0
| | | | | Change-Id: Iac8c5df2ca22315f34bbb738314299a23c646b2a Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QDoc: Do not generate the sub-lists in automatic ditamap.Casper van Donderen2012-03-291-92/+0
| | | | | Change-Id: I6f91495dabf5e4aa2d0d7c1fbc690bd1fd53bd17 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Add simple return types such as void to output.Casper van Donderen2012-03-281-0/+5
| | | | | Change-Id: I2c9b2bc982f9fa3390a7b5bd322df9e015e53824 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Use otherprops attribute for DITA signals/slots.Casper van Donderen2012-03-281-4/+4
| | | | | Change-Id: Id85860abfb8abdf0b7bd95a65384576d8970096b Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: also allow \page index as head of ditamap.Casper van Donderen2012-03-281-1/+1
| | | | | | | | QDoc previously only supported having \page index.html as root of the ditamap, this is hard to understand. Change-Id: I9f99bf53440aad372bb72b59e7bfa1a0427cb652 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Rename QML classes to QML types in ditamap.Casper van Donderen2012-03-281-1/+1
| | | | | Change-Id: I7b1a10d0d25a0a79fb018ab9138f2ef32470475d Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Do not write index.dita multiple times in ditamap.Casper van Donderen2012-03-281-0/+9
| | | | | Change-Id: I69719237d0ab567ce2a606c96b38f6baa2a601b5 Reviewed-by: Martin Smith <martin.smith@nokia.com>