![]() |
James Thornton |
| Internet Business Consultant |
| Home | Blog | Bio | Projects | Contact | Latest Blog (new site): How to Get to Genius |
|---|
|
B.2. Editing toolsEditing tools have come a long way in their support for XML (and specifically DocBook). There are two types of editors outlined in this section: text editors (emacs, vim, etc); and word processors (OpenOffice, AbiWord, etc). New authors who are not comfortable working with markup languages should probably choose a word processor that can output DocBook files. For this reason the word processors are listed first. Although many editors can also validate your DocBook files, this information has been separated into Section B.3.
B.2.1. Word ProcessorsEven if you are not comfortable working DocBook's tagset in a text editor you can still produce valid DocBook documents using a word processor. Support at this point is very limited, but it does exist in the following programs. The up side, of course, is that things like spell check are built in to the program. In addition to this, support for DocBook (and XML) is constantly improving.
B.2.1.1. AbiWordThrough word of mouth I've heard that AbiWord can work (natively) with DocBook documents. This will need to be tested by someone (possibly me) and should definitely be included if it is the case. B.2.1.2. OpenOffice.orgAs of OpenOffice.org (OOo) 1.1RC there has been support for exporting files to DocBook format. Although OOo uses the full DocBook document type declaration, it does not actually export the full list of DocBook elements. It uses a "simplified" DocBook tagset which is geared to on-the-fly rendering. (Although it is not the official Simplified DocBook which is described in Section B.5.) The OpenOffice simplified (or "special" docbook) is available from http://www.chez.com/ebellot/ooo2sdbk/ . B.2.1.2.1. Open Office 1.0.xOOo has been tested by LDP volunteers with mostly positive results. Thanks to Charles Curley (charlescurley.com) for the following notes on using OOo version 1.0.x:
Conclusions: OOo 1.1RC is worth looking at if you want a word processor for preparing DocBook documents. However, I hope they cure the lack of documentation. For one thing, it would be nice to know which native OOo styles map to which DocBook elements. It would also be nice to know how to map one's own OOo styles to DocBook elements. B.2.1.2.2. Open Office 1.1Tabatha Marshall offers the following additional information for OOo 1.1.
B.2.1.3. WordPerfect 9 (Corel Office 2000)WordPerfect 9 for the MS Windows platform has support for SGML and DocBook 3.0. WordPerfect 9 for Linux has no SGML capabilities. If you are using WordPerfect on the Linux operating system, please read: WordPerfect on Linux FAQ B.2.1.4. XMLmind's XML editorhttp://www.xmlmind.com/xmleditor/ Although strictly speaking, it is not a word processor, XMLmind's XML editor allows authors to concentrate on the content, and not the markup. It has built in spelling and conversion utilities which allow you to transform your documents without having to install and configure an additional processing tool such as jade. There is a free "standard edition", which is a simplified version of their "professional edition." B.2.2. Text Editors
If you are comfortable working with markup languages and text editors, you'll probably want to customize your current editor of choice to handle DocBook files. Below are some of the more common text editors that can, with some tweaking, handle DocBook files. B.2.2.1. Emacs (PSGML)http://www.lysator.liu.se/~lenst/about_psgml/ Emacs has an SGML writing mode called psgml that is a major mode designed for editing SGML and XML documents. It provides:
For users of Emacs, it's a great way to go. PSGML works with DocBook, LinuxDoc and other DTDs equally well. B.2.2.1.1. Verifying PSGML is InstalledIf you have installed a recent distribution, you may already have PSGML installed for use with Emacs. To check, start Emacs and look for the PSGML documentation (C-himpsgml).
B.2.2.1.2. Configuring Emacs for Use With PSGMLIf you want GNU Emacs to enter PSGML mode when you open an .xml file, it will need to be able to find the DocBook DTD files. If your distribution already had PSGML set up for use with GNU Emacs, you probably won't need to do anything.
Once you've configured your system to use PSGML you will need to override Emacs' default sgml-mode with the psgml-mode. This can be done by configuring your .emacs file. After you've edited the configuration file you will need to restart Emacs. B.2.2.1.3. Creating New DocBook XML FilesThere are a number of steps to creating a new DocBook XML file in Emacs.
B.2.2.1.4. Spell Checking in EmacsEmacs can be configured to use aspell by adding the following to your ~/.emacs file. Thanks to Rob Weir for this configuration information.
B.2.2.2. VIMNo mention of text editors is complete without talking about vi. The VIM (Vi IMproved) editor has the functionality of regular vi and includes "syntax highlighting" of tags. B.2.2.2.1. Getting StartedThere are many versions of vi. New authors will likely want one of the more feature-packed versions for syntax highlighting and a graphical interface including mouse control. Red Hat users will want the following packages: vim-common, vim-minimal and vim-enhanced. Debian users will want the following package: vim. For an X interface (including GUI menus and mouse control) users will want gvim. The "g" in gvim is for "Graphical". VIM compiles very easy should you need to build your own. Both vim and gvim are built by default. Syntax highlighting is included but not enabled by default if you have to start from scratch; use the :syntax enable command in VIM to turn this feature on. B.2.2.2.2. Creating New DocBook XML FilesIn both vim and gvim, .xml files will be recognized and enter into "SGML mode". A series of known DocBook tags and attributes have been entered into vim and will be highlighted one color if the name is known and another if it is not (for this author the colors are yellow and blue). Having the correct document type declaration at the top of your document should add the syntax highlighting. If you do not see this highlighting you will need to force VIM into SGML mode (even for XML files) using the command :set ft=sgml. If you are working with multiple files for a single XML document you can add your document type in <-- comments --> to the top of the file to get the correct syntax highlighting (you will need to restart the program to see the change in highlighting). The top line of this file (tools-text-editors.xml) looks like this:
B.2.2.2.3. Spell CheckAs in Emacs, Vim, will work quite happily with aspell. It can be run from within Vim with the following: :! aspell -c %. For more sophisticated spell check alternatives, give Cream or vimspell a try. B.2.2.2.4. Tag CompletionThe following information is provided by Kwan Lowe. Vim has a DocBook helper script which can be easily copied into your .vimscripts directory and used to "auto complete" tags while writing DocBook documents. The script can be downloaded from: http://www.vim.org/scripts/script.php?script_id=38.
B.2.2.3. epcEditThe epcEdit program allows you to edit XML files. It has the advantages of not needing to know Emacs or vi before starting, and is cross-platform, working in both Windows and Linux. This is a commercial application, and pricing can be found at http://www.tksgml.de/pricing.html Along with visual editing, epcEdit will also validate documents on loading, and on demand by using the -> command. B.2.2.4. neditTo be fair, nedit is more for programmers, so it might seem a bit of overkill for new users and especially non-programmers. All that aside, it's extremely powerful, allowing for syntax highlighting. Unlike epcEdit, nedit doesn't allow you to automatically insert tags or automatically validate your code. However, it does allow for shell commands to be run against the contents of the window (as opposed to saving the file, then checking). B.2.2.4.1. Using neditWhen you open your DocBook file, nedit should already have syntax highlighting enabled. If it does not you can turn it on explicitly using: ->-> If you have line numbers turned on (using ->) then finding validation errors is much simpler. nsgmls, the validation tool we'll use, lists errors by their line number. B.2.2.4.2. Configuring neditSince you can feed the contents of your window to outside programs, you can easily extend nedit to perform repetitive functions. The example you'll see here is to validate your document using nsgmls. For more information about nsgmls and validating documents please read Section B.3.
B.2.2.5. Morphon XML editorhttp://www.morphon.com/xmleditor/index.shtml This is a commercial application which is currently available for free (with an optional user registration). It is written in Java, allowing it to run on any platform that has a Java Virtual Machine (that is, works in both Windows and Linux). On the plus sides of XMLEditor is the left side of the screen shows the hierarchy of the document (starting with Book and so on). Selecting an item in the list brings you to that part of the document so you can edit it. The right part of the screen shows the text without any markup or tags being shown. If you have external files as ELEMENTS (as the LDP Author Guide does), XMLEditor will follow the links and load the files, so you always work on the entire work. On the minus side of this, you will get errors if a file is missing. B.2.2.6. XMLmind XML Editor (XXE)http://www.xmlmind.com/xmleditor David Horton offers the following information:
|
|
James Thornton, jamesthornton.com>Services: Marketing On Internet |
Electric Speed: It Consultant |