/
chicken-wiki.el
61 lines (51 loc) · 1.87 KB
/
chicken-wiki.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;;; Chicken-specific markup (http://wiki.call-cc.org/edit-help#extensions-for-chicken-documentation)
(defmacro chicken-wiki-define-command (command &optional open-tag close-tag)
`(defun ,(intern (concat "chicken-wiki-" (symbol-name command))) (beg end)
(interactive "r")
(let ((start-tag ,(or open-tag
(concat "<" (symbol-name command) ">")))
(end-tag ,(or close-tag
(concat "</" (symbol-name command) ">"))))
(save-excursion
(goto-char beg)
(insert start-tag)
(goto-char (+ end (length start-tag)))
(insert end-tag)))))
(chicken-wiki-define-command procedure)
(chicken-wiki-define-command macro)
(chicken-wiki-define-command parameter)
(chicken-wiki-define-command constant)
(chicken-wiki-define-command record)
(chicken-wiki-define-command string)
(chicken-wiki-define-command class)
(chicken-wiki-define-command method)
(chicken-wiki-define-command setter)
(chicken-wiki-define-command syntax)
(chicken-wiki-define-command type)
(chicken-wiki-define-command highlight-scheme
"<enscript highlight=scheme>\n"
"</enscript>\n")
(chicken-wiki-define-command highlight-elisp
"<enscript highlight=elisp>\n"
"</enscript>\n")
(chicken-wiki-define-command highlight-c
"<enscript highlight=c>\n"
"</enscript>\n")
;;; Egg documentation template
(defvar chicken-wiki-egg-author "foo")
(defun chicken-wiki-egg-doc-template (egg-name)
(interactive "MEgg name: ")
(insert (format
"[[tags: egg %s]]\n
== %s \n
[[toc:]]\n
=== Introduction\n
=== Author\n
%s\n
=== Repository\n
=== API\n
=== License\n
=== Version history\n
==== Version 1.0\n
* Initial release\n
" egg-name egg-name chicken-wiki-egg-author)))