Adrian Tritschler <[EMAIL PROTECTED]> writes: > I'm in the middle of migrating a website that used to be managed by > Blogmax to planner/emacs-wiki and have a few queries. > > In my old markup, I could add "shortcuts" so that something like > "[EMAIL PROTECTED]" or "{shortcut "par1" "par2"}" in the source text could > be expanded to arbitrary HTML in the output, some with parameters, > some without.
Sounds useful. I was inspired to try a rough sketch of this. It's a bit hacky but just to give an idea: (defvar macro-names '(("coffee" . (lambda () "<p>Went for a <b>coffee</b> break</p>")) ("meeting" . (lambda (&rest people) (format "Had a meeting with: <ul>%s</ul>" (mapconcat (lambda (person) (concat "<li>" person)) people "\n")))))) (defun markup-macro () "Call the markup function for a macro with any applicable arguments." (save-match-data (let ((macro (match-string 1))) (let* ((pos (position (string-to-char " ") macro)) (name (subseq macro 0 pos)) (args (if pos (read-strings (subseq macro (1+ pos))) '()))) (let ((fn (cdr (assoc name macro-names)))) (if fn (apply fn args) "")))))) (defun read-strings (string) "Return a list of the substrings in STRING." (let ((start 0) (strings '())) (while (< start (length string)) (let ((next-string (read-from-string string start))) (push (car next-string) strings) (setq start (cdr next-string)))) (nreverse strings))) ;; To enable them (push ["@{\\(.*\\)}@" 0 markup-macro] emacs-wiki-publishing-markup) Then, for example, stuff in your wiki pages like: @{coffee}@ @{meeting "Totoro" "Catbus"}@ should be expanded. Cheers, Mark -- Mark Triggs <[EMAIL PROTECTED]> _______________________________________________ emacs-wiki-discuss mailing list emacs-wiki-discuss@nongnu.org http://lists.nongnu.org/mailman/listinfo/emacs-wiki-discuss