[gnome-user-docs] Add mime-types-custom pages



commit 4059eb5f2c87fe1cf405a177ea2cd36332be6083
Author: Petr Kovar <pkovar redhat com>
Date:   Tue Jun 17 19:35:00 2014 -0400

    Add mime-types-custom pages

 ...ons.page => desktop-favorite-applications.page} |    0
 .../C/mime-types-application-user.page             |    2 +
 system-admin-guide/C/mime-types-application.page   |    2 +
 system-admin-guide/C/mime-types-custom-user.page   |  105 +++++++++++++++++++
 system-admin-guide/C/mime-types-custom.page        |  106 ++++++++++++++++++++
 system-admin-guide/C/mime-types.page               |    1 +
 system-admin-guide/Makefile.am                     |    2 +
 7 files changed, 218 insertions(+), 0 deletions(-)
---
diff --git a/system-admin-guide/C/desktop-favourite-applications.page 
b/system-admin-guide/C/desktop-favorite-applications.page
similarity index 100%
rename from system-admin-guide/C/desktop-favourite-applications.page
rename to system-admin-guide/C/desktop-favorite-applications.page
diff --git a/system-admin-guide/C/mime-types-application-user.page 
b/system-admin-guide/C/mime-types-application-user.page
index 38ac397..f0731bd 100644
--- a/system-admin-guide/C/mime-types-application-user.page
+++ b/system-admin-guide/C/mime-types-application-user.page
@@ -4,6 +4,8 @@
 
   <info>
     <link type="guide" xref="software#management" />
+    <link type="seealso" xref="mime-types-custom-user" />
+    <link type="seealso" xref="mime-types-custom" />
     <revision pkgversion="3.12" date="2014-06-17" status="review"/>
 
     <credit type="author">
diff --git a/system-admin-guide/C/mime-types-application.page 
b/system-admin-guide/C/mime-types-application.page
index f68ca3b..901325e 100644
--- a/system-admin-guide/C/mime-types-application.page
+++ b/system-admin-guide/C/mime-types-application.page
@@ -5,6 +5,8 @@
   <info>
     <link type="guide" xref="software#management" />
     <link type="seealso" xref="mime-types-application-user" />
+    <link type="seealso" xref="mime-types-custom-user" />
+    <link type="seealso" xref="mime-types-custom" />
     <revision pkgversion="3.12" date="2014-06-17" status="review"/>
 
     <credit type="author">
diff --git a/system-admin-guide/C/mime-types-custom-user.page 
b/system-admin-guide/C/mime-types-custom-user.page
new file mode 100644
index 0000000..d45d82e
--- /dev/null
+++ b/system-admin-guide/C/mime-types-custom-user.page
@@ -0,0 +1,105 @@
+<page xmlns="http://projectmallard.org/1.0/";
+      type="topic" style="task"
+      id="mime-types-custom-user">
+
+  <info>
+    <link type="guide" xref="software#management" />
+    <link type="seealso" xref="mime-types" />
+    <revision pkgversion="3.12" date="2014-06-17" status="review"/>
+
+    <credit type="author">
+      <name>Petr Kovar</name>
+      <email>pknbe volny cz</email>
+    </credit>
+
+  </info>
+
+    <title>Add a custom MIME type for individual users</title>
+    <p>
+      To add a custom MIME type for individual users and register a default
+      application for that MIME type, you need to create a new MIME type
+      specification file in the <file>~/.local/share/mime/packages/</file>
+      directory and a <file>.desktop</file> file in the
+      <file>~/.local/share/applications/</file> directory.
+    </p>
+    <steps>
+      <title>Add a custom <code>application/x-newtype</code> MIME
+      type for individual users</title>
+      <item>
+        <p>
+          Create the <file>~/.local/share/mime/packages/application-x-newtype.xml</file>
+          file:
+        </p>
+        <code mime="application/xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info";>
+  <mime-type type="application/x-newtype">
+    <comment>new mime type</comment>
+    <glob pattern="*.xyz"/>
+  </mime-type>
+</mime-info>]]></code>
+      <p>
+        The sample <file>application-x-newtype.xml</file> file above
+        defines a new MIME type <sys>application/x-newtype</sys>
+        and assigns file names with the <file>.xyz</file> extension to
+        that MIME type.
+      </p>
+      </item>
+      <item>
+        <p>
+          Create a new <file>.desktop</file> file named, for example,
+          <file>myapplication1.desktop</file>, and place it in the
+          <file>~/.local/share/applications/</file> directory:
+        </p>
+        <code>[Desktop Entry]
+Type=Application
+MimeType=application/x-newtype
+Name=<var>My Application 1</var>
+Exec=<var>myapplication1</var></code>
+      <p>
+        The sample <file>myapplication1.desktop</file> file above
+        associates the <code>application/x-newtype</code> MIME type with an
+        application named <app>My Application 1</app>, which is
+        run by a command <cmd>myapplication1</cmd>.
+      </p>
+      </item>
+      <item>
+        <p>Update the MIME database for your changes to take effect:</p>
+        <screen><output>$ </output><input>update-mime-database ~/.local/share/mime</input>
+        </screen>
+      </item>
+      <item>
+        <p>Update the application database:</p>
+        <screen><output>$ </output><input>update-desktop-database ~/.local/share/applications</input>
+        </screen>
+      </item>
+      <item>
+        <p>
+          To verify that you have successfully associated
+          <file>*.xyz</file> files with the
+          <sys>application/x-newtype</sys> MIME type, first create
+          an empty file, for example <file>test.xyz</file>:
+        </p>
+        <screen><output>$ </output><input>touch test.xyz</input></screen>
+        <p>
+          Then run the <cmd>gvfs-info</cmd> command:
+        </p>
+        <screen><output>$ </output><input>gvfs-info test.xyz | grep "standard::content-type"</input>
+  standard::content-type: application/x-newtype</screen>
+        </item>
+        <item>
+          <p>
+          To verify that <file>myapplication1.desktop</file> has been
+          correctly set as the default registered application for the
+          <sys>application/x-newtype</sys> MIME type, run the
+          <cmd>gvfs-mime --query</cmd> command:
+          </p>
+        <screen><output>$ </output><input>gvfs-mime --query application/x-newtype</input>
+Default application for 'application/x-newtype': myapplication1.desktop
+Registered applications:
+       myapplication1.desktop
+Recommended applications:
+       myapplication1.desktop</screen>
+      </item>
+    </steps>
+</page>
+
diff --git a/system-admin-guide/C/mime-types-custom.page b/system-admin-guide/C/mime-types-custom.page
new file mode 100644
index 0000000..f2e588b
--- /dev/null
+++ b/system-admin-guide/C/mime-types-custom.page
@@ -0,0 +1,106 @@
+<page xmlns="http://projectmallard.org/1.0/";
+      type="topic" style="task"
+      id="mime-types-custom">
+
+  <info>
+    <link type="guide" xref="software#management" />
+    <link type="seealso" xref="mime-types" />
+    <link type="seealso" xref="mime-types-custom-user" />
+    <revision pkgversion="3.12" date="2014-06-17" status="review"/>
+
+    <credit type="author">
+      <name>Petr Kovar</name>
+      <email>pknbe volny cz</email>
+    </credit>
+
+  </info>
+
+    <title>Add a custom MIME type for all users</title>
+    <p>
+      To add a custom MIME type for all users on the system and register a default
+      application for that MIME type, you need to create a new MIME type
+      specification file in the <file>/usr/share/mime/packages/</file>
+      directory and a <file>.desktop</file> file in the
+      <file>/usr/share/applications/</file> directory.
+    </p>
+    <steps>
+      <title>Add a custom <sys>application/x-newtype</sys>
+      MIME Type for All Users</title>
+      <item>
+        <p>
+          Create the <file>/usr/share/mime/packages/application-x-newtype.xml</file>
+          file:
+        </p>
+        <code mime="application/xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info";>
+  <mime-type type="application/x-newtype">
+    <comment>new mime type</comment>
+    <glob pattern="*.xyz"/>
+  </mime-type>
+</mime-info>]]></code>
+      <p>
+        The sample <file>application-x-newtype.xml</file> file above
+        defines a new MIME type <sys>application/x-newtype</sys>
+        and assigns file names with the <file>.xyz</file> extension to
+        that MIME type.
+      </p>
+      </item>
+      <item>
+        <p>
+          Create a new <file>.desktop</file> file named, for example,
+          <file>myapplication1.desktop</file>, and place it in the
+          <file>/usr/share/applications/</file> directory:
+        </p>
+        <code>[Desktop Entry]
+Type=Application
+MimeType=application/x-newtype
+Name=<var>My Application 1</var>
+Exec=<var>myapplication1</var></code>
+      <p>
+        The sample <file>myapplication1.desktop</file> file above
+        associates the <sys>application/x-newtype</sys> MIME type
+        with an application named <app>My Application 1</app>,
+        which is run by a command <cmd>myapplication1</cmd>.
+      </p>
+      </item>
+      <item>
+        <p>As root, update the MIME database for your changes to take effect:</p>
+        <screen><output># </output><input>update-mime-database /usr/share/mime</input>
+        </screen>
+      </item>
+      <item>
+        <p>As root, update the application database:</p>
+        <screen><output># </output><input>update-desktop-database /usr/share/applications</input>
+        </screen>
+      </item>
+      <item>
+        <p>
+          To verify that you have successfully associated
+          <file>*.xyz</file> files with the
+          <sys>application/x-newtype</sys> MIME type, first create
+          an empty file, for example <file>test.xyz</file>:
+        </p>
+        <screen><output>$ </output><input>touch test.xyz</input></screen>
+        <p>
+          Then run the <cmd>gvfs-info</cmd> command:
+        </p>
+        <screen><output>$ </output><input>gvfs-info test.xyz | grep "standard::content-type"</input>
+  standard::content-type: application/x-newtype</screen>
+        </item>
+        <item>
+          <p>
+          To verify that <file>myapplication1.desktop</file> has been
+          correctly set as the default registered application for the
+          <sys>application/x-newtype</sys> MIME type, run the
+          <cmd>gvfs-mime --query</cmd> command:
+          </p>
+        <screen><output>$ </output><input>gvfs-mime --query application/x-newtype</input>
+Default application for 'application/x-newtype': myapplication1.desktop
+Registered applications:
+       myapplication1.desktop
+Recommended applications:
+       myapplication1.desktop</screen>
+      </item>
+    </steps>
+</page>
+
diff --git a/system-admin-guide/C/mime-types.page b/system-admin-guide/C/mime-types.page
index 999522d..0d9ceac 100644
--- a/system-admin-guide/C/mime-types.page
+++ b/system-admin-guide/C/mime-types.page
@@ -6,6 +6,7 @@
     <link type="guide" xref="software#management" />
     <link type="seealso" xref="mime-types-application" />
     <link type="seealso" xref="mime-types-application-user" />
+    <link type="seealso" xref="mime-types-custom-user" />
     <revision pkgversion="3.12" date="2014-06-17" status="review"/>
 
     <credit type="author">
diff --git a/system-admin-guide/Makefile.am b/system-admin-guide/Makefile.am
index 0f569ff..eef42fd 100644
--- a/system-admin-guide/Makefile.am
+++ b/system-admin-guide/Makefile.am
@@ -36,6 +36,8 @@ HELP_FILES = \
        mime-types.page \
        mime-types-application.page     \
        mime-types-application-user.page        \
+       mime-types-custom.page  \
+       mime-types-custom-user.page     \
        overrides.page                  \
        power-dim-screen.page           \
        printer-configuration.page      \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]