fd92cdcefedcd5c468a00070be29b48437fcdd32
[dotfiles.git] / emacs / emacs-wiki / tt25-emacs-wiki.el
1 ;; -*- emacs-lisp -*-
2
3 ;; Author: Olivier Tetard <olivier.tetard@miskin.fr>
4 ;; URL : http://www.miskin.be/
5
6 ;; This file is free software; you can redistribute it and/or modify it
7 ;; under the terms of the GNU General Public License as published by the
8 ;; Free Software Foundation; either version 2, or (at your option) any
9 ;; later version.
10
11 ;; This file is distributed in the hope that it will be useful, but
12 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;; General Public License for more details.
15
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GNU Emacs; see the file COPYING. If not, write to the Free
18 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 ;; 02111-1307, USA.
20
21 ;; Inspiré par les fichiers de :
22 ;;   * Michael Olson (http://www.mwolson.org/web/WelcomePage.html)
23
24 (require 'emacs-wiki)
25 (require 'emacs-wiki-srctag)
26 (require 'emacs-wiki-table)
27
28 ;; Set projects list
29 (setq emacs-wiki-projects
30       `(("MainWiki" .
31          ((emacs-wiki-directories . ("~/src/wiki/www/"))
32           (emacs-wiki-project-server-prefix . "/emacs-wiki/")
33           (emacs-wiki-publishing-directory . "~/emacs-wiki/")))
34         ("TestWiki" .
35          ((emacs-wiki-directories . ("~/src/wiki/test/"))
36           (emacs-wiki-project-server-prefix . "/~toutoune25/test/")
37           (emacs-wiki-publishing-directory . "~/emacs-wiki-test/")))
38         ))
39
40 ;; On utilise le mode recursif
41 (setq emacs-wiki-recurse-directories t)
42
43 ;; srctag
44 (add-to-list 'emacs-wiki-src-tag-modes-alist
45              '("sh" . sh-mode))
46
47 ;;; Functions
48
49 ;; Insert header
50 (defun my-emacs-wiki-insert-header ()
51   (ignore (insert-file-contents
52            "~/src/wiki/common/header.html")))
53
54 ;; Insert footer
55 (defun my-emacs-wiki-insert-footer ()
56   (ignore (insert-file-contents
57            "~/src/wiki/common/footer.html")))
58
59 ;; On utilise le mode 644 pour les nouveaux fichiers publiés
60 ;; http://www.emacswiki.org/cgi-bin/wiki/EmacsWikiMode
61
62 (defun my-emacs-wiki-chmod-644-published-file (file)
63   (let* ((page (emacs-wiki-page-name file))
64          (published (emacs-wiki-published-file page)))
65     (shell-command (concat "chmod 644 " published))))
66
67 (add-hook 'emacs-wiki-after-file-publish-hook
68           'my-emacs-wiki-chmod-644-published-file)
69
70 ;;; Customizations
71
72 (custom-set-variables
73  '(emacs-wiki-autogen-headings (quote outline))
74  '(emacs-wiki-charset-default "iso-8859-15")
75  '(emacs-wiki-coding-default (quote iso-8859-15))
76  '(emacs-wiki-default-project "MainWiki")
77  '(emacs-wiki-default-page "HomePage")
78  '(emacs-wiki-home-page "HomePage")
79  '(emacs-wiki-maintainer "WhoAmI.html")
80  '(emacs-wiki-table-attributes "class=\"ewiki-table\"")
81  '(emacs-wiki-publishing-footer "<lisp>(my-emacs-wiki-insert-footer)</lisp>")
82  '(emacs-wiki-publishing-header "<lisp>(my-emacs-wiki-insert-header)</lisp>")
83  '(emacs-wiki-style-sheet "<link type=\"text/css\" rel=\"stylesheet\" href=\"/emacs-wiki/style.css\"/>"))
84
85 (provide 'tt25-emacs-wiki)