aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-02-09 13:30:12 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-10 12:25:05 +0000
commit5cf9f02923b6b4cf9f2de93c7f563da07eecb032 (patch)
treefde6ecbe9ca047f3f3840c9703e10213b0bc784b
parente2c1c3b7223821445aac275a43ef24e9a007892b (diff)
doc: use example gallery tool in build process
This enables the gallery generation tool in the CMake-based process in charge of building the documentation. The old 'index.rst' file was removed, and rules were added to the .gitignore to avoid adding the generated files. Fixes: PYSIDE-1490 Change-Id: I71a5a9e34ce18f42dbc7af8a3e4be65924a79d67 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 75a50de5787fbc14a9183e50b10cd3a57495ec1d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--.gitignore4
-rw-r--r--sources/pyside6/doc/CMakeLists.txt13
-rw-r--r--sources/pyside6/doc/examples/index.rst14
3 files changed, 17 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
index a1ee1e425..647761052 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,10 @@
/SciTE.*
/pysideuic
+# Auto-generated examples
+sources/pyside6/doc/examples/index.rst
+example_*.rst
+
distribute-*.egg
distribute-*.tar.gz
explore2
diff --git a/sources/pyside6/doc/CMakeLists.txt b/sources/pyside6/doc/CMakeLists.txt
index a16be06bc..cbec282ab 100644
--- a/sources/pyside6/doc/CMakeLists.txt
+++ b/sources/pyside6/doc/CMakeLists.txt
@@ -16,6 +16,19 @@ set(TS_ROOT "${ROOT}/PySide6")
file(REMOVE ${CMAKE_CURRENT_LIST_DIR}/pyside.qdocconf ${CMAKE_CURRENT_LIST_DIR}/pyside.qdocconf.in)
+# We need to find the interpreter when running this only
+# for a rst_build_docs case, and not a full doc build
+if (NOT FULLDOCSBUILD)
+ find_package(Python COMPONENTS Interpreter)
+ set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
+endif()
+
+# Generate example gallery
+message(STATUS "Generating example gallery")
+set(EXAMPLE_TOOL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../tools/example_gallery/main.py")
+execute_process(COMMAND ${PYTHON_EXECUTABLE} ${EXAMPLE_TOOL_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
+
set(SHIBOKEN_INTERSPHINX_FILE "${ROOT}/pyside6/shiboken6/objects.inv")
set(HAS_WEBENGINE_WIDGETS 0)
set(SKIP_SPHINX_WARNINGS 1)
diff --git a/sources/pyside6/doc/examples/index.rst b/sources/pyside6/doc/examples/index.rst
deleted file mode 100644
index 069d54404..000000000
--- a/sources/pyside6/doc/examples/index.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-|project| Examples
-===================
-
-A collection of examples are provided with |project| to help new users
-to understand different use cases of the module.
-You can find all the examples inside the ``pyside-setup`` on the ``examples``
-directory, or you can access them after installing |pymodname| from ``pip``
-inside the ``site-packages/PySide6/examples`` directory.
-
-.. toctree::
- :maxdepth: 1
-
- tabbedbrowser.rst
- ../pyside-examples/all-pyside-examples.rst