Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to DAPS 3.1

B Editor-specific Information

This chapter covers the following topics:

  • Using DocBook macros for Emacs

  • Editing XML/DocBook Files with the Vim Editor

  • Integrating the spell checker aspell into jEdit

B.1 Emacs—Macros for Inserting DocBook Elements

Most editors allow you to write or record macros that you can use for automatically inserting skeletons for complex XML constructs as illustrated by Example B.1, “A varlistentry Element”.

Example B.1: A varlistentry Element
<varlistentry>
 <term></term>
  <listitem>
   <para></para>
  </listitem>
 </varlistentry>

DAPS comes with macros for the Emacs editor that can be used to add DocBook elements, such as listitem, figure, or indexterm. The macros are stored in docbook_macros.el and are added to your system during the installation of DAPS. They require that you use one of Emacs' main XML editing modes, either nxml or psgml.

Procedure B.1: Configuring Emacs for Using the DocBook Macros
  1. To load the DocBook macros, open your Emacs customization file (~/.emacs or ~/.gnu-emacs).

  2. Insert the following line:

    (load "/usr/share/emacs/site-lisp/docbook_macros.el" t t)
  3. Save the Emacs customization file and restart Emacs.

For an overview of the available macros and their usage, refer to http://en.opensuse.org/openSUSE:Documentation_Emacs_Docbook_Macros.

B.2 Editing XML/DocBook Files with the Vim Editor

Find information about on https://github.com/tbazant/xml-vim.

B.3 jEdit—Spell Check on the Fly

If you do not want to run daps spellcheck from the command line, you can also integrate aspell (plus a custom dictionary, if needed) into your XML editor, so that spelling is checked on the fly during editing. Consult your editor's documentation on how to integrate a custom dictionary. If you use jEdit, follow the instructions in Procedure B.2, “Integrating aspell into jEdit”.

Procedure B.2: Integrating aspell into jEdit
  1. Install and activate the plug-in for spell checking:

    1. Start jEdit and select Plug-ins › Plug-in Manager.

    2. If the Spell Check plug-in is not already installed, install and activate it.

    3. Close and restart jEdit.

  2. Configure the plug-in as follows:

    1. Select Plug-ins › Plug-in Options.

    2. In the left navigation pane, select Spell Check › General.

    3. Set Spell-checking engine to Aspell and select the Dictionary to use, for example en_US.

    4. If the desired dictionary does not appear in the drop-down box, install the respective aspell dictionary for the language and click Refresh list.

    5. In the left navigation pane, switch to Spell Check › Syntax handling.

    6. In the table, activate the markup entry and click Edit next to it.

    7. In the Token types picker, activate the following entries:

      • NULL

      • COMMENT1

      • LITERAL1

    8. In the left navigation pane, switch to Spell Check › Aspell Engine.

    9. Set the path to the Aspell executable file name. Select Enable markup mode.

    10. To use an additional custom aspell dictionary, specify the path to it in the text box below Additional parameters:

      --extra-dicts=PATH_TO_CUSTOM_DICT

      For example:

      --extra-dicts=/home/tux/custom_aspell.rws
    11. Save your settings in the plug-in options dialog by pressing OK or Apply.

  3. To perform a spell check during editing, select Plug-ins › Spell Check › Highlight misspelled words (or use the key combination assigned to that menu item).

Print this page