[education/rkward] rkward: Add mimetype for rmarkdown, to allow to set file association (it does not seem to have an "official" mime type, yet)

Thomas Friedrichsmeier null at kde.org
Mon May 16 20:42:16 BST 2022


Git commit 2779c86efb3b2b3b7ddc5f0e419d4268420c3918 by Thomas Friedrichsmeier.
Committed on 16/05/2022 at 19:41.
Pushed by tfry into branch 'master'.

Add mimetype for rmarkdown, to allow to set file association (it does not seem to have an "official" mime type, yet)

M  +6    -1    rkward/CMakeLists.txt
M  +1    -1    rkward/org.kde.rkward.desktop
A  +12   -0    rkward/vnd.kde.rmarkdown.xml

https://invent.kde.org/education/rkward/commit/2779c86efb3b2b3b7ddc5f0e419d4268420c3918

diff --git a/rkward/CMakeLists.txt b/rkward/CMakeLists.txt
index 0a3819bf..a3161582 100644
--- a/rkward/CMakeLists.txt
+++ b/rkward/CMakeLists.txt
@@ -111,7 +111,12 @@ ENDIF()
 
 INSTALL(FILES org.kde.rkward.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
 INSTALL(FILES org.kde.rkward.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
-INSTALL(FILES vnd.rkward.r.xml DESTINATION ${XDG_MIME_INSTALL_DIR})
 INSTALL(FILES rkward.protocol DESTINATION ${SERVICES_INSTALL_DIR})
+INSTALL(FILES vnd.rkward.r.xml DESTINATION ${XDG_MIME_INSTALL_DIR})
+INSTALL(FILES vnd.kde.rmarkdown.xml DESTINATION ${XDG_MIME_INSTALL_DIR})
+FIND_PACKAGE(SharedMimeInfo)
+IF(SharedMimeInfo_FOUND)
+	UPDATE_XDG_MIMETYPES(${XDG_MIME_INSTALL_DIR})
+ENDIF(SharedMimeInfo_FOUND)
 
 INSTALL(FILES RKWardRMd.xml DESTINATION ${DATA_INSTALL_DIR}/ktexteditor_snippets/data)
diff --git a/rkward/org.kde.rkward.desktop b/rkward/org.kde.rkward.desktop
index 69992845..699a4ecd 100755
--- a/rkward/org.kde.rkward.desktop
+++ b/rkward/org.kde.rkward.desktop
@@ -69,7 +69,7 @@ Terminal=false
 Type=Application
 X-DocPath=rkward/index.html
 Categories=Qt;KDE;Science;Math;NumericalAnalysis;
-MimeType=text/r;application/rdata;
+MimeType=text/r;application/rdata;text/vnd.kde.rmarkdown
 Keywords=statistics;data;r;
 Keywords[ca]=estadística;dades;r;
 Keywords[ca at valencia]=estadística;dades;r;
diff --git a/rkward/vnd.kde.rmarkdown.xml b/rkward/vnd.kde.rmarkdown.xml
new file mode 100644
index 00000000..a4c62243
--- /dev/null
+++ b/rkward/vnd.kde.rmarkdown.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="text/vnd.kde.rmarkdown">
+  <comment>RMarkdown document</comment>
+  <comment xml:lang="de">RMarkdown-Dokument</comment>
+  <sub-class-of type="text/markdown"/>
+  <generic-icon name="text-markdown"/>
+  <glob pattern="*.rmd"/>
+  <glob pattern="*.rmkd"/>
+  <glob pattern="*.rmarkdown"/>
+ </mime-type>
+</mime-info>


More information about the rkward-tracker mailing list