<chapter id="plugins">

<chapterinfo>
<authorgroup>
<author>&Anders.Lund; &Anders.Lund.mail;</author>
<!-- TRANS:ROLES_OF_TRANSLATORS -->
</authorgroup>
</chapterinfo>

<title>Working with Plugins</title>

<para>&kate; offers several types of plugin.  There are plugins for the &kate; editor
component, which are available to any application using the editor component, 
such as KDevelop, Quanta, Kile, &kwrite; and many others.  There are also plugins
only available in the &kate; editor itself.  There are two types of these plugins:
some are written in native C++, while others are written in the Python programming
language.  There are subtle differences in these, described below.</para>

<para>You can enable any type of plugin in the <link
linkend="configuring-kate-configdialog">configuration dialog</link>, which also
provides access to additional configuration options for plugins that require
it.</para>

<para>There are many plugins for various purposes available
and you can search the web for more. A few plugins are shipped with the
editor component, for inserting automatic braces, inserting files,
and exporting text as &HTML;.</para>

<sect1 id="editor-component-plugins">
<title>Editor Component Extensions</title>

<para>For information about available plugins, see the 
<ulink url="help:katepart/editor-component-plugins.html">Editor Component
Extensions section of the &katepart; Handbook</ulink>.</para>

</sect1>

<sect1 id="kate-application-plugins">
<title>&kate; Application Plugins</title>

<!-- from doc/kate-addons/index.docbook -->
<para>
&kate; plugins are additional functions for the &kate; editor.  They can
add extra menus and shortcuts, and extend &kate;'s features.  You can
install as many or as few as you like, from within &kate;.
Open &kate;'s configuration dialog with
<menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;...</guimenuitem></menuchoice>
Select <menuchoice><guimenu>Application</guimenu><guimenuitem>Plugins</guimenuitem></menuchoice> to
choose the wanted plugins.
</para>

<para>
The available application plugins are:
</para>
<itemizedlist>
<listitem>
<para>Backtrace Browser - Backtrace navigation tool view</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-build">Build Plugin</link> - Compile or Make and parse error messages</para>
</listitem>
<listitem>
<para>Close Except/Like - Close group of documents based on a common path or file extension</para>
</listitem>
<listitem>
<para>CTags - Look up definitions/declarations with CTags</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-fsbrowser">File system browser</link> -
  File system browser tool view</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-filetemplate">File Templates</link> -
  Create new files from templates</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-gdb">&gdb;</link> - Provides a
simple &gdb; frontend</para>
</listitem>
<listitem>
<para>Jovie Text-to-Speech - Adds a menu entry for speaking the text</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-mail">Mail files</link> - Send files
  via email</para>
</listitem>
<listitem>
<para>Multiline Tab Bar - Add a tab bar with multiple rows to &kate;'s main window</para>
</listitem>
<listitem>
<para>Open Header - Opens the corresponding .h/[.cpp|.c] file</para>
</listitem>
<listitem>
<para>Project Plugin - Project plugin for kate</para>
</listitem>
<listitem>
<para>Python Plugins - &pate; host for Python plugins</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-searchinfiles">Search &amp; Replace</link> - 
Search or replace patterns in opened documents or in files on disk</para>
</listitem>
<listitem>
<para>Snippets tool view - Tool view embedding the snippets management</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-sql">SQL Plugin</link> - Execute
query on SQL databases</para>
</listitem>
<listitem>
<para>Symbol Viewer - Extract and show reference symbols from source</para>
</listitem>
<listitem>
<para>Tab Bar - Adds a standard tab bar to &kate;'s main window</para>
<!--http://kate-editor.org/2011/04/25/kates-tab-bar-plugins/-->
</listitem>
<listitem>
<para>Terminal tool view - Tool view embedding a terminal widget</para>
</listitem>
<listitem>
<para>Text Filter - Easy text filtering</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-xmltools">&XML;Completetion</link> - Lists &XML; elements,
attributes, attribute values and entities allowed by DTD</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-xmlcheck">&XML; Validation</link>- Validates &XML; files using xmllint</para>
</listitem>

<!-- not in 4.10
<listitem>
<para>Text Snippets - Configurable Text Snippets</para>
</listitem-->
<!--listitem>
<para>Kate Python Browser Plugin - A Python browser plugin for Kate</para>
</listitem-->
<!--<listitem>
<para><link linkend="kate-application-plugin-exttools">External Tools</link></para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-snippets">Kate Snippets</link> - Snippets plugin with code completion support</para>
</listitem>
<para>Tabify - Adds a tab bar to Kate's main window</para>
http://kate-editor.org/2011/04/25/kates-tab-bar-plugins/
</listitem>
-->
</itemizedlist>
</sect1>

<sect1 id="pate">
<title>Python &pate; Plugins</title>

<para>The &pate; Python Plugin host makes available many plugins written in the
<ulink url="http://www.python.org/">Python programming language</ulink>.</para>

<para>To enable &pate; plugins, you must first enable the 
<guilabel>Python Plugins</guilabel> plugin in the 
<link linkend="config-dialog-plugins"><guilabel>Plugins</guilabel> page of
&kate;'s configuration dialog</link>.  You may then enable, disable, and
configure them in the <guilabel>Python Plugins</guilabel> page of the
configuration dialog.  For more information about configuring &pate; plugins, see
<xref linkend="pate-config"/>.</para>

<sect2 id="pate-plugins">
<title>Available Plugins</title>

<variablelist>

<varlistentry id="pate-plugin-block">
<term><guilabel>block</guilabel></term>
<listitem><para>
Plugins to help code editing
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-cmake_utils">
<term><guilabel>cmake_utils</guilabel></term>
<listitem><para>
CMake helper plugin
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-color_tools">
<term><guilabel>color_tools</guilabel></term>
<listitem><para>
Class encapsuling the ability to show color swatches (colored tooltips)
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-commentar">
<term><guilabel>commentar</guilabel></term>
<listitem><para>
Move an inlined comment before the current line with the same indentation level
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-django_utils">
<term><guilabel>django_utils</guilabel></term>
<listitem><para>
Django utilities: Snippets, and template utilities
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-expand">
<term><guilabel>expand</guilabel></term>
<listitem>
<para>User-defined text expansions.</para>

<para>Each text expansion is a simple function which must return a string.
This string will be inserted into a document by the <command>expandAtCursor</command> action.
For example, if you have a function <quote>foo</quote> in the
<filename>all.expand</filename> file which is defined as:</para>

<informalexample><programlisting>
def foo:
  return 'Hello from foo!'
</programlisting></informalexample>

<para>after typing <quote>foo</quote>, the action will replace <quote>foo</quote>
with <quote>Hello from foo!</quote>. The expansion function may have parameters
as well. For example, the <filename>text_x-c++src.expand</filename> file 
contains the <function>cl</function> function which creates a class (or class template). This will
expand <quote>cl(test)</quote> into:</para>

<informalexample><programlisting>
/**
 * \\brief Class \c test
 */
class test
{
public:
    /// Default constructor
    explicit test()
    {
    }
    /// Destructor
    virtual ~test()
    {
    }
};
</programlisting></informalexample>

<para>but <quote>cl(test, T1, T2, T3)</quote> will expand to:</para>

<informalexample><programlisting>
/**
 * \\brief Class \c test
 */
template &lt;typename T1, typename T2, typename T3&gt;
class test
{
public:
    /// Default constructor
    explicit test()
    {
    }
    /// Destructor
    virtual ~test()
    {
    }
};
</programlisting></informalexample>
</listitem>
</varlistentry>

<varlistentry id="pate-plugin-format">
<term><guilabel>format</guilabel></term>
<listitem><para>
Plugins to work with C++ code formatting
</para></listitem>
</varlistentry>

<!--not in 4.12
<varlistentry id="pate-plugin-gdb">
<term><guilabel>gdb</guilabel></term>
<listitem><para>
Use <application>gdb</application>, the GNU debugger, from &kate;
</para></listitem>
</varlistentry>
-->

<varlistentry id="pate-plugin-gid">
<term><guilabel>gid</guilabel></term>
<listitem>
<para>Browse the tokens in a <application>GNU idutils</application> ID file, and 
use it to navigate within a codebase.</para>

<para>The necessary parts of the ID file are held in memory to allow sufficient 
performance for token completion, when looking up the usage of a token, or 
jumping to the definition. <command>etags(1)</command> is used to locate the 
definition.</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-js_utils">
<term><guilabel>js_utils</guilabel></term>
<listitem><para>
JavaScript utilities: Autocomplete, Autocomplete jQuery, Checker JSLint, Pretty 
JSON, Snippets
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-python_autocomplete">
<term><guilabel>python_autocomplete</guilabel></term>
<listitem><para>
Python Autocompletion (beta, only for Python 2)
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-python_console_classic">
<term><guilabel>python_console_classic</guilabel></term>
<listitem><para>
Interactive console for inspecting &kate;'s internals and playing about
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-python_console_ipython">
<term><guilabel>python_console_ipython</guilabel></term>
<listitem><para>
IPython console for hacking &kate; and doing science
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-python_utils">
<term><guilabel>python_utils</guilabel></term>
<listitem><para>
Python Utilities: Parse Checker, PEP8 Checker, Pyflakes Checker, Snippets
</para></listitem>
</varlistentry>

<varlistentry id="pate-plugin-xml_pretty">
<term><guilabel>xml_pretty</guilabel></term>
<listitem><para>
A simple &XML; pretty printer. It formats &XML; with good indentation.
</para></listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="pate-config">
<title>Configuring &pate;</title>

<sect3 id="pate-config-manager">
<title>The <guilabel>Manager</guilabel> Tab</title>

<para>This tab contains a list of &pate; plugins.  To enable or disable them,
simply select or unselect the checkbox to the left of the plugin name.</para>

<para>To refresh the list of plugins, reload any currently running plugins, or
start any newly selected plugins, select the 
<guibutton>Reload Plugins</guibutton> button at the bottom of the window.</para>

<warning><para>Reloading a plugin may have unpredictable effects. Consider
saving your work before using this command.</para></warning>

</sect3>

<sect3 id="pate-config-documentation">
<title>The <guilabel>Documentation</guilabel> Tab</title>

<para>The <guilabel>Documentation</guilabel> tab contains information about the
actions, menu items, keyboard shortcuts, and configuration pages offered by 
&pate; plugins, as well as a reference for programmers using the functionality 
of the plugins.</para>

<para>The following tabs are available:</para>

<variablelist>

<varlistentry>
<term><guilabel>Actions</guilabel></term>
<listitem><para>Lists all the actions offered by the plugin, including the menu
item, icon, and keyboard shortcut that will invoke the action.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Configuration Pages</guilabel></term>
<listitem><para>Lists all the configuration pages offered by the plugin,
including their titles and icons.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Programmer's Reference</guilabel></term>
<listitem><para>Includes information about all the modules, classes, and
functions offered by a plugin, as generated by <command>pydoc</command>.</para>
</listitem>
</varlistentry>

</variablelist>

</sect3>

</sect2>

</sect1>

<!-- from doc/kate-addons/filetemplates.docbook -->
<sect1 id="kate-application-plugin-filetemplate">
<sect1info>
<authorgroup>
<author>&Anders.Lund; &Anders.Lund.mail;</author>
</authorgroup>
</sect1info>
<title>File Templates</title>

  <para>The File Templates plugin allows you to create files based on other
    files.</para>
  <para>When you first install &kate;, you need to enable the plugin:</para>
  <orderedlist>
        <listitem>
          <para>
            Click <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;</guimenuitem></menuchoice>
          </para>
        </listitem>
        <listitem>
          <para>
            In the tree on the left of the screen, click <guilabel>Plugins</guilabel>.
          </para>
        </listitem>
        <listitem>
          <para>
            In the <guilabel>Plugin Manager</guilabel> panel on the right, select <guilabel>File Templates</guilabel>, and then click <guibutton>OK</guibutton>.
          </para>
        </listitem>
   </orderedlist>
  <para>You can now use any file as a template (this creates a copy of the
    file with an empty &URL;.) Special template files can contain
    macros to fill in information such as your name, email address, the
    current date, and position the cursor at a
    convenient position in the new file.</para>
  <para>You can easily create a new template from an open document.</para>
  <para>Templates that you save to the template folder are
    listed under  the menu item <menuchoice><guimenu>File</guimenu><guimenuitem>New from
    Template</guimenuitem></menuchoice>.</para>
  <para>The template folder is part of the &kde; file system, and
    consists of at least</para>
    <itemizedlist>
      <listitem>
	<para>
	 <filename role="directory">$<envar>KDEDIR</envar>/share/applications/kate/plugins/katefiletemplates/templates</filename>
	</para>
      </listitem>
      <listitem>
       <para>
        <filename role="directory">$<envar>KDEHOME</envar>/share/applications/kate/plugins/katefiletemplates/templates.</filename>
	</para>
      </listitem>
    </itemizedlist>
    <para>If your <envar>KDEDIRS</envar> environment variable contains additional directories, those are
    searched for a similar subdirectory as well. If equally named templates are
    found, the one in the local (KDEHOME) folder is chosen.</para>
  <sect2 id="katefiletemplates-menu">
    <title>Menu Structure</title>

    <variablelist>
      <varlistentry>
        <term>
          <menuchoice>
            <guimenu>File</guimenu>
            <guisubmenu>New From Template</guisubmenu>
            <guimenuitem>Any File...</guimenuitem>
          </menuchoice>
        </term>
        <listitem><para>Presents you with an Open File dialog that allows
            you to use any file as a template. If the chosen file has the
            extension <filename>katetemplate</filename> it will be parsed
            for template information and macros.</para></listitem>
      </varlistentry>
      <!-- not in 4.4
      <varlistentry>
        <term>
          <menuchoice>
            <guimenu>File</guimenu>
            <guisubmenu>New From Template</guisubmenu>
            <guimenuitem>Use Recent</guimenuitem>
          </menuchoice>
        </term>
        <listitem><para>Presents a list of files recently used as
            templates, represented by their &URL;.</para></listitem>
      </varlistentry>
      -->
      <varlistentry>
        <term>
          <menuchoice>
            <guimenu>File</guimenu>
            <guimenuitem>New From Template</guimenuitem>
          </menuchoice>
        </term>
        <listitem><para>The remainder of submenus contain links to
            templates. Click a menu item to create a file as described by
            the menu item text.</para></listitem>
      </varlistentry>

      <!-- Settings menu -->

      <varlistentry>
        <term>
          <menuchoice><guimenu>Settings</guimenu><guimenuitem>Manage
              Templates...</guimenuitem></menuchoice></term>
        <listitem><para>This will launch a dialog with a list of all templates
            found within the template directories, along with options to add,
            edit or remove templates.</para></listitem>
      </varlistentry>
    </variablelist>
  </sect2>

  <sect2 id="katefiletemplates-use">
    <title>Using a &kate; Template</title>
    <para>When creating a file from a template that contains template
      macros, some macros appear as editable variables in the text. Such
      variables appear as underlined words in the text.</para>
    <para>The first variable will be selected, so you just have to type to edit
      it. If the document text contains more instances of the same variable,
      they are changed as you edit. To move to the next editable variable,
      press the &Tab; key. When the last variable is edited, the list is
      dropped, and your &Tab; key works as normal.</para>
  </sect2>

  <sect2 id="katefiletemplates-create">
    <title>Creating your own templates</title>
    <para>To create a new template, use the
      <menuchoice><guimenu>Settings</guimenu>
        <guimenuitem>Manage Templates</guimenuitem></menuchoice> Item to launch
      the template management dialog. In that, click
      <guibutton>New...</guibutton> to launch the File Template Wizard. You
      will be asked for an optional file to turn into a template and prompted
      for template information settings, and a template file will be created for
      you.</para> <para>Alternatively, you can create a template manually by
      adding template information to the top of any file, add text and macros,
      and save it with the <filename>katetemplate</filename> extension.</para>
    <para>The template menu is automatically updated if you chose to store
      your template in the template directory.</para>
  </sect2>

  <sect2 id="katefiletemplates-edit">
    <title>Editing templates</title>
    <para>To edit a template, use the
      <menuchoice><guimenu>Settings</guimenu>
        <guimenuitem>Manage Templates...</guimenuitem></menuchoice>. Select the
      template you want to work on and click <guibutton>Edit...</guibutton>,
      and the template file will be opened. Close the dialog, edit the template
      file as desired, save it and close it. Changes to templates take
      immediate effect; you can activate the template to test your changes after
      saving it.</para>
  </sect2>

  <sect2 id="katefiletemplates-format">
    <title>The &kate; Template Format</title>
    <para>If you use files with the extension
      <filename>katetemplate</filename>, they will be parsed for template
      information, macros and a cursor position.</para>

    <sect3 id="katefiletemplates-template-info">
      <title>Template information</title>
      <para>While reading in the file, the parser keeps
        lines beginning with the phrase
        <constant>katetemplate:</constant> and searches them for
        template information in the form VARIABLENAME=VALUE. The first line not
        starting with <constant>katetemplate:</constant> will be taken as the
        start of the template contents. VALUE may contain any character but
        equal sign (=). Legal variable names are:
        <variablelist>
          <varlistentry>
            <term><varname>Template</varname></term>
            <listitem><para>This is the template name, displayed in the
                <menuchoice><guimenu>File</guimenu><guimenuitem>New from
                Template</guimenuitem></menuchoice> menu.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term><varname>Group</varname></term>
            <listitem><para>The group places the template in a submenu of
                the <menuchoice><guimenu>File</guimenu><guimenuitem>New from
                    Template</guimenuitem></menuchoice> menu.</para></listitem>
          </varlistentry>
          <varlistentry><term><varname>Name</varname></term>
            <listitem><para>This is the name that will be set for the
                document, and displayed in the file list and title bar. If the
                name contains <userinput>%N</userinput> that will be replaced
                with a number, incrementing if more documents have the same
                name.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term><varname>Highlight</varname></term>
            <listitem><para>The plugin will try to set the Highlight for
                the new document to the value of this variable. The value
                should be the name, as found in
                <menuchoice><guimenu>Tools</guimenu>
                  <guimenuitem>Highlighting</guimenuitem>
                </menuchoice>.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><varname>Description</varname></term>
            <listitem><para>A short informative description of the
                template. This is currently used to set a <guimenuitem>What's this?</guimenuitem> string for
                the menu item, but may be used for additional purposes in the
                future.</para></listitem>
          </varlistentry>
          <varlistentry><term>Author</term>
            <listitem><para>A string identifying the author, for example
                in the form <userinput>Name &lt;email address&gt;</userinput>.
                This is currently used to set a <guimenuitem>What's this?</guimenuitem> string for the menu
                item, but may be used for additional purposes in the
                future.</para></listitem>
          </varlistentry>
        </variablelist>
      </para>

    </sect3>

    <sect3 id="katetemplates-macros">
      <title>Template Macros</title>

      <para>While parsing the template contents, macros in the form
        <userinput>%{NAME}</userinput> or <userinput>${NAME}</userinput> are
        expanded. If you use the <userinput>$</userinput> prefix, the
        expanded macro will be treated as a editable variable when a document
        is created from the template, whereas if you use
        <userinput>%</userinput> it is not, unless expanding failed.</para>
      <para>The following macros are expanded:
        <variablelist>
          <varlistentry><term><literal>time</literal></term>
            <listitem><para>Expands to the current time in your locale
                format.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term><literal>date</literal></term>
            <listitem><para>Expands to the current date in short
                format.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term><literal>datetime</literal></term>
            <listitem><para>Expands to the current date and time,
                formatted as a string according to your
                locale.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term><literal>year</literal></term>
            <listitem><para>The current year as a four digit
                number.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term><literal>month</literal></term>
            <listitem><para>The full name of the current month, according
                to your locale.</para></listitem>
          </varlistentry>
          <varlistentry><term><literal>day</literal></term>
            <listitem><para>Expands to the current day of the month.</para>
            </listitem>
          </varlistentry>
          <varlistentry><term><literal>hostname</literal></term>
            <listitem><para>Expands to the hostname of your computer.</para>
            </listitem>
          </varlistentry>
          <varlistentry><term><literal>index</literal></term>
            <listitem><para>Expands to 'i'.</para></listitem>
          </varlistentry>
          <varlistentry><term><literal>fullname</literal></term>
            <listitem><para>Expands to your full name, as defined in the
                owner addressee in your standard &kde;
                addressbook.</para></listitem>
          </varlistentry>
          <varlistentry><term><literal>firstname</literal></term>
            <listitem><para>Expands to your first name, as defined in the owner
                addressee in your standard &kde; addressbook.</para>
            </listitem>
          </varlistentry>
          <varlistentry><term><literal>lastname</literal></term>
            <listitem><para>Expands to your last name, as defined in the owner
                addressee in your standard &kde; addressbook.</para>
            </listitem>
          </varlistentry>
          <!-- <varlistentry>
            <term>username</term>
            <listitem><para>Expands to your username.</para></listitem>
          </varlistentry> -->
          <varlistentry>
            <term>email</term>
            <listitem><para>Expands to your email address, as defined in
                the owner address in your standard &kde;
                addressbook.</para></listitem>
          </varlistentry>
          <!--<varlistentry>
            <term>organisation</term>
            <listitem><para>This is your organisation, as defined by
                the owner address in your standard KDE
                addressbook.</para></listitem>
          </varlistentry>-->
        </variablelist>
      </para>
      <para>Any macro not in the above list is treated as an editable variable
        no matter the prefix.
        If the same variable occurs multiple times in the template, they can be
        edited at once after creating a document from the template.</para>
    </sect3>

    <sect3 id="katefiletemplates-cursor">
      <title>Setting the cursor position</title>
      <para>The special macro <userinput>${cursor}</userinput> will be replaced
        with a vertical bar and added to the end of the list of editable variables,
        independent of its location in the text.</para>
    </sect3>

  </sect2>
  <sect2>
    <title>Thanks and Acknowledgments</title>
    <para>
      &kate; Plugin <quote>File Templates</quote> copyright 2004 &Anders.Lund;
      &Anders.Lund.mail;.
    </para>
    <para>Documentation copyright 2004 &Anders.Lund;</para>
  </sect2>
</sect1>

<!-- from doc/kate-addons/xmlcheck.docbook -->
<sect1 id="kate-application-plugin-xmlcheck">
<sect1info>
<authorgroup><author>
&Daniel.Naber; &Daniel.Naber.mail;
</author></authorgroup>
</sect1info>

<title>&XML; Validation</title>

<para>This plugin checks &XML; files for validity and being well-formed.</para>
<para>This plugin checks the current file. A list of warnings and errors
will appear at the bottom of &kate;'s main window. You can click on an error message
to jump to the corresponding place in the file. If the file has a <quote>DOCTYPE</quote>
the DTD given with this doctype will be used to check the file for validity. The
DTD is expected at a position relative to the current file, &eg; if the doctype
refers to <quote>DTD/xhtml1-transitional.dtd</quote> and the file is <filename>/home/peter/test.xml</filename>
the DTD is expected to be located at <filename>/home/peter/DTD/xhtml1-transitional.dtd</filename>.
However, remote DTDs specified via http are supported.</para>

<para>If the file has no doctype it will be checked for being well-formed.</para>

<para>To learn more about &XML; check out the <ulink url="http://www.w3.org/XML/"> official W3C &XML; pages</ulink>.</para>

<para>Internally this plugin calls the external command <command>xmllint</command>, which
is part of libxml2. If this command is not correctly installed on your system, the plugin
will not work.</para>

<note><para>A temporary file needs to be written to the same folder as the file
that is being checked is in, so you need to have write access to that folder.</para></note>

<para>To load this plugin open &kate;'s configuration dialog under <menuchoice><guimenu>Settings</guimenu>
<guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
Then select <guilabel>&XML; Validation</guilabel> which will appear
in the <guilabel>Application</guilabel> / <guilabel>Plugins</guilabel> section and close the dialog.
</para>

<sect2 id="xmlcheck-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry>
<term>
<menuchoice>
<guimenu>&XML;</guimenu>
<guimenuitem>Validate &XML;</guimenuitem>
</menuchoice>
</term>
<listitem><para>This will start the check, as described above.</para></listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="xmlcheck-thanks-and-acknowledgements">
<title>Thanks and Acknowledgments</title>
<para>
&kate; Plugin <quote>&XML; Validation</quote> copyright 2002 &Daniel.Naber;
&Daniel.Naber.mail;.
</para>
<para>Documentation copyright 2002 &Daniel.Naber;</para>

</sect2>
</sect1>

<sect1 id="kate-application-plugin-xmltools">
<sect1info>
<authorgroup><author>
&Daniel.Naber; &Daniel.Naber.mail;
</author></authorgroup>
</sect1info>
<title>&XML; Completion</title>

<para>This plugin gives hints about what is allowed at a certain position in
an &XML; file, according to the file's DTD. It will list possible
elements, attributes, attribute values or entities, depending on the
cursor position (&eg; all entities are listed if the character on the left
of the cursor is <quote>&amp;</quote>). It's also possible to close the nearest
open tag on the left.</para>

<para>The <acronym>DTD</acronym> must exist in &XML; format, as produced by the Perl program
<command>dtdparse</command>. We will call a DTD in this format <quote>meta DTD</quote>.
Some meta DTDs are supplied. They are installed in
<filename class="directory">$KDEDIR/share/apps/katexmltools/</filename>,
which is also the default folder when you choose
<guimenuitem>Assign Meta DTD...</guimenuitem>.
To produce your own meta DTDs, get <command>dtdparse</command> from
<ulink url="http://dtdparse.sourceforge.net">http://dtdparse.sourceforge.net</ulink>.</para>

<sect2 id="xmltools-how-to-use">
<title>How to Use</title>

<para>Start &kate; and open the configuration dialog under <menuchoice><guimenu>Settings</guimenu>
<guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
Then select <guilabel>&XML; Completion</guilabel> which will appear
in the <guilabel>Application</guilabel>/<guilabel>Plugins</guilabel> section and close the dialog. After
that, select <menuchoice><guimenu>&XML;</guimenu><guimenuitem>Assign Meta DTD...</guimenuitem></menuchoice>.
If your document contains no <quote>DOCTYPE</quote> or the doctype is unknown, you will have to
select a meta DTD from the file system. Otherwise the meta DTD that
matches the current document's DOCTYPE will be loaded automatically.</para>

<para>You can now use the plugin while typing your text:</para>

<variablelist>

<varlistentry>
<term><keycap>&lt;</keycap> (less than key)</term>
<listitem><para>This will trigger a list of possible elements unless the
cursor is inside a tag already. Note that you currently cannot use
this to insert the top level element (&eg; <quote>&lt;html&gt;</quote>).</para></listitem>
</varlistentry>

<varlistentry>
<term><keycap>&lt;</keycap><keycap>/</keycap>(less than key + slash)</term>
<listitem><para>Entering these characters will offer to close the current element
(nearest open one to the left of the cursor). Press &Enter; to accept the suggestion.
Unlike the <guimenuitem>Close Element</guimenuitem> menu item, this works only with
a DTD assigned.</para></listitem>
</varlistentry>

<varlistentry>
<term><keycap>"</keycap> (quote key)</term>
<listitem><para>The quote key will trigger a list of possible attribute
values (if there are any) if you are inside a tag.</para></listitem>
</varlistentry>

<varlistentry>
<term><keycap>&nbsp;</keycap> (space key)</term>
<listitem><para>This key will trigger a list of possible attributes for the
current element if you are inside a tag.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><keycap>&amp;</keycap> (ampersand key)</term>
<listitem><para>This key will trigger a list of named entities.</para></listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="xmltools-features-and-limitations">
<title>Features and Limitations</title>

<para>You can test all functions and limitations by loading
<filename>$KDEDIR/share/apps/katexmltools/testcases.xml</filename>
into &kate; and following the instructions.</para>

</sect2>


<sect2 id="xmltools-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry>
<term>
<menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>Return</keycap></keycombo>
</shortcut>
<guimenu>&XML;</guimenu>
<guimenuitem>Insert Element...</guimenuitem>
</menuchoice>
</term>
<listitem><para>This will open a dialog that lets you insert an &XML; element.
The &lt;, &gt; characters and the closing tag will be inserted automatically.
If you have selected text when this menu item is selected, the selected
text will be surrounded by the opening and the closing tag.
The dialog also offers completion of all elements that may be inserted
at the current cursor position if you have assigned a meta DTD by
using <guimenuitem>Assign Meta DTD...</guimenuitem>.
</para></listitem>
</varlistentry>

<varlistentry>
<term>
<menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>&lt;</keycap></keycombo>
</shortcut>
<guimenu>&XML;</guimenu>
<guimenuitem>Close Element</guimenuitem>
</menuchoice>
</term>
<listitem><para>This will search your text for a tag that is not yet closed
and will close it by inserting the corresponding closing tag.
The search starts at the cursor position and goes left. If
it cannot find an open tag nothing will happen.</para></listitem>
</varlistentry>

<varlistentry>
<term>
<menuchoice>
<guimenu>&XML;</guimenu>
<guimenuitem>Assign Meta DTD...</guimenuitem>
</menuchoice>
</term>
<listitem><para>This will tell the plugin which meta DTD to use for the
current document. Note that this assignment will not be saved.
You will have to repeat it when you start &kate; the next time.</para></listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="xmltools-thanks-and-acknowledgements">
<title>Thanks and Acknowledgments</title>
<para>
&kate; Plugin <quote>&XML; Completion</quote> copyright 2001,2002 &Daniel.Naber;
&Daniel.Naber.mail;.
</para>
<para>KDE SC 4 version copyright 2010 Tomáš Trnka</para>
<para>Documentation copyright 2001,2002 &Daniel.Naber;</para>
</sect2>

</sect1>
<!--FIXME this belongs to Extensions, it is an editor plugin-->
<sect1 id="kate-editor-plugin-exporter">
<!--<sect1info>
<authorgroup><author>
&TC.Hollingsworth; &TC.Hollingsworth.mail;
</author></authorgroup>
</sect1info>-->
<title>Exporter</title>

<sect2 id="exporter-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry>
<term>
<menuchoice>
<guimenu>File</guimenu>
<guimenuitem>Export as &HTML;...</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>
Export your file in &HTML; format so your document can be viewed as a web page.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<menuchoice>
<guimenu>Edit</guimenu>
<guimenuitem>Copy as &HTML;...</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>Copies selected text with the syntax highlight as &HTML; text.</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>
</sect1>

<sect1 id="kate-application-plugin-searchinfiles">
<sect1info>
<authorgroup><author>
&TC.Hollingsworth; &TC.Hollingsworth.mail;
</author></authorgroup>
</sect1info>
<title>Search &amp; Replace</title>

<sect2 id="searchinfiles-intro">
<title>Introduction</title>
<para>&kappname;'s Search &amp; Replace plugin allows you to search for text or
<ulink url="help:katepart/regular-expressions.html">regular expressions</ulink>
in many different files at once.  You can search all open files, all the files
in one directory and optionally its subdirectories, or all files in the current
project.  You can even filter by filename, for instance searching only files
that end with a particular file extension.</para>

</sect2>

<sect2 id="searchinfiles-ui">
<title>Interface</title>

<sect3 id="searchinfiles-ui-query">
<title>Search Query</title>

<para>The following options are always displayed at the top of the Search in
Files tool view:</para>

<variablelist>

<varlistentry>
<term><guiicon>New Tab</guiicon></term>
<listitem><para>
You can have as many searches as you want open at the same time.  Simply click
the <guibutton>New Tab</guibutton> button at the top-left corner of the Search
tool view and a new results tab will open permitting you to perform another
search.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon>Toggle Results</guiicon></term>
<listitem><para>
The down arrow in the top right-corner of the Search in Files tool view will
toggle the bottom half of the tool view between displaying additional options
for the Search in Folder mode and the results of your search.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Find</guilabel></term>
<listitem><para>
This is where you type in what you want to find.  You may enter standard text, 
or a regular expression if enabled.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Replace</guilabel> (text box)</term>
<listitem><para>
Replacement text that will be added to file(s) in place of the text in the
<guilabel>Find</guilabel> text box.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Search</guibutton></term>
<listitem><para>
When you've finished configuring everything, just press the
<guibutton>Search</guibutton> button to perform your search.  You may also press
&Enter; in the <guilabel>Find</guilabel> text box to do the same.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Replace</guibutton></term>
<listitem><para>
When you've finished configuring everything, just press the
<guibutton>Replace</guibutton> button to replace the text entered in the
<guilabel>Find</guilabel> text box with that of the <guilabel>Replace</guilabel>
text box.  You may also press &Enter; in the <guilabel>Replace</guilabel> text 
box to do the same.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Next</guibutton></term>
<listitem><para>
Go to the next match of your search query, switching files if necessary.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Replace checked</guibutton></term>
<listitem><para>
The same as <guibutton>Replace</guibutton>, but will only perform replacements
in files that are checked in the pane below.
</para></listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="searchinfiles-ui-folder">
<title>Search in Folder Options</title>

<para>These options are displayed below the aforementioned query options. If search
results are being displayed instead, press the <guiicon>Toggle Results</guiicon>
button to display them.</para>

<variablelist>

<varlistentry>
<term><guilabel>Match case</guilabel></term>
<listitem><para>
Restricts search results to only those that have the exact same combination
of upper and lower case letters as your search query.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Regular expressions</guilabel></term>
<listitem><para>
Permits you to use <ulink url="help:katepart/regular-expressions.html">regular
expressions</ulink> instead of simple text as your search query.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Expand results</guilabel></term>
<listitem><para>
Display all the results found in each file, instead of just a list of files
that contain the search query.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Search</guilabel></term>
<listitem><para>
This has three options.  Select <guilabel>in Open files</guilabel> to search all
files currently open in &kappname;.  Select <guilabel>in Folder</guilabel> to
search inside a folder and optionally its subfolders.  Select <guilabel>in
Project</guilabel> to search all the files listed in the currently open project.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Folder</guilabel></term>
<listitem><para>
You may enter the path of the folder you wish to search.  For instance, you might
enter <userinput>~/development/kde/kate/</userinput> if you wished to search the
&kate; source code.  This option is only available when using 
<guilabel>in Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon>Open file dialog</guiicon></term>
<listitem><para>
Press this button to locate the folder in your desktop's folder browser. This 
button only works when using <guilabel>in Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon>Up</guiicon></term>
<listitem><para>
Press this button to change <guilabel>Folder</guilabel> to the parent of the
currently selected folder. This button only works when using 
<guilabel>in Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon>Restore Current Folder</guiicon></term>
<listitem><para>
This button will set the <guilabel>Folder</guilabel> entry to the folder in which
the currently open document is located. This  button only works when using 
<guilabel>in Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Filter</guilabel></term>
<listitem><para>
This permits you to only search filenames that match a particular pattern.  For
instance, to only search files written in C++, change it to
<userinput>*.cpp</userinput>.  To search only files beginning with
<literal>kate</literal>, change it to <userinput>kate*</userinput>.  You can
enter multiple filters separated with a comma (<userinput>,</userinput>).  This
option is not available when using <guilabel>in Open files</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Exclude</guilabel></term>
<listitem><para>
The opposite of <guilabel>Filter</guilabel>, this prevents &kappname; from
searching files that match the specified patterns.  As with 
<guilabel>Filter</guilabel>, you can enter multiple patterns separated with a 
comma (<userinput>,</userinput>). This option is not available when using
<guilabel>in Open files</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Recursive</guilabel></term>
<listitem><para>
If this option is enabled, &kappname; will also search in all subfolders of the
selected folder. This option is only available when using 
<guilabel>in Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Include hidden</guilabel></term>
<listitem><para>
If this option is enabled, &kappname; will also search in files or folders that
are typically hidden by your &OS;. This option is only available when using 
<guilabel>in Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Follow symbolic links</guilabel></term>
<listitem><para>
The Search in Files plugin typically doesn't follow
<ulink url="http://en.wikipedia.org/wiki/Symbolic_link">symbolic links</ulink>.
When this option is enabled, the plugin will follow them instead and search inside
the files or folders they reference. This option is only available when using 
<guilabel>in Folder</guilabel> mode.
</para>
<warning><para>It's possible for symbolic links to reference a folder that is the
parent of the folder currently being searched, or other folders that contain
symbolic links to their parent.  If there is such a link in the folder being
searched and this option is enabled, &kappname; will repeatedly follow the link
and search the folder, and the search will never complete.</para></warning>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Include binary files</guilabel></term>
<listitem><para>
If enabled, &kappname; will also search in files that do not appear to be text
files.
</para></listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="searchinfiles-ui-results">
<title>Search Results</title>

<para>The results of your search are displayed below the query options.  If
options for Search in Folder mode are displayed, simply press the
<guiicon>Toggle Results</guiicon> button to display them.  They will also
automatically be displayed as soon as a search is performed.</para>

<para>The search results display a list of files that contains text that matches
your search query, followed by the number of matches found in that file.</para>

<para>To see a list of matches in that file, simply click the expansion arrow
to the left of the file name.  (If you selected the <guilabel>Expand 
results</guilabel> option, this will already be done for you.)  The line number
each match is found on will be displayed, followed by the contents of that line,
with your search query indicated in bold text.</para>

<para>To open the file your result was found in, simply double-click it.  &kappname;
will open the file if needed.  You can also move the cursor to the location of
a particular match by double-clicking on its listing instead of the file name.
</para>

</sect3>
</sect2>

<sect2 id="searchinfiles-menu">
<title>Menu Structure</title>

<variablelist>

<varlistentry>
<term>
<menuchoice>
<guimenu>Edit</guimenu>
<guimenuitem>Search in Files</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>Launches the Search and Replace tool view.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<menuchoice>
<guimenu>Edit</guimenu>
<guimenuitem>Go to Next Match</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>Go to the next match in a search performed by the Search and Replace
plugin.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<menuchoice>
<guimenu>Edit</guimenu>
<guimenuitem>Go to Previous Match</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>Go to the previous match in a search performed by the Search and Replace
plugin.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Search and Replace</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>Toggle the display of &kappname;'s <guilabel>Search and Replace</guilabel> tool.
</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>
</sect1>

<sect1 id="kate-application-plugin-mail">
<!--<sect1info>
<authorgroup><author>
&TC.Hollingsworth; &TC.Hollingsworth.mail;
</sect1info>-->
<title>Mail Files</title>

<sect2 id="mail-menu">
<title>Menu Structure</title>
<variablelist>

<varlistentry>
<term>
<menuchoice>
<guimenu>File</guimenu>
<guimenuitem>Mail...</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>
Open your mail client and attach the file in the mail.
</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>
</sect1>

<sect1 id="kate-application-plugin-fsbrowser">
<!--<sect1info>
<authorgroup><author>
&TC.Hollingsworth; &TC.Hollingsworth.mail;
</author></authorgroup>
</sect1info>-->
<title>Filesystem Browser</title>

<para>The Filesystem Browser is a folder viewer, allowing you to open
files from a displayed folder in the current frame.</para>

<sect2 id="fsbrowser-menu">
<title>Menu Structure</title>
<variablelist>

<varlistentry>
<term>
<anchor id="view-toolviews-show-fileselector"/>
<menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Filesystem Browser</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>Toggle the display of &kate;'s Filesystem Browser.</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="fsbrowser-interface">
<title>Interface</title>

<para>From the top down, the Filesystem Browser consists of the following
elements:</para>

<variablelist>
<varlistentry>
<term>A Toolbar</term>
<listitem>
<para>This contains standard navigations tool buttons:</para>
<variablelist>
<varlistentry>
<term><guibutton>Back</guibutton></term>
<listitem><para>Causes the folder view to <command>cd</command> to the previously displayed folder in the history.
This button is disabled, if there is no previous item.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Forward</guibutton></term>
<listitem><para>Causes the folder view to <command>cd</command> to the next folder in the history.
This button is disabled, if there is no next folder.</para></listitem>
</varlistentry>
<!--varlistentry>
<term><guibutton>Parent Folder</guibutton></term>
<listitem><para>This will cause the folder view to <command>cd</command> to the immediate parent of the currently displayed
folder if possible.</para></listitem>
</varlistentry-->
<varlistentry>
<term><guibutton>Bookmarks</guibutton></term>
<listitem><para>Opens a submenu to edit or add bookmarks and to add a new bookmark folder.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Current Document Folder</guibutton></term>
<listitem><para>This button will cause the folder view to
<command>cd</command> to the folder of the currently active
document if possible. This button is disabled, if the active document
is a new, unsaved file, or the folder in which it resides can not
be decided.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Options</guibutton></term>
<listitem>
<variablelist>
<varlistentry>
<term><guimenuitem>Short View</guimenuitem></term>
<listitem><para>Displays only the filenames.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Detailed View</guimenuitem></term>
<listitem><para>Displays <guilabel>Name</guilabel>, <guilabel>Date</guilabel>,
<guilabel>Size</guilabel> and <guilabel>Type</guilabel> of the files.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Tree View</guimenuitem></term>
<listitem><para>Like Short View, but folders can be expanded to view their contents.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Detailed Tree View</guimenuitem></term>
<listitem><para>This also allows folders to be expanded, but displays the additional columns
available in Detailed View.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Show Hidden Files</guimenuitem></term>
<listitem><para>Displays files normally hidden by your &OS;.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Automatically synchronize with current document</guimenuitem></term>
<listitem><para>When this option is enabled the filesystem browser will automatically <command>cd</command>
to the folder of the document currently open in the editing area every time it changes.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term>A Location Entry</term>
<listitem>
<para>This displays a breadcrumb navigation to the currently open folder, similarly to
&dolphin;.  You can click on a any folder to browse to it, or click on one of the
arrows to the left of a folder to select any folders beneath it.  You may also
select from your list of Places by clicking the leftmost icon in the breadcrumb
navigation, which displays an icon that represents your current Place.</para>

<para>You can also click to the right of the breadcrumbs to change them to a text box
where you can type the path of a folder to browse. The &URL;
entry maintains a list of previously typed paths. To choose one, use
the arrow button to the right of the entry.</para>
<tip><para>The &URL; entry has folder auto-completion. The completion
method can be set using the &RMB; menu of the text
entry.</para></tip>
</listitem>
</varlistentry>

<varlistentry>
<term>A Folder View</term>
<listitem><para>This is a standard &kde; folder view.</para></listitem>
</varlistentry>

<varlistentry>
<term>A Filter Entry</term>
<listitem>
<para>The Filter entry allows you to enter a filter for the files
displayed in the folder view. The filter uses standard globs; patterns
must be separated by white space. Example: <userinput>*.cpp *.h
*.moc</userinput></para>
<para>To display all files, enter a single asterisk
<userinput>*</userinput>.</para>
<para>The filter entry saves the last 10 filters entered between
sessions.  To use one, press the arrow button on the right of the entry
and select the desired filter string.  You can disable the filter by pressing
the <guibutton>Clear text</guibutton> button to the left of the autocompletion
arrow button.</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>


<sect2 id="fsbrowser-config">
<title>Configuration</title>

<para>This plugin can be configured on the <guilabel>Filesystem Browser</guilabel> page
of <link linkend="configuring-kate-configdialog">&kate;'s configuration</link>.</para>

<variablelist>
<varlistentry>
<term><guilabel>Toolbar</guilabel></term>
<listitem><para>Configure the buttons on the Filesystem Browser toolbar
by moving the ones you want enabled to the <guilabel>Selected Actions</guilabel>
list, and order them using the arrow buttons at the side of the list.</para>
 </listitem>
</varlistentry>

</variablelist>
</sect2>
</sect1>

<!--some material from mdi.docbook needs to be migrated here too-->
<!--<sect1 id="kate-application-plugin-exttools">
<sect1info>
<authorgroup><author>
&TC.Hollingsworth; &TC.Hollingsworth.mail;
</author></authorgroup>
</sect1info>
<title>External Tools</title>

<para>In the <guimenu>Tools</guimenu> menu you will find a submenu labeled
<guisubmenu>External Tools</guisubmenu>, if you have enabled them in &kate; settings.
These tools invoke external applications with data related to the current document,
for example its URL, directory, text or selection.</para>

<para>External tools are user defined, you can add, edit or remove tools using
the <link linkend="exttools-config">External Tools</link> configuration panel.
</para>

<sect2 id="exttools-menu">
<title>Menu Structure</title>
<variablelist>

<varlistentry>
<term><menuchoice><guimenu>Tools</guimenu><guisubmenu>External
Tools</guisubmenu></menuchoice></term>
<listitem><para>This submenu contains all the external tools you have
configured.</para></listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="exttools-config">
<title>Configuration</title>

<para>External tools are configured on the <guilabel>External Tools</guilabel> page
of <link linkend="configuring-kate-configdialog">&kate;'s configuration</link>. These tools invoke external
applications with data related to the current document, for example its URL,
directory, text or selection. This page allows you to manage the menu and edit,
remove or add new tools.</para>

<para>Each external tool is a shell command which contains macros representing
the document data. When activated, the macros are substituted with data from the
active document.</para>

<variablelist>
<title>Available Commands</title>

<varlistentry>
<term><guibutton>New</guibutton></term>
<listitem><para>Add a new external tool to the list.  This will launch the property
sheet described below where you can configure an external tool.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Edit</guibutton></term>
<listitem><para>Edit the currently selected external tool, using the property
sheet described below.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Insert Separator</guibutton></term>
<listitem><para>Adds a separator line that appears in the menu below the currently
selected item.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Up Arrow</guibutton></term>
<listitem><para>Moves the currently selected item above the previous
one.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Down Arrow</guibutton></term>
<listitem><para>Moves the currently selected item below the subsequent
one.</para></listitem>
</varlistentry>

</variablelist>

<variablelist>
<title>External Tools Properties</title>
<varlistentry>
<term><guilabel>Label</guilabel></term>
<listitem><para>A friendly label that will appear in the <guisubmenu>External Tools</guisubmenu> menu.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Icon</guibutton></term>
<listitem><para>Allows you to select an icon that appears next to the label in the
<guisubmenu>External Tools</guisubmenu> menu.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Script</guilabel></term>
<listitem><para>The script to execute when the tool is activated. Before passing
the script to the shell, the following macros are substituted:

<variablelist>
<varlistentry>
<term><userinput>%URL</userinput></term>
<listitem><para>The full URL of the current document, or an empty string if the
document is unsaved.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput>%URLs</userinput></term>
<listitem><para>A space separated list of the URLs of all open documents
(except unsaved ones).</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput>%directory</userinput></term>
<listitem><para>The directory part of the current documents URL or an empty
string if the current document is unsaved.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput>%filename</userinput></term>
<listitem><para>The filename of the current document without the path, or an
empty string if the current document is unsaved.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput>%line</userinput></term>
<listitem><para>The line number of the insertion cursor is in the current
document.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput>%column</userinput></term>
<listitem><para>The column number of the insertion cursor in the current
document.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput>%selection</userinput></term>
<listitem><para>The selected text in the current document, or an empty string
if no text is selected</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput>%text</userinput></term>
<listitem><para>The full text of the current document. Beware that this may
potentially exceed the maximum command length allowed on your system.
Use with care.</para></listitem>
</varlistentry>

</variablelist>

</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Executable</guilabel></term>
<listitem><para>The main executable in the script. This is mandatory, and is used
to test if the command can be run at all. A fully qualified path is allowed
in case the executable is not in your <envar>PATH</envar> variable.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Mime types</guilabel></term>
<listitem><para>A semicolon separated list of mimetypes for which this command
should be enabled.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Save</guilabel></term>
<listitem><para>You can optionally select to have the current or all documents
saved prior to executing the script. This is handy if your script reads the file
from disk.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Command line name</guilabel></term>
<listitem><para>If you fill this, the tool will be available in the
<link linkend="advanced-editing-tools-commandline">editors command line</link> as
<command>exttool-<replaceable>Command Line Name</replaceable></command>
(the string you enter here prepended <quote>exttool-</quote>).</para></listitem>
</varlistentry>

</variablelist>
</sect2>
</sect1>-->

 <!--
 FIXME: replaced by built-in functionality in 4.12
        lots of this is wrong, other parts need to be moved somewhere else
<sect1 id="kate-application-plugin-snippets">
<sect1info>
<authorgroup>
<author><firstname>Martin</firstname> <surname>Gergov</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>Kate Snippets</title>

<sect2 id="snippets-intro">
<title>Introduction</title>       
<para>Kate Snippets is a plugin used to save you some time by adding support for
so-called <quote>snippets</quote> (re-usable source code, machine code or text). The plugin
also supports code completion and QtScript.</para>
</sect2>

<sect2 id="snippets-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry>
<term><menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Snippets</guimenuitem></menuchoice></term>
<listitem><para>Shows snippets panel containing all snippets in your repository
that are for the currently opened file type.</para></listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="snippets-panel">
<title>Snippets panel</title>

<screenshot id="screenshot-snippets-panel">
<screeninfo>Kate Snippets Panel</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="snippets-panel.png" format="PNG"/></imageobject>
<textobject><phrase>The &kate; snippets panel.</phrase></textobject>
<caption><para>The panel for &kate; Snippets.</para></caption>
</mediaobject>
</screenshot>

<para>In the panel you should see a list of snippet repositories,
along with options to create your own, get them from the Internet or load
them from a local file.  Each repository has a checkbox that can be used to
activate or deactivate it.  There are also buttons to edit and delete existing
repositories.</para>

<sect3 id="snippets-repo-internet">
<title>Loading Snippet Repository Files</title>
<para>You can download snippet repositories from the Internet.  Just click 
<guibutton>Get New Snippets</guibutton> and a window with a list of snippet 
repositories will open.  After downloading the desired snippet, make sure that
you have activated it.</para>
<!- -FIXME no way to load a local file ?- ->
<para>You can also load snippet repositories from a local file using the file
browser at the bottom of the panel.  Click <guibutton>Copy to repository</guibutton>
when finished.</para>
</sect3>

<sect3 id="snippets-repo-editor">
<title>Creating and Editing Snippets</title>

<screenshot id="screenshot-snippets-form">
<screeninfo>Snippet Editor</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="snippets-form.png" format="PNG"/></imageobject>
<textobject><phrase>The snippet editor.</phrase></textobject>
<caption><para>The snippet editor interface.</para></caption>
</mediaobject>
</screenshot>

<para>To create a new snippet repository, click <guibutton>New Snippet File</guibutton>.
You should now see a dialog that asks for the name of the snippet file, license and
author.  After choosing the desired options, click <guibutton>Create</guibutton>,
and the snippet editor will open.</para>

<para>The snippet editor contains the following options:</para>

<variablelist>
<varlistentry>
<term><guilabel>File Type</guilabel></term>
<listitem><para>Select the file type(s) you want the snippet repository to apply
to.  It is set to <quote>*</quote> by default, so the repository applies to all files.  You 
can change it to something like <userinput>C++</userinput> for instance, or select
from a list by hitting the <guibutton>Edit</guibutton>.  You can specify more
than one file type by separating them with <userinput>;</userinput>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Authors</guilabel></term>
<listitem><para>Enter the name(s) of the author(s) of the snippet file.</para></listitem>
</varlistentry>

<varlistentry>
<term>Snippets List</term>
<listitem><para>Contains all snippets defined in the snippet file.  You can
simply click on a snippet listed there to edit it.</para></listitem>
</varlistentry>
    
<varlistentry>
<term>Add (<guibutton>+</guibutton>)</term>
<listitem><para>Used to add a new snippet.</para></listitem>
</varlistentry>

<varlistentry>
<term>Delete (<guibutton>-</guibutton>)</term>
<listitem><para>Used to delete a snippet.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Match/Name</guilabel></term>
<listitem><para>Appears in the list of snippets in the tool view and is also
searched when using the code completion feature.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Display Prefix</guilabel>, <guilabel>Display Postfix</guilabel>,
and <guilabel>Display Arguments</guilabel></term>
<listitem><para>Used to display helpful information while using code completion.
The prefix and postfix are displayed before and after the name, while the arguments
are displayed in parenthesis immediately after the name.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Snippet Content</guilabel></term>
<listitem><para>Reusable text or code.  This is what appears in your document
when the snippet is used.</para></listitem>
</varlistentry>

</variablelist>

<para>In <guilabel>Snippet Content</guilabel> you can specify variables with 
<userinput>${<replaceable>name</replaceable>}</userinput> or
<userinput>%{<replaceable>name</replaceable>}</userinput>.  These can be filled
by QtScript or when the snippet is used.  There is a special variable - 
${cursor} or %{cursor} - which automatically sets the cursor to its first 
occurrence.</para>

</sect3>
</sect2>

<sect2 id="snippets-using">
<title>Using Snippets</title>

<screenshot id="screenshot-snippets-usage">
<screeninfo>Kate Snippets in Action</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="snippets-usage.png" format="PNG"/></imageobject>
<textobject><phrase>Accessing &kate; Snippets from a tool view and a drop down menu.</phrase></textobject>
<caption><para>Selecting from a list of snippets.</para></caption>
</mediaobject>
</screenshot>

<para>You can call snippets in two ways:</para>

<itemizedlist>
<listitem><para>By choosing the snippet from the tool view.</para></listitem>
<listitem><para>While writing, you can press <keycombo action="simul">&Ctrl;
<keysym>Space</keysym></keycombo>, which will display all the snippets in a
convenient window from which you can choose.  You may enter the beginning
of the snippets name before or after pressing this key combination, which provides
functionality similar to code completion.</para></listitem>
</itemizedlist>

<para>If the snippet contains variables (besides <literal>${cursor}</literal>)
the cursor will automatically go to the first occurrence of a variable and will
wait for you to write something. When you are done, you can press &Tab; to move
to the next variable, and so on.</para>

</sect2>

<sect2 id="snippets-ack">
<title>Thanks and Acknowledgments</title>
<para>&kate; Snippets was written by Joseph Wenninger.</para>
<para>Special thanks to Google Code-In 2011 participant Martin Gergov for
writing much of this section.</para>
</sect2>

</sect1>
-->

<sect1 id="kate-application-plugin-build">
<!--http://kate-editor.org/2011/06/21/kate-plugin-updates-part-1/ -->
<sect1info>
<authorgroup>
<author><firstname>Salma</firstname> <surname>Sultana</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>Build Plugin</title>

<sect2 id="build-intro">
<title>Introduction</title>

<para>The Build plugin allows you to run actions like build, clean and compile
on a project.</para>

<!--When you first install Kate, you need to enable the plugin:

Click `Settings → Configure Kate`

In the tree on the left of the screen, click `Plugins`.

In the `Plugin Manager` panel on the right, select `Build plugin`, and then click `OK`.-->

</sect2>

<sect2 id="build-using">
<title>Using the Build Plugin</title>

<para>The Build plugin adds a <guilabel>Build Output</guilabel> tool view at the
bottom and a <guimenu>Build</guimenu> menu on the menubar. The tool view can be used to configure
build target settings, while the menu can be used to perform build, clean and
compile actions.</para>


<para>The <guilabel>Build Output</guilabel> tool view has three tabs:</para>

<itemizedlist>
<listitem><para><guilabel>Target Settings</guilabel></para></listitem>
<listitem><para><guilabel>Output</guilabel></para></listitem>
<listitem><para><guilabel>Errors &amp; Warnings</guilabel></para></listitem>
</itemizedlist>

<sect3 id="build-using-target-settings">
<title>Target Settings tab</title>

<para>The target settings tab can be used to configure various build targets.</para>

<para>Each target contains four configuration options:</para>

<variablelist>
<varlistentry>
<term><guilabel>Working Directory</guilabel></term>
<listitem><para>You can set the path to the project here. Leave this empty to
use the directory the current document is located in.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Build</guilabel></term>
<listitem><para>This option lets you define the build command. It is set to
<command>make</command> by default.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Clean</guilabel></term>
<listitem><para>The option lets you define the clean command. It is set to
<command>make clean</command> by default.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Quick Compile</guilabel></term>
<listitem><para>This option lets you define the quick compile command. It is set
to <command>gcc -Wall -g %f</command> by default.</para></listitem>
</varlistentry>
</variablelist>

<para>One can create a new target by using the <guibutton>New</guibutton> button.
The <guibutton>Copy</guibutton> button can be used to make a copy of an existing
target. To delete a target, use the <guibutton>Delete</guibutton> button.</para>

</sect3>

<sect3 id="build-using-output">
<title>Output tab</title>

<para>The <guilabel>Output</guilabel> tab shows the console output generated by
the last command.</para>

</sect3>

<sect3 id="buiid-using-errors">
<title>Errors &amp; Warnings</title>

<para>The <guilabel>Errors &amp; Warnings</guilabel> tab lists the errors and
warnings generated by the last command.</para>

<para>Each line contains a message and the file name and line number if available.
Clicking on the error or warning takes you to the appropriate file and places
the cursor on the corresponding line number.</para>

<para>There are <guibutton>Errors</guibutton>, <guibutton>Warnings</guibutton>,
and <guibutton>Others</guibutton> buttons at the top that allow you to show
or hide those categories of output.</para>

<!--FIXME: These shortcuts now seem to be used by the Project plugin in 4.11.
            https://bugs.kde.org/show_bug.cgi?id=328170 -->
<para>To navigate to the previous error, press
<keycombo action="simul">&Ctrl;&Alt;<keysym>Left</keysym></keycombo>.
To navigate to the next error, press
<keycombo action="simul">&Ctrl;&Alt;<keysym>Right</keysym></keycombo>.</para>

</sect3>
</sect2>

<sect2 id="build-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry>
<term><menuchoice>
<guimenu>Build</guimenu><guimenuitem>Build</guimenuitem>
</menuchoice></term>
<listitem><para>Runs the <guilabel>Build</guilabel> command for the currently
selected target.</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Build</guimenu><guimenuitem>Clean</guimenuitem>
</menuchoice></term>
<listitem><para>Runs the <guilabel>Clean</guilabel> command for the currently
selected target.</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Build</guimenu><guimenuitem>Quick Compile</guimenuitem>
</menuchoice></term>
<listitem><para>Runs the <guilabel>Quick Compile</guilabel> command for the
currently selected target.</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<shortcut><keycombo action="simul">&Ctrl;&Alt;<keysym>Left</keysym></keycombo></shortcut>
<guimenu>Build</guimenu><guimenuitem>Previous Error</guimenuitem>
</menuchoice></term>
<listitem><para>Moves the cursor to the location of the previous error in the
document.</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<shortcut><keycombo action="simul">&Ctrl;&Alt;<keysym>Right</keysym></keycombo></shortcut>
<guimenu>Build</guimenu><guimenuitem>Next Error</guimenuitem>
</menuchoice></term>
<listitem><para>Moves the cursor to the location of the next error in the
document.</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Build</guimenu><guisubmenu>Targets</guisubmenu>
</menuchoice></term>
<listitem><para>Select from a list of targets configured by the user.</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Build</guimenu><guimenuitem>Next Target</guimenuitem>
</menuchoice></term>
<listitem><para>Switch to the next target configured by the user.</para></listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="build-ack">
<title>Thanks and Acknowledgments</title>
<para>The &kate; Build Plugin was written by Kåre Särs.</para>
<para>Special thanks to Google Code-In 2011 participant Salma Sultana for
writing much of this section.</para>
</sect2>
</sect1>

<sect1 id="kate-application-plugin-sql">
<sect1info>
<authorgroup>
<author><firstname>Ömer</firstname> <othername>Faruk</othername> <surname>ORUÇ</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>SQL Plugin</title>

<sect2 id="sql-intro">
<title>Introduction</title>

<para>The Structured Query Language (SQL) is a specialized language for updating,
deleting, and requesting information from databases.</para>

<para>The &kate; SQL Plugin allows you to:</para>

<itemizedlist>
<listitem><para>Create a database</para></listitem>
<listitem><para>Connect to existing databases</para></listitem>
<listitem><para>Insert and delete data in the database</para></listitem>
<listitem><para>Execute queries</para></listitem>
<listitem><para>Display results in a table</para></listitem>
</itemizedlist>

<!--If Kate is installed on your computer, at first open Kate.
If Kate isn't installed on your computer, download and install it.

Using SQL Plugin
After opening the Kate;
Click Settings→ Configure Kate
and then;
Click Application → Select Plugins in the tree widget

In the Plugin Manager panel on the right, check SQL Plugin and click OK.
-->

</sect2>

<sect2 id="sql-connecting">
<title>Connecting to a Database</title>

<para>Select <guibutton>Add Connection</guibutton> from the <guimenu>SQL</guimenu>
menu or toolbar, and then select the Qt database driver you want to use (including
QSQLITE, QMYSQL3, QMYSQL, QODBC3, QODBC, QPSQL7, and QPSQL).  If you can't see
the desired driver, you need to install it.  Then, press <guibutton>Next</guibutton>.
</para>

<para>If the database you selected uses a file, simply indicate the database's
location and press the <guibutton>Next</guibutton> button.  If it requires connecting
to a server, you must enter the hostname of the server, your username and password,
and any other information that particular driver may require. Then press
<guibutton>Next</guibutton>.</para>

<para>Finally, give a name to your connection, and press <guibutton>Finish</guibutton>.</para>

</sect2>

<sect2 id="sql-querying">
<title>Running Queries</title>

<sect3 id="sql-querying-insert-delete-update">
<title>INSERT/DELETE/UPDATE</title>

<para>You can insert, delete, and update data using the SQL plugin just as
you would from the command line or from within a program.  Simply enter a query
and press the <guibutton>Run query</guibutton>.</para>

<example>
<title>Some Example Queries</title>
<variablelist>

<varlistentry>
<term><command>INSERT</command></term>
<listitem><para><programlisting>
INSERT INTO <replaceable>table_name</replaceable> ("<replaceable>feature1</replaceable>", "<replaceable>feature2</replaceable>", "<replaceable>feature3</replaceable>", "<replaceable>feature4</replaceable>", "<replaceable>feature5</replaceable>")
VALUES ("<replaceable>value1</replaceable>", "<replaceable>value2</replaceable>", "<replaceable>value3</replaceable>", "<replaceable>value4</replaceable>", "<replaceable>value5</replaceable>" )
</programlisting></para></listitem>
</varlistentry>

<varlistentry>
<term><command>DELETE</command></term>
<listitem><para><programlisting>
DELETE FROM <replaceable>table_name</replaceable> WHERE name = "<replaceable>text</replaceable>"
</programlisting></para></listitem>
</varlistentry>

<varlistentry>
<term><command>UPDATE</command></term>
<listitem><para><programlisting>
UPDATE <replaceable>table_name</replaceable> SET "<replaceable>feature1</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature2</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature3</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature4</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature5</replaceable>" = "<replaceable>text</replaceable>"
</programlisting></para></listitem>
</varlistentry>

</variablelist>
</example>

</sect3>

<sect3 id="sql-querying-select">
<title>SELECT</title>

<para>After running a  <command>SELECT</command> query, you can view the results
as a table that will appear in the <guilabel>SQL Data Output</guilabel> tool view at
the bottom of &kappname;, or as text in the <guilabel>SQL Text Output</guilabel>.
If there is an error, you can see it in the text output.</para>

<example>
<title>Example <command>SELECT</command> Query</title>
<para><programlisting>
SELECT * FROM <replaceable>table_name</replaceable>
</programlisting></para>
</example>

<para>In the <guilabel>SQL Data Output</guilabel> tool view, there are several buttons:</para>

<variablelist>

<varlistentry>
<term><guibutton>Resize columns to contents</guibutton></term>
<listitem><para>Changes the size of columns to fit their contents.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Resize rows to contents</guibutton></term>
<listitem><para>Changes the size of rows to fit their contents.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Copy</guibutton></term>
<listitem><para>Selects all of the table contents and copies it to the clipboard buffer.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Export</guibutton></term>
<listitem><para>Exports all of the table contents to a file, the clipboard, or the
current document in the Comma Separated Values format.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Clear</guibutton></term>
<listitem><para>Removes everything from the table view</para></listitem>
</varlistentry>

</variablelist>

<para>You can now change the colors displayed in the table in the <guilabel>SQL</guilabel>
section of <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;</guimenuitem>
</menuchoice>.</para>

</sect3>
</sect2>

<sect2 id="sql-browsing">
<title>Browsing</title>

<para>You can browse your database using the <guilabel>SQL Schema Browser</guilabel>
tool view on the left.  The information displayed varies depending on which
database driver you are using.</para>

<para>To refresh this list, right-click anywhere in the tool view and select
<guimenuitem>Refresh</guimenuitem>.  To generate a query on any entry in the list,
right-click on an entry, select <guisubmenu>Generate</guisubmenu>, and select the
query type (<guimenuitem>SELECT</guimenuitem>, <guimenuitem>UPDATE</guimenuitem>,
<guimenuitem>INSERT</guimenuitem>, or <guimenuitem>DELETE</guimenuitem>) from
the submenu that appears.</para>

</sect2>

<sect2 id="sql-menus">
<title>Menu Structure</title>
<variablelist>

<varlistentry>
<term><menuchoice>
<guimenu>SQL</guimenu><guimenuitem>Add connection...</guimenuitem>
</menuchoice></term>
<listitem><para>
Adds a new connection using any database driver.
</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>SQL</guimenu><guimenuitem>Remove connection</guimenuitem>
</menuchoice></term>
<listitem><para>
Removes the selected connection.
</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>SQL</guimenu><guimenuitem>Edit connection...</guimenuitem>
</menuchoice></term>
<listitem><para>
Edits the current connection's settings.
</para></listitem>
</varlistentry>

<varlistentry>
<term>Connections</term>
<listitem><para>
All database connections you have created are listed between the
<guimenuitem>Edit connection</guimenuitem> and <guimenuitem>Run query</guimenuitem>
menu items.  Select one to run queries or make modifications to it.
</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<shortcut><keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo></shortcut>
<guimenu>SQL</guimenu><guimenuitem>Run query</guimenuitem>
</menuchoice></term>
<listitem><para>
Runs your query.
</para></listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="sql-ack">
<title>Thanks and Acknowledgments</title>

<para>The SQL Plugin was written by Marco Mentasti.</para>
<para>Special thanks to Google Code-In 2011 participant Ömer Faruk ORUÇ for
writing much of this section.</para>

</sect2>

</sect1>

<sect1 id="kate-application-plugin-gdb">
<!--http://kate-editor.org/2011/06/23/kate-plugin-updates-part-2/-->
<sect1info>
<authorgroup>
<author><firstname>Martin</firstname> <surname>Gergov</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>&gdb; Plugin</title>

<sect2 id="gdb-intro">
<title>Introduction</title>

<para>&kappname;'s &gdb; plugin provides a simple frontend to the popular &GNU;
Project Debugger.</para>

<important>
<para>Previous experience with &gdb; is strongly recommended.  For more
information on using &gdb;, visit <ulink url="http://www.gnu.org/s/gdb/">the
&gdb; website</ulink>.</para>
</important>

<para>You can enable the &gdb; plugin in
<link linkend="config-dialog-plugins">the Plugins section of &kappname;'s
configuration</link>.</para>

<para>For the plugin to work properly, you must have a source file (of any type
supported by &gdb;) and an executable.</para>

<tip>
<para>If you compile using &gcc;/<command>g++</command> you might want to use
the <command><parameter>-ggdb</parameter></command> command line argument.
</para>
</tip>

<para>After these preparations are made, open the source file in &kappname;,
enter the path to the executable in the <guilabel>Settings</guilabel> tab of the
<guilabel>Debug View</guilabel> tool view, and select
<menuchoice><guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem></menuchoice>
from the menu to get started.</para>

</sect2>

<sect2 id="gdb-menus">
<title>Menu and Toolbar Structure</title>

<para>All of these options are available in &kappname;'s menus, and many are
available on the Debug toolbar as well.</para>

<variablelist>

<varlistentry id="gdb-menus-show-debug-view">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Debug View</guimenuitem>
</menuchoice></term>
<listitem><para>Shows a tool view containing &gdb; output, the &gdb; command
line used, and other settings.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-show-locals">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Locals</guimenuitem>
</menuchoice></term>
<listitem><para>Shows a list of all currently loaded variables and their values.
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-show-call-stack">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Call Stack</guimenuitem>
</menuchoice></term>
<listitem><para>Shows a &gdb; backtrace.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-targets">
<term><menuchoice>
<guimenu>Debug</guimenu><guisubmenu>Targets</guisubmenu>
</menuchoice></term>
<listitem><para>A submenu containing a list of targets (executables).
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-arg-lists">
<term><menuchoice>
<guimenu>Debug</guimenu><guisubmenu>Arg Lists</guisubmenu>
</menuchoice></term>
<listitem><para>A submenu containing all argument lists.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-start">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem>
</menuchoice></term>
<listitem><para>Starts &gdb; with a target.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-kill">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Kill / Stop Debugging</guimenuitem>
</menuchoice></term>
<listitem><para>Stops &gdb;.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-restart">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Restart Debugging</guimenuitem>
</menuchoice></term>
<listitem><para>Restarts &gdb;.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-break">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Toggle Breakpoint / Break</guimenuitem>
</menuchoice></term>
<listitem><para>Set a breakpoint at the current cursor position.
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-step-in">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Step In</guimenuitem>
</menuchoice></term>
<listitem><para>Execute the present statement (function call will be debugged).
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-step-over">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Step Over</guimenuitem>
</menuchoice></term>
<listitem><para>Execute the present statement (function call will not be
debugged).</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-step-out">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Step Out</guimenuitem>
</menuchoice></term>
<listitem><para>Resumes execution until the program that is executing
terminates.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-move-pc">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Move PC</guimenuitem>
</menuchoice></term>
<listitem><para>Move program counter (next execution).</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-run-to-cursor">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Run To Cursor</guimenuitem>
</menuchoice></term>
<listitem><para>Runs the program until it reaches current cursor position.
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-continue">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Continue</guimenuitem>
</menuchoice></term>
<listitem><para>Ignores any breakpoints and executes program until it terminates
(successfully or not).</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-print-value">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Print Value</guimenuitem>
</menuchoice></term>
<listitem><para>Prints the value of the variable that the cursor is currently
pointing to.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-toolbar">
<term><menuchoice>
<guimenu>Settings</guimenu><guisubmenu>Toolbars Shown</guisubmenu><guimenuitem>&gdb; Plugin</guimenuitem>
</menuchoice></term>
<listitem><para>Display the debugging toolbar.</para></listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="gdb-debug-view">
<title>Debug View</title>

<para>The <guilabel>Debug View</guilabel> tool view consists of several tabs:
</para>

<variablelist>

<varlistentry>
<term><guilabel>&gdb; Output</guilabel></term>
<listitem>
<para>Contains output from &gdb; and a &gdb; command line.</para>

<screenshot id="screenshot-gdb-output">
<screeninfo>The Output Tab</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-output.png" format="PNG"/></imageobject>
<textobject><phrase>The Output tab.</phrase></textobject>
<caption><para>The <guilabel>Output</guilabel> tab displaying the output from a
debugging session.</para></caption>
</mediaobject>
</screenshot>

</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Settings</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Target</guilabel></term>
<listitem><para>Path to the target (executable) for debugging.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Working Directory</guilabel></term>
<listitem><para>The current working directory provided to the target.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Arg List</guilabel></term>
<listitem><para>Arguments passed to the program.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Keep focus</guilabel></term>
<listitem><para>Keeps focus on the &gdb; command line.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Redirect IO</guilabel></term>
<listitem><para>Opens a new <guilabel>IO</guilabel> tab in the <guilabel>Debug
View</guilabel> where you can view output and provide input to the running
program.</para></listitem>
</varlistentry>

</variablelist>

<screenshot id="screenshot-gdb-settings">
<screeninfo>The Settings Tab</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-settings.png" format="PNG"/></imageobject>
<textobject><phrase>The Settings tab.</phrase></textobject>
<caption><para>The <guilabel>Settings</guilabel> tab displaying the configuration
of a debugging session.</para></caption>
</mediaobject>
</screenshot>

</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>IO</guilabel></term>
<listitem>
<para>Contains an area that displays output from the running program and a
command line where you may provide input to it.</para>

<screenshot id="screenshot-gdb-io">
<screeninfo>The IO Tab</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-io.png" format="PNG"/></imageobject>
<textobject><phrase>The IO tab.</phrase></textobject>
<caption><para>The <guilabel>IO</guilabel> tab displaying output from a simple
test program.</para></caption>
</mediaobject>
</screenshot>

</listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="gdb-other">
<title>Call Stack and Locals</title>

<para>The <guilabel>Call Stack</guilabel> tool view contains a list of the formatted
backtrace returned from &gdb;.</para>

<screenshot id="screenshot-gdb-call-stack">
<screeninfo>The &gdb; Call Stack Tool View</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-call-stack.png" format="PNG"/></imageobject>
<textobject><phrase>The Call Stack tool view.</phrase></textobject>
<caption><para>The &gdb; Plugin's <guilabel>Call Stack</guilabel> tool view.
</para></caption>
</mediaobject>
</screenshot>

<para>The <guilabel>Locals</guilabel> tool view contains a list of all currently
loaded variables from the program and their corresponding values.</para>

<screenshot id="screenshot-gdb-locals">
<screeninfo>The &gdb; Locals Tool View</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-locals.png" format="PNG"/></imageobject>
<textobject><phrase>The Locals tool view.</phrase></textobject>
<caption><para>The &gdb; Plugin's <guilabel>Locals</guilabel> tool view.
</para></caption>
</mediaobject>
</screenshot>

</sect2>

<sect2 id="gdb-ack">
<title>Thanks and Acknowledgments</title>

<para>Special thanks to Google Code-In 2011 participant Martin Gergov for
writing much of this section.</para>

</sect2>

</sect1>

<sect1 id="kate-application-plugin-konsole">
<title>Terminal Tool View Plugin</title>

<para><indexterm><primary>Terminal emulator</primary></indexterm>
The built in Terminal Emulator is a copy of the &kde; &konsole;
terminal application, for your convenience. It is available from the
<menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Terminal</guimenuitem></menuchoice> menu item and will get the focus
whenever displayed. Additionally, if the <link
linkend="konsole-config">Automatically synchronize
the terminal with the current document when possible</link> option is enabled, it will
change to the directory of the current document if
possible when it is displayed, or when the current document
changes.</para>

<para>The default location in the &kate; window is at the bottom,
below the editing area.</para>

<para>You can configure the &konsole; using its &RMB; menu, for more
information, see the <ulink url="help:/konsole/index.htm">&konsole; manual</ulink>.</para>

<para>The built-in terminal emulator is provided by the Terminal Tool View plugin,
which is enabled by default.</para>

<sect2 id="konsole-menus">
<title>Menu Structure</title>

<variablelist>

<varlistentry>
<term>
<anchor id="view-toolviews-show-konsole"/>
<menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Terminal</guimenuitem>
</menuchoice>
</term>
<listitem>
<para>Toggles the display of the built-in terminal emulator.</para>
<para>When activated for the first time, the terminal will be created.</para>
<para>When the terminal emulator is displayed, it will get the focus, so that
you can start typing in commands immediately. If the <link
linkend="konsole-config">Automatically synchronize the terminal
with the current document when possible</link> option is enabled in the
<guilabel>Terminal</guilabel> page of the <link
linkend="config-dialog">Main configuration dialog</link> the shell session will
change to the directory of the active document, if it is a local file.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenu>Tools</guimenu><guimenuitem>Pipe to
Terminal</guimenuitem></menuchoice></term>
<listitem><para>Feed the currently selected text into the built-in terminal
emulator. No newline is added after the text.</para></listitem>
</varlistentry>

<varlistentry>
<term><anchor id="tools-sync-terminal-document"/><menuchoice>
<guimenu>Tools</guimenu>
<guimenuitem>Synchronize Terminal with Current Document</guimenuitem></menuchoice></term>
<listitem>
<para>This will cause the built-in Terminal to <command>cd</command> into the
directory of the active document.</para>

<para>Alternatively, you can configure &kappname; to always keep the terminal in
sync with the current document.  See
<xref linkend="konsole-config"/> for more information.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><anchor id="tools-focus-terminal"/><menuchoice>
<guimenu>Tools</guimenu>
<guimenuitem>Focus/Defocus Terminal</guimenuitem></menuchoice></term>
<listitem>
<para>Switch the focus from the current document to the terminal and vice versa.
</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="konsole-config">
<title>Configuration</title>

<para>You can configure the Terminal Tool View plugin on the 
<guilabel>Terminal</guilabel> page of the 
<link linkend="configuring-kate">configuration dialog</link>.</para>

<para>The following options are available:</para>

<variablelist>
<varlistentry>
<term>
<guilabel>Automatically synchronize the terminal with the current document when possible</guilabel></term>
<listitem><para>This will cause the built-in terminal to
<command>cd</command> into the directory of the active document when
launched and when a new document gets the focus. If not enabled, you
have to do all your navigation in the terminal on your own.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Set EDITOR environment variable to 'kate -b'</guilabel></term>
<listitem><para>This sets the <envar>EDITOR</envar> environment variable so programs
run in the built-in terminal that automatically open a file in an editor will open
them in &kate; instead of the default editor configured in your shell.  You will
not be able to continue using the terminal until you have closed the file in &kate;,
so the calling program is aware you have finished editing the file.</para></listitem>
</varlistentry>

</variablelist>
</sect2>

</sect1>

<!--
Missing (according to config docs)
Additional pages for enabled plugins:
Backtrace Browser
Symbol Viewer
-->
</chapter>
