You can edit SGML source code with any text editor, but I recommend Emacs running in PSGML mode. This mode reads in the DocBook document type definition (DTD), and uses it to help you write well-formed SGML/XML. For example, you can color-code tags, quickly modify SGML markup, and validate your documents with it.
Here are some tips to help you get the most out of Emacs in PSGML mode.
The following settings facilitate tagging, and color the SGML tags, making it easier to distinguish text from tags.
(add-hook 'sgml-mode-hook ; make all this stuff SGML-specific
(function (lambda()
; Create faces to assign to markup categories.
(make-face 'sgml-comment-face)
(make-face 'sgml-start-tag-face)
(make-face 'sgml-end-tag-face)
; Assign attributes to faces.
(set-face-foreground 'sgml-comment-face "SeaGreen")
(set-face-foreground 'sgml-start-tag-face "OrangeRed")
(set-face-foreground 'sgml-end-tag-face "OrangeRed")
; Assign faces to markup categories.
(setq sgml-markup-faces
'((comment . sgml-comment-face)
(start-tag . sgml-start-tag-face)
(end-tag . sgml-end-tag-face)))
; Tell PSGML to use the face settings.
(setq sgml-set-face t)
; Only allows valid elements to be inserted.
(setq sgml-omittag-transparent t)
; PSGML automatically inserts required elements.
(setq sgml-auto-insert-required-elements t)
; Enable abbreviations
(setq-default abbrev-mode t)
(read-abbrev-file "~/.abbrev_defs")
(setq save-abbrevs t)
)))There are many key bindings in Emacs/PSGML mode, but you should be able work quite well with just these:
Copyright © 1995-2004 by Cogent Real-Time Systems, Inc. All rights reserved.