You can create, change and install a user-defined menu, which will appear as a part of Kile's menu. To create or change this menu, use the six buttons on the left side. Even more possible actions are available in the context menu of already existing menu items.
Like with any standard menu, three different kinds of menu items are available:
- standard entries, which are assigned to an action
- submenus, which contain more menu items
- separators, to get a visible structure of all items
One of the following three action types is assigned to each standard menu item:
- insert text: this action will insert your text at the current cursor position.
- file content: inserts the complete contents of a given file
- run an external program: The output of this program can be inserted into the opened document.
Compiling and Installing Kile with User-Configurable Menu
Just as usual, for compiling Kile a recent C++ compiler, the CMake tool and the development packages of certain libraries are required.
If you want to install a local version of Kile without affecting your current installation, it is recommended to create a new directory, say 'kile- usermenu'. Then download the source code by cloning Kile's repository and by checking out the 'master' branch:
$ cd ~ $ mkdir -p kile-usermenu/src $ cd kile-usermenu/src $ git clone git://anongit.kde.org/kile Then, create a build directory, configure the build system, compile and install this version of Kile: $ cd .. $ mkdir build-kile $ cd build-kile $ cmake ../src/kile -DCMAKE_INCLUDE_PATH=$HOME/kile-usermenu/install/include/ -DCMAKE_INSTALL_PREFIX=$HOME/kile-usermenu/install -DCMAKE_BUILD_TYPE="Debug" $ make install -j 2 Then, the following lines have to be copied to a file "$HOME/kile-usermenu/run.sh": ---begin--- #!/bin/sh export KDEDIRS=$HOME/kile-usermenu/install/:$KDEDIRS export KDEHOME=$HOME/kile-usermenu/.kde export LD_LIBRARY_PATH=$HOME/kile-usermenu/install/lib64:$HOME/kile- usermenu/install/lib:$LD_LIBRARY_PATH kbuildsycoca4 $HOME/kile-usermenu/install/bin/kile ---end--- You have to set the correct permissions for the script "run.sh": $ chmod +x $HOME/kile-usermenu/run.sh and this local version of Kile can be started with: $ $HOME/kile-usermenu/run.sh
That's all. Run Kile and you will see that:
- Old user-defined tags are transformed and then placed into the new user-configurable menu.
- You can change existing or create new menus using a comfortable user-menu wizard. Please take a look at the help button to get some more information.
- You can install different menus at runtime for different tasks. If you want an example to understand the action parameter, install 'example.xml' menu file and use the user-menu wizard to see, how it was implemented.
Updating the Source Code
From time to time it is recommended to update the source code of Kile in order to try out the most recent changes. This can be done as follows.
First, you have to pull the new code: $ cd $HOME/kile-usermenu $ cd src/kile $ git pull then, compile, and install it $ cd $HOME/kile-usermenu/build-kile $ make install -j 2