[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: code markup in muse-mode
From: |
Fabrice Niessen |
Subject: |
Re: code markup in muse-mode |
Date: |
Wed, 08 Apr 2009 17:08:46 +0200 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) |
Matt,
Matt Price wrote:
> Fabrice Niessen wrote:
>>> i'm using muse mode via blog.el to publish to my wordpress blog. i'd like
>>> to have sections in 'code markup'.
>>
>> Have a look at my site (currently completely done in Muse) to see if it
>> fulfills your needs.
>>
>> In particular, check out http://www.mygooglest.com/fni/site-map.html#sec2.
>
> fabrice, that looks great! and it's more than I was hoping for. next
> question: when you're writing an entry, what command do you use to tell
> htmlize what language you're writing in? so for instance, if I've pasted a
> snippet of xorg.conf into my muse buffer, how does htmlize know that this
> little snippet is in conf-mode? Or if I have 3 or 4 lines of bash commands,
> what do I tell htmlize to do?
Somes real-life examples:
--8<---------------cut here---------------start------------->8---
<src lang="sh">
sudo aptitude install firestarter
</src>
<include file="~/.emacs" markup="src" lang="emacs-lisp">
<src lang="shell-script">
whereis port
cd /usr/ports/<some-path>/port
make
cd work/port
make [-n] install [PREFIX=/usr/local/stow/port]
</src>
<src lang="emacs-lisp">
;; override output type `inline-css' used for htmlizing a region
(defun htmlize-region-for-paste (beg end)
"Htmlize the region and return just the HTML as a string.
This forces the `css' style and only returns the HTML body, but
without the BODY tag. This should make it useful for inserting
the text to another HTML buffer."
(let* ((htmlize-output-type 'css) ; was `inline-css'
(htmlbuf (htmlize-region beg end)))
(unwind-protect
(with-current-buffer htmlbuf
(buffer-substring (plist-get htmlize-buffer-places 'content-start)
(plist-get htmlize-buffer-places 'content-end)))
(kill-buffer htmlbuf))))
</src>
--8<---------------cut here---------------end--------------->8---
See for more info in the manual.
Fabrice
_________________________________________________________________________
Fabrice Niessen
Search the Web with "My Google Search Tools" on http://www.MyGooglest.com