MarkupCode snippets for the Muse ModeBacklinksIn order to be able to use backlinks on the top and bottom of each page
I added a #backto index|Projects,second_backlink|More Information Backlinks are separated using a comma. Each backlink has a link and a
description component joined by a separator (
(let ((backto (muse-publishing-directive \"backto\")))
(when backto
(let ((primary (split-string backto \",\"))
backlink)
(dolist
(secondary primary backlink)
(setq tmp (split-string secondary \"|\"))
(setq backlink
(concat backlink (concat \"<div class='backlink'><img src='../base/images/list_item.gif' /> Back to <a href=\"
(pop tmp)
\".html>\"
(pop tmp)
\"</a></div>\")
)
)
)
backlink
)
)
)
If this code is embedded in del.icio.us APISee EmacsDeliciousAPI. Last changeI am using an additional variable on my muse pages to indicate when the page has been modified the last time. In the header of the page I add this type of statement: #lastchange 2005-09-09 [11:12] The following functions can be used to automatically update the time stamp:
(defun format-time-last-changed ()
(format-time-string "%Y-%m-%d [%H:%M]"))
(defun insert-last-changed ()
(insert (format-time-last-changed)))
(defun update-last-changed ()
(save-excursion
(goto-char (point-min))
(when (re-search-forward "^#lastchange\\s +[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\s \\[[0-9]\\{2\\}:[0-9]\\{2\\}\\]" nil t)
(delete-region (match-beginning 0) (match-end 0))
(insert "#lastchange ")
(insert-last-changed))))
In order to automatically update the variable on saving a muse page the update-last-change function can be added to the write-contents-hook: (defun record-last-changed () (setq write-contents-hooks 'update-last-changed)) (setq muse-mode-hook (quote (flyspell-mode highlight-changes-mode record-last-changed))) The time stamp can be retrieved using a statement similar to this: <div class=\"lastchange\"> Last changed: <lisp>(muse-publishing-directive \"lastchange\")</lisp> </div> Page statusIn order to display a small note about the status of the page I use the following piece of code:
(defun muse-publish-status ()
(let ((status (muse-publishing-directive "status")))
(when status
(let ((tmp (split-string status "|")))
(concat "<div class='status"
(pop tmp)
"'>Status: "
(pop tmp)
"</div>")))))
You can the use the #status ok|Completed. Finally you can use it like this to include the status note on a page: <div class=\"status\"> <lisp>(muse-publish-status)</lisp> </div> Links Back to Personal Wiki |