diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-04-05 15:51:08 +0200 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-05-12 15:09:50 +0200 |
commit | c1d799fd51e052425a860847383ad78c1f7645f1 (patch) | |
tree | 6a03a04a4184f5aff4b09cbf09efb54fbb9e5cdf | |
parent | 97a63ed277504bdac0c8085c788521bdce01f65a (diff) |
qdoc: Do not generate tags from titles anymore
Qt Creator nowadays searches itself for matches in the title and
description, so no point in automatically generating tags from titles
anymore.
Change-Id: I4aa9912f7bb6dd293b5de8ebff7e751956e6856d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit f3c96dc9fd0dce00df7ae60f9a1c4ba86eaa2d70)
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 25 | ||||
-rw-r--r-- | tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml | 2 | ||||
-rw-r--r-- | tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml | 4 |
3 files changed, 3 insertions, 28 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 98039d541..599d33eb3 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -3990,31 +3990,6 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString tags += QSet<QString>(tagList.cbegin(), tagList.cend()); } - const auto &titleWords = en->title().toLower().split(QLatin1Char(' ')); - tags += QSet<QString>(titleWords.cbegin(), titleWords.cend()); - - // Clean up tags, exclude invalid and common words - QSet<QString>::iterator tag_it = tags.begin(); - QSet<QString> modified; - while (tag_it != tags.end()) { - QString s = *tag_it; - if (s.at(0) == '(') - s.remove(0, 1).chop(1); - if (s.endsWith(QLatin1Char(':'))) - s.chop(1); - - if (s.length() < 2 || s.at(0).isDigit() || s.at(0) == '-' || s == QLatin1String("qt") - || s == QLatin1String("the") || s == QLatin1String("and") - || s.startsWith(QLatin1String("example")) || s.startsWith(QLatin1String("chapter"))) - tag_it = tags.erase(tag_it); - else if (s != *tag_it) { - modified << s; - tag_it = tags.erase(tag_it); - } else - ++tag_it; - } - tags += modified; - if (!tags.isEmpty()) { writer.writeStartElement("tags"); bool wrote_one = false; diff --git a/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml index d83906f44..9603ae6ec 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml @@ -3,7 +3,7 @@ <demos> <demo name="Demo" docUrl="qthelp://org.qt-project.test.001/test/test-demos-demo-example.html" projectPath="test/demos/demo/demo.pro" isTest="true"> <description><![CDATA[No description available]]></description> - <tags>demo,test</tags> + <tags>test</tags> </demo> </demos> </instructionals> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml index 8aa9ce303..8b45dd2a3 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml @@ -3,12 +3,12 @@ <examples> <example name="CMake Example Project" docUrl="qthelp://org.qt-project.test.001/test/test-cmaketest-example.html" projectPath="test/cmaketest/CMakeLists.txt" isTest="true"> <description><![CDATA[No description available]]></description> - <tags>cmake,project,test</tags> + <tags>test</tags> <fileToOpen mainFile="true">test/cmaketest/main.cpp</fileToOpen> </example> <example name="QML Documentation Example" docUrl="qthelp://org.qt-project.test.001/test/test-componentset-example.html" projectPath="tutorials/componentset/componentset.pro" isTest="true"> <description><![CDATA[Example for documenting QML types.]]></description> - <tags>documentation,qml,sample,test</tags> + <tags>sample,test</tags> </example> </examples> </instructionals> |