help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatting C (or other code) to HTML for blog posts


From: Charles Sebold
Subject: Re: Formatting C (or other code) to HTML for blog posts
Date: Thu, 30 Oct 2008 10:52:34 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (windows-nt)

On 30 Oct 2008, Alex Bennee wrote:

> Is there a function that will format some source code into HTML so I
> don't loose formatting from the spaces and tabs being eaten
> up. Usually I would wrap the code in <pre> but for various reasons
> this is not so easy to do (the blog software chews double spaces).
>
> It would be extra nice if the function did pretty syntax highlighting!
>
> I tried format-encode-region to html but that didn't seem to so what I
> wanted (or at least I didn't see a bunch of &nsp;'s and <br>'s
> appear).

htmlize.el works, but it might be overkill for what you want.  I have
used that to get code onto blog posts in Wordpress but I still end up
massaging it a fair bit.

http://www.emacswiki.org/emacs/Htmlize

Check out the other possibilities on that page as well.
-- 
Charles Sebold                                     30th of October, 2008


reply via email to

[Prev in Thread] Current Thread [Next in Thread]