Processing problem with code block in Mallard page



Hi,
I'm currently working on an upcoming manual for Kupfer. I have tried to
use a code block with the following content:

<code>
[Kupfer]
keybinding = <Control>space
magickeybinding = <Ctrl><Alt>space
</code>

But Mallard doesn't accept this construction, I get the following error message:


plugins.page:51: parser error : Opening and ending tag mismatch: Alt line 50 and code
  </code>
         ^
plugins.page:66: parser error : Opening and ending tag mismatch: Ctrl line 50 and section
 </section>
           ^
plugins.page:179: parser error : Opening and ending tag mismatch: Control line 49 and page
</page>
       ^
plugins.page:180: parser error : Premature end of data in tag code line 47

^
plugins.page:180: parser error : Premature end of data in tag section line 40

^
plugins.page:180: parser error : Premature end of data in tag page line 1

^
unable to parse plugins.page


Normally it should accept any characters within <code></code>. What's the
problem here? I tried to mask the < and > with backslashes, no success.

Cheers,
Mario

Title: Plugins
Using Kupfer plugins.

You can install custom plugins into ~/.local/share/kupfer/plugins; adding to Kupfer's object knowledge can be surprisingly easy, just look at the default plugins if you want to create new.

Search the Web Search Engines

The Search the Web plugin uses Firefox' search engines, so you can add Search Engines directly in Firefox and Kupfer will find them later.

You can also install custom search plugins directly, only for Kupfer, in the folder: ~/.local/share/kupfer/searchplugins/

Open Terminal Here

Open terminal first calls xdg-terminal, then gnome-terminal. xdg-terminal is a script to find the user's configured terminal program for his/her Desktop Environment. Install xdg-terminal if you need this (or install a symlink called xdg-terminal).

Grab current selection

To use Kupfer like a pro, you can configure a "Magic Keybinding" for Kupfer. GUI configuration is not yet supported, but edit the configuration file ~/.config/kupfer/kupfer.cfg to include the following:

[Kupfer] keybinding = space magickeybinding = space

Now, pressing CtrlAltSpace will summon kupfer with the current selection in focus. Make sure you have installed kupfer's nautilus plugin, then both the currently selected file in Nautilus, or the currently selected text in the front application will be selected.

Now you can select a word in, say, a web browser, use CtrlAltSpace, and select action "Look Up" to look up the selected word. Or select an image file, use CtrlAltSpace, select action "Scale" with object "1000" to scale the image to 1000 pixels wide!

Adding your actions and scripts

If you want to add a custom application, or an application called with special options, you can create a new launcher for it and place it in one of the standard places for applications, for example ~/.local/share/applications, where Kupfer will find it.

If you have a collection of scripts that you want to call from kupfer, you can add the scripts folder as a catalog directory to Kupfer in the preferences. Scripts that you add to kupfer's catalog this way can be run directly or in the terminal as long as they are executable.

An example useful script is here which changes the rating of Rhythmbox's currently playing song; I have added five scriptlets calling 'rhrating.py' with numbers from 0 to 5 to my catalog to quickly rate tracks. (This is something that might be integrated into Kupfer later)

Calculator Plugin

The calculator plugin lets you calculate expressions quickly. It can evaluate expressions entered as text starting with "=". Entering = from command mode will start text mode directly with = prefixed for quick access.

The Calculator uses python's math and complex math modules, and parses expressions as Python expressions. You may use common mathematical functions, such as sqrt, sin, exp and log; the command =help will show a list of all defined functions and constants.

Notice that the power operator in Python is double stars, for example =3**3 will evaluate to 27.

To calculate trig functions for angles, convert to radians first: sin(radians(30)) -> 0.5

The last result is stored as the name _ (an underscore, just like in the Python console).

Command line connection

Kupfer is its own remote control. When kupfer is already running, kupfer on the command-line will focus its window, but there is more you can do: If you invoke kupfer QUERY where QUERY is a text string or a filename, kupfer will focus, and select this item. This way, you can quickly invoke kupfer actions even on objects from a shell-based context.

For example, if you are using the shell in a directory where you have a file called "report.pdf", you can focus this file in kupfer by running kupfer report.pdf.

You can also pipe the output of a command into kupfer to send text to the already running instance of Kupfer.

Managing Context and Current Selection

If you find the object you want to use, then invoke an action, Kupfer goes away to perform the action (for example start a program or play a song). When you come back to Kupfer, it will still keep the same object and action selected. Some actions make sense to be repeated (like skipping to the next song) and it can be useful to perform different actions on the same object.

However, you always have the top level catalog reachable when you "come back" to Kupfer -- say you went into the subcatalog "Albums" to browse your albums only; you select and album to play, and play it. You come back with the album selected -- but your next search will still go over the top level catalog, not just albums.

How to come back into the subcatalog you were in? You do that by simply browsing, not searching the first thing you do when you focus Kupfer again. A quick way is to press down-arrow or space to open the browse window; think of it as saying "I want to stay in this subfolder". With the browse window open, your next query will search the current subcatalog.

This way you can work both ways -- you can quickly drill down into folders to find a file, and when you come back for the next action with Kupfer you can either summon any normal toplevel object (just start typing), or stay around where you were, deep in that folder (press space, then type a query).



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