Using the editor
Navigating between tags
Most of the time it is possible to move the cursor to the
location where new text should be added and start typing.
Sometimes, however, the typed text is not added to the chapter.
This is because the cursor is located at a position that does not
allow text input (e.g. within the XHTML body tag, but
not within a p tag). Adding text there would result in
invalid XHTML, which the editor prevents.
At the lower left of DEFT is a little indicator showing the
tag which is currently being edited. This is called the active tag.
Sometimes the cursor is at a position which addresses several tags
at once, for instance the start of a paragraph. The editor cannot
know whether this is meant to be p or
body.
You can use the arrow keys to switch between the
possibilities. From p press leftor
up to make the previous tag, body,
active. From body press right or
down to move forward to p. The
behaviour at the end of a paragraph is similar: press
right or down to leave p and
move forward to body. From there press
left or up to get back to the end of the
previous p tag.
Creating new tags
In XHTML different paragraphs are each written within their
own p tags. When writing continuous text the creation
of a new p tag is easy. Press Enter
when a paragraph has been finished and the tags for the next
paragraph will be created automatically. The cursor is already
there so you can continue writing.
But what about the first paragraph or other tags? They have to be inserted explicitily. Navigate to the position where the new tag should be inserted (check the little position indicator as described above). Then press Ctrl+Space and a little dialog appears. From this dialog select the tag to be included.
If some text is to be marked up, select the text first. Then create a new tag as described above. The selected text is now embraced by the new tags.
Removing tags
The way tags are removed depends on whether they are inline or block tags.
Inline tags (e.g. the a tag for links) are
removed by pressing Ctrl+R when they are active.
When block tags can are removed, all text and data contained within it is also removed. Block tags can be removed by several means.
- By deleting all content so that the tag is empty. The empty tag can then be deleted by pressing Delete or Backspace.
-
By selecting the whole block and pressing
Delete or Backspace. A block can be
selected both by mouse and by keyboard.
- With the mouse left-click into a block and move the mouse outside the block, with the mouse button still pressed. The selected block appears framed with its type displayed in the lower right corner. It is possible to select multiple blocks at once.
- With the keyboard move the cursor to the top or bottom line of a block. Press and hold the Shift key and press Up or Down, respectively, to move the cursor outside the block. The block is now selected. By keeping the Shift key pressed and moving the cursor further up or down it is possible to select multiple blocks.
Duplicating tags
It is possible to insert a copy of the currently active tag
by pressing Ctrl+D. However, this does only work if the
copied element is permitted by XHTML. For example, trying to copy
the title tag in the head would have no
result.
Changing tags
If at some point it turns out that a previously used tag is not appropriate any more, it can be changed. Navigate to the tag to be changed and press Ctrl+Alt+Space. A dialog appears from which you can select all possible alternatives.
Copying tags
Selected text can be copied and pasted as in any text editor.
If the text to be copied contains inline tags, those are copied as
well. However, when blocks are selected care must be taken. The
blocks cannot be inserted at disallowed locations. For example, it
is not possible to copy a p block into another
p block (because p cannot be
nested).
Development Environment For Tutorials