[umbrello/Applications/18.12] /: Update docbook files to version 4.5 to be compatible with KF5

Ralf Habacker null at kde.org
Tue Dec 18 08:40:51 GMT 2018


Git commit 626de6de7889b4724394cd47901fae5249ce7ec7 by Ralf Habacker.
Committed on 18/12/2018 at 08:40.
Pushed by habacker into branch 'Applications/18.12'.

Update docbook files to version 4.5 to be compatible with KF5

For KDE4 builds, a suitable kdedbx45.dtd is provided locally
in the respective source directory.

https://phabricator.kde.org/T7659

M  +16   -0    CMakeLists.txt
M  +1    -15   doc/CMakeLists.txt
M  +1    -13   doc/apphelp/CMakeLists.txt
M  +2    -2    doc/apphelp/index.docbook
M  +2    -2    doc/index.docbook

https://commits.kde.org/umbrello/626de6de7889b4724394cd47901fae5249ce7ec7

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15094ece3..0e735293c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,6 +126,22 @@ if(NOT BUILD_KF5)
                                  )
         endforeach()
     endmacro(ecm_mark_nongui_executable)
+
+    macro(kdoctools_create_handbook)
+        set(KDOCTOOLS_CUSTOMIZATION_DIR "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization")
+        set(KDEX_DTD ${KDE4_DATA_DIR}/ksgmltools2/customization/dtd/kdex.dtd)
+        set(kdedbx45_dtd "
+    <!ENTITY % kdexDTD       PUBLIC
+      \"-//OASIS//DTD DocBook XML V4.5//EN\"
+      \"${KDEX_DTD}\">
+    %kdexDTD;
+    ")
+        set(CUSTOM_DTD ${CMAKE_CURRENT_SOURCE_DIR}/dtd/kdedbx45.dtd)
+        if (NOT EXISTS ${CUSTOM_DTD})
+            file(WRITE ${CUSTOM_DTD} "${kdedbx45_dtd}")
+        endif()
+        kde4_create_handbook(${ARGN})
+    endmacro()
     if(NOT DISABLE_PHP_IMPORT)
         find_package(KDevelop-PG-Qt)
         find_package(KDevPlatform)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index b4d6a8578..1a4696e5d 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,18 +1,4 @@
-if (NOT BUILD_KF5)
-    set(KDOCTOOLS_CUSTOMIZATION_DIR "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization")
-else()
-    set(KDOCTOOLS_CUSTOMIZATION_DIR "${KDOCTOOLS_DATA_INSTALL_DIR}/kdoctools/customization")
-endif()
-
 ########### install files ###############
-if(BUILD_KF5)
-    file(READ "index.docbook" index_file)
-    string(REPLACE "4.2" "4.5" index_file "${index_file}")
-    string(REPLACE "kdex.dtd" "kdedbx45.dtd" index_file "${index_file}")
-    file(WRITE "index-kf5.docbook" "${index_file}")
-    kdoctools_create_handbook(index-kf5.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
-else()
-    kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
-endif()
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
 
 add_subdirectory(apphelp)
diff --git a/doc/apphelp/CMakeLists.txt b/doc/apphelp/CMakeLists.txt
index c389ca919..57b171f82 100644
--- a/doc/apphelp/CMakeLists.txt
+++ b/doc/apphelp/CMakeLists.txt
@@ -1,14 +1,2 @@
 ########### install files ###############
-if(BUILD_KF5)
-    file(READ "index.docbook" index_file)
-    string(REPLACE "4.2" "4.5" index_file "${index_file}")
-    string(REPLACE "kdex.dtd" "kdedbx45.dtd" index_file "${index_file}")
-    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/index.docbook "${index_file}")
-    if(WITH_WELCOME_PAGE)
-        kdoctools_create_handbook(${CMAKE_CURRENT_BINARY_DIR}/index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello/apphelp)
-    endif()
-else()
-    if(WITH_WELCOME_PAGE)
-        kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello/apphelp)
-    endif()
-endif()
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello/apphelp)
diff --git a/doc/apphelp/index.docbook b/doc/apphelp/index.docbook
index 489062708..94fe09e1d 100644
--- a/doc/apphelp/index.docbook
+++ b/doc/apphelp/index.docbook
@@ -1,7 +1,7 @@
 <?xml version="1.0" ?>
 
-<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN"
- "dtd/kdex.dtd" [
+<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN"
+ "dtd/kdedbx45.dtd" [
  <!ENTITY umbrello "<application>Umbrello &UML; Modeller</application>">
  <!ENTITY kappname "&umbrello;">
  <!ENTITY UML "<acronym>UML</acronym>">
diff --git a/doc/index.docbook b/doc/index.docbook
index 3a260e777..685d8984c 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -1,7 +1,7 @@
 <?xml version="1.0" ?>
 
-<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN"
- "dtd/kdex.dtd" [
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN"
+ "dtd/kdedbx45.dtd" [
  <!ENTITY umbrello "<application>Umbrello &UML; Modeller</application>">
  <!ENTITY kappname "&umbrello;">
  <!ENTITY packagename "kdesdk">


More information about the kde-doc-english mailing list