1 ;;; muse-xhtml.el --- Muse XHTML publishing style.
3 ;; Copyright (C) 2005 Free Software Foundation, Inc.
5 ;; This file is not part of GNU Emacs.
7 ;; This is free software; you can redistribute it and/or modify it under
8 ;; the terms of the GNU General Public License as published by the Free
9 ;; Software Foundation; either version 2, or (at your option) any later
12 ;; This is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs; see the file COPYING. If not, write to the
19 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 ;; MA 02111-1307, USA.
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 ;; Muse XHTML Publishing
32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36 (defgroup muse-xhtml nil
37 "Options controlling the behaviour of Muse XHTML publishing.
38 See `muse-xhtml' for more information."
41 (defcustom muse-xhtml-extension
".html"
42 "Default file extension for publishing XHTML files."
46 (defcustom muse-xhtml-style-sheet
47 "<link rel=\"stylesheet\" type=\"text/css\" charset=\"utf-8\" media=\"all\" href=\"/default.css\" />"
48 "Store your stylesheet definitions here.
49 This is used in `muse-xhtml-header'.
50 You can put raw CSS in here or a <link> tag to an external stylesheet.
51 This text may contain <lisp> markup tags."
55 (defcustom muse-xhtml-header
56 "<?xml version=\"1.0\"?>
57 <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
58 \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
59 <html xmlns=\"http://www.w3.org/1999/xhtml\">
62 (concat (muse-publishing-directive \"title\")
63 (let ((author (muse-publishing-directive \"author\")))
64 (if (not (string= author (user-full-name)))
65 (concat \" (by \" author \")\"))))</lisp></title>
66 <meta name=\"generator\" content=\"muse.el\" />
67 <meta http-equiv=\"<lisp>muse-xhtml-meta-http-equiv</lisp>\"
68 content=\"<lisp>muse-html-meta-content-type</lisp>\" />
70 (let ((maintainer (muse-style-element :maintainer)))
72 (concat \"<link rev=\\\"made\\\" href=\\\"\" maintainer \"\\\" />\")))
74 <lisp>muse-xhtml-style-sheet</lisp>
78 (concat (muse-publishing-directive \"title\")
79 (let ((author (muse-publishing-directive \"author\")))
80 (if (not (string= author (user-full-name)))
81 (concat \" (by \" author \")\"))))</lisp></h1>
82 <!-- Page published by Emacs Muse begins here -->\n"
83 "Header used for publishing XHTML files."
84 :type
'(choice string file
)
87 (defcustom muse-xhtml-footer
"
88 <!-- Page published by Emacs Muse ends here -->
91 "Footer used for publishing XHTML files."
92 :type
'(choice string file
)
95 (defcustom muse-xhtml-markup-strings
96 '((image-with-desc .
"<img src=\"%s\" alt=\"%s\" />")
97 (image-link .
"<img src=\"%s\" alt=\"\" />")
98 (url-with-image .
"<a class=\"image-link\" href=\"%s\"><img src=\"%s\" alt=\"\" /></a>")
99 (begin-underline .
"<span style=\"text-decoration: underline;\">\n")
100 (end-underline .
"</span>")
101 (begin-center .
"<span style=\"text-align: center;\">\n")
102 (end-center .
"\n</span>"))
103 "Strings used for marking up text.
104 These cover the most basic kinds of markup, the handling of which
105 differs little between the various styles.
107 If a markup rule is not found here, `muse-html-markup-strings' is
109 :type
'(alist :key-type symbol
:value-type string
)
112 (defcustom muse-xhtml-meta-http-equiv
"Content-Type"
113 "The http-equiv attribute used for the HTML <meta> tag."
117 (defcustom muse-xhtml-meta-content-type
"text/html"
118 "The content type used for the HTML <meta> tag."
122 (defun muse-xhtml-prepare-buffer ()
123 "Prepare this buffer for use with the XHTML publisher."
124 ;; Call the HTML "constructor"
125 (muse-html-prepare-buffer)
126 ;; Be safe by making this buffer-local
127 (make-local-variable 'muse-xhtml-meta-http-equiv
)
128 ;; Reset the value of `muse-html-meta-content-type' -- it has
129 ;; already been made buffer local by the HTML constructor.
130 (setq muse-html-meta-content-type
131 (concat muse-xhtml-meta-content-type
"; charset="
132 (muse-html-encoding))))
134 ;;; Register the XHTML Publisher
136 (unless (assoc "xhtml" muse-publishing-styles
)
137 (muse-derive-style "xhtml" "html"
138 :suffix
'muse-xhtml-extension
139 :strings
'muse-xhtml-markup-strings
140 :header
'muse-xhtml-header
141 :footer
'muse-xhtml-footer
142 :before
'muse-xhtml-prepare-buffer
))
144 (provide 'muse-xhtml
)
146 ;;; muse-xhtml.el ends here