Index: openacs-4/packages/acs-core-docs/www/psgml-mode.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/psgml-mode.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-core-docs/www/psgml-mode.html 17 Oct 2001 20:39:26 -0000 1.2 +++ openacs-4/packages/acs-core-docs/www/psgml-mode.html 2 Feb 2002 03:47:32 -0000 1.3 @@ -1,52 +1,122 @@ -
-Table of Contents
+ + +
+ +If you installed PSGML mode in a non-standard location, e.g., somewhere in your home directory, you need to add this to the load-path by adding -this line to your .emacs file:
- (add-to-list 'load-path "/some/dir/that/contains/psgml.elc") +this line to your .emacs file: ++ (add-to-list 'load-path "/some/dir/that/contains/psgml.elc") -
To let PSGML mode find your CATALOG and to enable PSGML mode for -all your editing, add these lines to your .emacs:
++To let PSGML mode find your CATALOG and to enable PSGML mode for +all your editing, add these lines to your .emacs:
+(require 'psgml) - (add-to-list 'auto-mode-alist '("\\.html" . sgml-mode)) - (add-to-list 'auto-mode-alist '("\\.adp" . xml-mode)) - (add-to-list 'auto-mode-alist '("\\.xml" . xml-mode)) - (add-to-list 'auto-mode-alist '("\\.xsl" . xml-mode)) + (add-to-list 'auto-mode-alist '("\\.html" . sgml-mode)) + (add-to-list 'auto-mode-alist '("\\.adp" . xml-mode)) + (add-to-list 'auto-mode-alist '("\\.xml" . xml-mode)) + (add-to-list 'auto-mode-alist '("\\.xsl" . xml-mode)) - (add-to-list 'sgml-catalog-files "/path/to/your/dtd/CATALOG") + (add-to-list 'sgml-catalog-files "/path/to/your/dtd/CATALOG") -
If you want font-locking and indentation, you can also add these lines -into the .emacs file:
++If you want font-locking and indentation, you can also add these lines +into the .emacs file:
+(setq sgml-markup-faces '((start-tag . font-lock-function-name-face) (end-tag . font-lock-function-name-face) (comment . font-lock-comment-face) @@ -58,28 +128,105 @@ (setq sgml-set-face t) (setq-default sgml-indent-data t) ;; Some convenient key definitions: - (define-key sgml-mode-map "\C-c\C-x\C-e" 'sgml-describe-element-type) - (define-key sgml-mode-map "\C-c\C-x\C-i" 'sgml-general-dtd-info) - (define-key sgml-mode-map "\C-c\C-x\C-t" 'sgml-describe-entity)))) + (define-key sgml-mode-map "\C-c\C-x\C-e" 'sgml-describe-element-type) + (define-key sgml-mode-map "\C-c\C-x\C-i" 'sgml-general-dtd-info) + (define-key sgml-mode-map "\C-c\C-x\C-t" 'sgml-describe-entity)))) -
All SGML and XML documents that should conform to a DTD have to declare a + +
All SGML and XML documents that should conform to a DTD have to declare a doctype. For the docbook XML, all your .xml files whould start with -the line
- <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "docbookx.dtd"> +the line ++ <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "docbookx.dtd"> -
If your document is only part of a larger XML document, you can tell PSGML -mode about it by appending the following lines to your file. In this -case, do not include a DOCTYPE declaration in your file.
++If your document is only part of a larger XML document, you can tell PSGML +mode about it by appending the following lines to your file. In this +case, do not include a DOCTYPE declaration in your file.
+<!-- Local Variables: - sgml-parent-document: ("top.xml" "book" "sect1") + sgml-parent-document: ("top.xml" "book" "sect1") End: --> -
Which says that the parent of this document can be found in the file + +
Which says that the parent of this document can be found in the file top.xml, that the element in the parent that will enclose the current document is a book and that the current file's topmost -element is a sect1.
Of course, you should read the emacs texinfo pages that come with PSGML -mode from start to finish. Barring that, here are some handy commands:
Key | Command |
C-c C-e | Insert an element. Uses completion and only lets you insert elements that -are valid |
C-c C-a | Edit attributes of enclosing element. |
C-c C-x C-i | Show information about the document's DTD. |
C-c C-x C-e | Describe element. Shows for one element which elements can be parents, -what its contents can be and lists its attributes. |
Of course, you should read the emacs texinfo pages that come with PSGML +mode from start to finish. Barring that, here are some handy commands:
+Key | +Command | +
---|---|
C-c C-e | +Insert an element. Uses completion and only lets you insert elements that +are valid | +
C-c C-a | +Edit attributes of enclosing element. | +
C-c C-x C-i | +Show information about the document's DTD. | +
C-c C-x C-e | +Describe element. Shows for one element which elements can be parents, +what its contents can be and lists its attributes. | +