Don't compile documentation by default.
[muse-el.git] / muse-blosxom.el
blob4bdc9d3437295ca4c03cbcea056eff0663290046
1 ;;; muse-blosxom.el --- Publish a document tree for serving by (py)Blosxom
3 ;; Copyright (C) 2004, 2005 Free Software Foundation, Inc.
5 ;; Date: Wed, 23 March 2005
6 ;; Author: Gary V. Vaughan (gary AT gnu DOT org)
7 ;; Maintainer: Michael Olson (mwolson AT gnu DOT org)
9 ;; This file is not part of GNU Emacs.
11 ;; This is free software; you can redistribute it and/or modify it under
12 ;; the terms of the GNU General Public License as published by the Free
13 ;; Software Foundation; either version 2, or (at your option) any later
14 ;; version.
16 ;; This is distributed in the hope that it will be useful, but WITHOUT
17 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 ;; for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24 ;; MA 02111-1307, USA.
26 ;;; Commentary:
28 ;; Blosxom publishes a tree of categorised files to a mirrored tree of
29 ;; blosxom stories to be served by blosxom.cgi or pyblosxom.cgi.
31 ;; Each Blosxom file must include `#date yyyy-mm-dd', or optionally
32 ;; the longer `#date yyyy-mm-dd-hh-mm', plus whatever normal content
33 ;; is desired.
35 ;; This date directive is not used directly by (py)blosxom or this
36 ;; program. You need to find two additional items to make use of this
37 ;; feature.
39 ;; 1. A script to gather date directives from the entire blog tree
40 ;; into a single file. The file must associate a blog entry with
41 ;; a date.
43 ;; 2. A plugin for (py)blosxom that reads this file.
45 ;; These 2 things are provided for pyblosxom in the contrib/pyblosxom
46 ;; subdirectory. `getstamps.py' provides the 1st service, while
47 ;; `hardcodedates.py' provides the second service. Eventually it is
48 ;; hoped that a blosxom plugin and script will be found/written.
50 ;;; Contributors:
52 ;; Gary Vaughan (gary AT gnu DOT org) is the original author of
53 ;; `emacs-wiki-blosxom.el', which is the ancestor of this file.
55 ;; Brad Collins (brad AT chenla DOT org) ported this file to Muse.
57 ;; Michael Olson (mwolson AT gnu DOT org) further adapted this file to
58 ;; Muse and continues to maintain it.
60 ;;; Code:
62 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
64 ;; Muse Blosxom Publishing
66 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
68 (require 'muse-publish)
69 (require 'muse-html)
71 (defgroup muse-blosxom nil
72 "Options controlling the behaviour of Muse BLOSXOM publishing.
73 See `muse-blosxom' for more information."
74 :group 'muse-publish)
76 (defcustom muse-blosxom-extension ".txt"
77 "Default file extension for publishing BLOSXOM files."
78 :type 'string
79 :group 'muse-blosxom)
81 (defcustom muse-blosxom-header
82 "<lisp>(muse-publishing-directive \"title\")</lisp>\n"
83 "Header used for publishing BLOSXOM files."
84 :type '(choice string file)
85 :group 'muse-blosxom)
87 (defcustom muse-blosxom-footer "\n"
88 "Footer used for publishing BLOSXOM files."
89 :type '(choice string file)
90 :group 'muse-blosxom)
92 (defcustom muse-blosxom-markup-regexps
93 `(;; join together the parts of a list or table
94 (10000 "</\\([oud]l\\)>\\s-*<\\1>\\s-*" 0 "")
95 (10100 ,(concat " </t\\(body\\|head\\|foot\\)>\\s-*</table>\\s-*"
96 "<table[^>]*>\\s-*<t\\1>\n") 0 "")
97 (10200 "</table>\\s-*<table[^>]*>\n" 0 "")
99 ;; the beginning of the buffer begins the first paragraph
100 (10300 "\\`\n*\\([^<-]\\|<\\(em\\|strong\\|code\\)>\\|<a \\)" 0
101 "<p class=\"first\">\\1")
102 ;; plain paragraph separator
103 (10400 ,(concat "\\(\n</\\(blockquote\\|center\\)>\\)?\n"
104 "\\(["
105 muse-regexp-blank
106 "]*\n\\)+\\(<\\(blockquote\\|center\\)>\n\\)?")
107 0 muse-html-markup-paragraph)
108 (10500 ,(concat "\\([^>"
109 muse-regexp-space
110 "]\\)\\s-*\\'")
111 0 "\\1</p>\n")
112 ;; planner stuff
113 ,@(when (featurep 'planner)
114 '((10600 "^#\\([A-C]\\)\\([0-9]*\\)\\s-*\\([_oX>CP]\\)\\s-*\\(.+\\)"
115 0 planner-markup-task)
116 (10700 "^\\.#\\([0-9]+\\)" 0 planner-markup-note)))
117 ;; date directive
118 (10800 "^#date\\s-+\\(.+\\)\n+" 0 muse-blosxom-markup-date-directive))
119 "List of markup rules for publishing a Muse page to BLOSXOM.
120 For more on the structure of this list, see `muse-publish-markup-regexps'."
121 :type '(repeat (choice
122 (list :tag "Markup rule"
123 (choice regexp symbol)
124 integer
125 (choice string function symbol))
126 function))
127 :group 'muse-blosxom)
129 ;;; Register the BLOSXOM Publisher
131 (unless (assoc "blosxom" muse-publishing-styles)
132 (muse-derive-style "blosxom-html" "html"
133 :suffix 'muse-blosxom-extension
134 :regexps 'muse-blosxom-markup-regexps
135 :header 'muse-blosxom-header
136 :footer 'muse-blosxom-footer)
138 (muse-derive-style "blosxom-xhtml" "xhtml"
139 :suffix 'muse-blosxom-extension
140 :regexps 'muse-blosxom-markup-regexps
141 :header 'muse-blosxom-header
142 :footer 'muse-blosxom-footer))
144 ;;; Maintain (published-file . date) alist
146 (defvar muse-blosxom-page-date-alist nil)
148 ;; This isn't really used for anything, but it may be someday
149 (defun muse-blosxom-markup-date-directive ()
150 "Add a date entry to `muse-blosxom-page-date-alist' for this page."
151 (let ((date (match-string 1)))
152 (save-match-data
153 (add-to-list
154 'muse-blosxom-page-date-alist
155 `(,buffer-file-name . ,date))))
158 (provide 'muse-blosxom)
160 ;;; muse-blosxom.el ends here