diff options
author | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2019-11-07 09:54:13 +0100 |
---|---|---|
committer | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2019-11-18 11:12:35 +0100 |
commit | 688176a3c35f49c7c087ca2f0e8c841e72133176 (patch) | |
tree | 04d5939c747ccd748cd14889c192f0485cfe3320 | |
parent | 91f62b1db2bdfe9b4eaeb291f31c97c1767fa3fd (diff) |
Doc: Drop PySide prefix from the RST filenames
Shiboken appends the content in these RSTs to the module index
pages that it generates.
In addition,
- updated the snippets, extras, and additional docs
passed to the Shiboken call.
- moved the copy_directory command right before the
shiboken call.
Change-Id: I45222ba7d0798105a764d7692d466f7a2a105d77
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | sources/pyside2/doc/CMakeLists.txt | 8 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtCore.ClassInfo.rst (renamed from sources/pyside2/doc/extras/PySide.QtCore.ClassInfo.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtCore.Signal.rst (renamed from sources/pyside2/doc/extras/PySide.QtCore.Signal.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtCore.Slot.rst (renamed from sources/pyside2/doc/extras/PySide.QtCore.Slot.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtCore.rst (renamed from sources/pyside2/doc/extras/PySide.QtCore.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtGui.rst (renamed from sources/pyside2/doc/extras/PySide.QtGui.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtHelp.rst (renamed from sources/pyside2/doc/extras/PySide.QtHelp.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtMultimedia.rst (renamed from sources/pyside2/doc/extras/PySide.QtMultimedia.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtNetwork.rst (renamed from sources/pyside2/doc/extras/PySide.QtNetwork.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtOpenGL.rst (renamed from sources/pyside2/doc/extras/PySide.QtOpenGL.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtScript.rst (renamed from sources/pyside2/doc/extras/PySide.QtScript.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtScriptTools.rst (renamed from sources/pyside2/doc/extras/PySide.QtScriptTools.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtSql.rst (renamed from sources/pyside2/doc/extras/PySide.QtSql.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtSvg.rst (renamed from sources/pyside2/doc/extras/PySide.QtSvg.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtTest.rst (renamed from sources/pyside2/doc/extras/PySide.QtTest.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtUiTools.rst (renamed from sources/pyside2/doc/extras/PySide.QtUiTools.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtWebKit.rst (renamed from sources/pyside2/doc/extras/PySide.QtWebKit.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtXml.rst (renamed from sources/pyside2/doc/extras/PySide.QtXml.rst) | 0 | ||||
-rw-r--r-- | sources/pyside2/doc/extras/QtXmlPatterns.rst (renamed from sources/pyside2/doc/extras/PySide.QtXmlPatterns.rst) | 0 | ||||
-rw-r--r-- | sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 12 |
20 files changed, 14 insertions, 6 deletions
diff --git a/sources/pyside2/doc/CMakeLists.txt b/sources/pyside2/doc/CMakeLists.txt index 9d5a5a0a8..ee0fc0c51 100644 --- a/sources/pyside2/doc/CMakeLists.txt +++ b/sources/pyside2/doc/CMakeLists.txt @@ -96,7 +96,6 @@ add_custom_target(qdoc SOURCE "pyside.qdocconf") add_custom_target(apidoc - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst COMMAND ${SHIBOKEN_PYTHON_INTERPRETER} ${SPHINX_BUILD} -b html ${CMAKE_CURRENT_BINARY_DIR}/rst html #copying shiboken2 (including ApiExtractor) doc htmls COMMENT "Copying over the Shiboken2 doc HTMLs..." @@ -110,6 +109,7 @@ add_custom_target(apidoc configure_file("conf.py.in" "rst/conf.py" @ONLY) add_custom_target("docrsts" + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst COMMAND Shiboken2::shiboken2 --generator-set=qtdoc ${docHeader} --include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${pyside2_SOURCE_DIR}${PATH_SEP}${TS_ROOT}" --api-version=${SUPPORTED_QT_VERSION} @@ -117,9 +117,9 @@ add_custom_target("docrsts" --library-source-dir=${QT_SRC_DIR} --documentation-data-dir=${DOC_DATA_DIR}/webxml --output-directory=${CMAKE_CURRENT_BINARY_DIR}/rst - --documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets/doc/src/snippets${PATH_SEP}${CMAKE_CURRENT_SOURCE_DIR}/codesnippets/examples - --documentation-extra-sections-dir=${CMAKE_CURRENT_SOURCE_DIR}/extras - --additional-documentation=${CMAKE_CURRENT_LIST_DIR}/additionaldocs.lst + --documentation-code-snippets-dir=${CMAKE_CURRENT_BINARY_DIR}/rst/codesnippets/doc/src/snippets${PATH_SEP}${CMAKE_CURRENT_BINARY_DIR}/rst/codesnippets/examples + --documentation-extra-sections-dir=${CMAKE_CURRENT_BINARY_DIR}/rst/extras + --additional-documentation=${CMAKE_CURRENT_BINARY_DIR}/rst/additionaldocs.lst ${CMAKE_CURRENT_BINARY_DIR}/typesystem_doc.xml WORKING_DIRECTORY ${${module}_SOURCE_DIR} COMMENT "Running generator to generate documentation..." diff --git a/sources/pyside2/doc/extras/PySide.QtCore.ClassInfo.rst b/sources/pyside2/doc/extras/QtCore.ClassInfo.rst index d2267be9c..d2267be9c 100644 --- a/sources/pyside2/doc/extras/PySide.QtCore.ClassInfo.rst +++ b/sources/pyside2/doc/extras/QtCore.ClassInfo.rst diff --git a/sources/pyside2/doc/extras/PySide.QtCore.Signal.rst b/sources/pyside2/doc/extras/QtCore.Signal.rst index 16c640831..16c640831 100644 --- a/sources/pyside2/doc/extras/PySide.QtCore.Signal.rst +++ b/sources/pyside2/doc/extras/QtCore.Signal.rst diff --git a/sources/pyside2/doc/extras/PySide.QtCore.Slot.rst b/sources/pyside2/doc/extras/QtCore.Slot.rst index 3bc64c03a..3bc64c03a 100644 --- a/sources/pyside2/doc/extras/PySide.QtCore.Slot.rst +++ b/sources/pyside2/doc/extras/QtCore.Slot.rst diff --git a/sources/pyside2/doc/extras/PySide.QtCore.rst b/sources/pyside2/doc/extras/QtCore.rst index d3277a418..d3277a418 100644 --- a/sources/pyside2/doc/extras/PySide.QtCore.rst +++ b/sources/pyside2/doc/extras/QtCore.rst diff --git a/sources/pyside2/doc/extras/PySide.QtGui.rst b/sources/pyside2/doc/extras/QtGui.rst index e16329c38..e16329c38 100644 --- a/sources/pyside2/doc/extras/PySide.QtGui.rst +++ b/sources/pyside2/doc/extras/QtGui.rst diff --git a/sources/pyside2/doc/extras/PySide.QtHelp.rst b/sources/pyside2/doc/extras/QtHelp.rst index 239f4faa6..239f4faa6 100644 --- a/sources/pyside2/doc/extras/PySide.QtHelp.rst +++ b/sources/pyside2/doc/extras/QtHelp.rst diff --git a/sources/pyside2/doc/extras/PySide.QtMultimedia.rst b/sources/pyside2/doc/extras/QtMultimedia.rst index 5088db4d0..5088db4d0 100644 --- a/sources/pyside2/doc/extras/PySide.QtMultimedia.rst +++ b/sources/pyside2/doc/extras/QtMultimedia.rst diff --git a/sources/pyside2/doc/extras/PySide.QtNetwork.rst b/sources/pyside2/doc/extras/QtNetwork.rst index 07303b157..07303b157 100644 --- a/sources/pyside2/doc/extras/PySide.QtNetwork.rst +++ b/sources/pyside2/doc/extras/QtNetwork.rst diff --git a/sources/pyside2/doc/extras/PySide.QtOpenGL.rst b/sources/pyside2/doc/extras/QtOpenGL.rst index 38783d9fd..38783d9fd 100644 --- a/sources/pyside2/doc/extras/PySide.QtOpenGL.rst +++ b/sources/pyside2/doc/extras/QtOpenGL.rst diff --git a/sources/pyside2/doc/extras/PySide.QtScript.rst b/sources/pyside2/doc/extras/QtScript.rst index 8ce7681ec..8ce7681ec 100644 --- a/sources/pyside2/doc/extras/PySide.QtScript.rst +++ b/sources/pyside2/doc/extras/QtScript.rst diff --git a/sources/pyside2/doc/extras/PySide.QtScriptTools.rst b/sources/pyside2/doc/extras/QtScriptTools.rst index a54ed914b..a54ed914b 100644 --- a/sources/pyside2/doc/extras/PySide.QtScriptTools.rst +++ b/sources/pyside2/doc/extras/QtScriptTools.rst diff --git a/sources/pyside2/doc/extras/PySide.QtSql.rst b/sources/pyside2/doc/extras/QtSql.rst index fcdd6ba02..fcdd6ba02 100644 --- a/sources/pyside2/doc/extras/PySide.QtSql.rst +++ b/sources/pyside2/doc/extras/QtSql.rst diff --git a/sources/pyside2/doc/extras/PySide.QtSvg.rst b/sources/pyside2/doc/extras/QtSvg.rst index 7817e532f..7817e532f 100644 --- a/sources/pyside2/doc/extras/PySide.QtSvg.rst +++ b/sources/pyside2/doc/extras/QtSvg.rst diff --git a/sources/pyside2/doc/extras/PySide.QtTest.rst b/sources/pyside2/doc/extras/QtTest.rst index 0b89a22d4..0b89a22d4 100644 --- a/sources/pyside2/doc/extras/PySide.QtTest.rst +++ b/sources/pyside2/doc/extras/QtTest.rst diff --git a/sources/pyside2/doc/extras/PySide.QtUiTools.rst b/sources/pyside2/doc/extras/QtUiTools.rst index 553224527..553224527 100644 --- a/sources/pyside2/doc/extras/PySide.QtUiTools.rst +++ b/sources/pyside2/doc/extras/QtUiTools.rst diff --git a/sources/pyside2/doc/extras/PySide.QtWebKit.rst b/sources/pyside2/doc/extras/QtWebKit.rst index 58f9230a7..58f9230a7 100644 --- a/sources/pyside2/doc/extras/PySide.QtWebKit.rst +++ b/sources/pyside2/doc/extras/QtWebKit.rst diff --git a/sources/pyside2/doc/extras/PySide.QtXml.rst b/sources/pyside2/doc/extras/QtXml.rst index 4b48ef21e..4b48ef21e 100644 --- a/sources/pyside2/doc/extras/PySide.QtXml.rst +++ b/sources/pyside2/doc/extras/QtXml.rst diff --git a/sources/pyside2/doc/extras/PySide.QtXmlPatterns.rst b/sources/pyside2/doc/extras/QtXmlPatterns.rst index 99254ad62..99254ad62 100644 --- a/sources/pyside2/doc/extras/PySide.QtXmlPatterns.rst +++ b/sources/pyside2/doc/extras/QtXmlPatterns.rst diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index 339669758..de023f079 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -2193,11 +2193,19 @@ void QtDocGenerator::writeModuleDocumentation() /* Avoid showing "Detailed Description for *every* class in toc tree */ Indentation indentation(INDENT); + // Store the it.key() in a QString so that it can be stripped off unwanted + // information when neeeded. For example, the RST files in the extras directory + // doesn't include the PySide# prefix in their names. + const QString moduleName = it.key(); + const int lastIndex = moduleName.lastIndexOf(QLatin1Char('.')); // Search for extra-sections if (!m_extraSectionDir.isEmpty()) { QDir extraSectionDir(m_extraSectionDir); - QStringList fileList = extraSectionDir.entryList(QStringList() << (it.key() + QLatin1String("?*.rst")), QDir::Files); + if (!extraSectionDir.exists()) + qCWarning(lcShiboken) << m_extraSectionDir << "doesn't exist"; + + QStringList fileList = extraSectionDir.entryList(QStringList() << (moduleName.mid(lastIndex + 1) + QLatin1String("?*.rst")), QDir::Files); QStringList::iterator it2 = fileList.begin(); for (; it2 != fileList.end(); ++it2) { QString origFileName(*it2); @@ -2231,7 +2239,7 @@ void QtDocGenerator::writeModuleDocumentation() s << "--------------------" << endl << endl; // module doc is always wrong and C++istic, so go straight to the extra directory! - QFile moduleDoc(m_extraSectionDir + QLatin1Char('/') + it.key() + QLatin1String(".rst")); + QFile moduleDoc(m_extraSectionDir + QLatin1Char('/') + moduleName.mid(lastIndex + 1) + QLatin1String(".rst")); if (moduleDoc.open(QIODevice::ReadOnly | QIODevice::Text)) { s << moduleDoc.readAll(); moduleDoc.close(); |