[OT] "Code Friendly" Blog?

M

Miki

Hello,

Posting code examples to blogger.com hosted blog is not fun (need to
remember alway escape < and >).
Is there any free blog hosting that is more "code friendly" (easy to
post code snippets and such)?

Thanks,
 
H

Hai Vu

Hello,

Posting code examples to blogger.com hosted blog is not fun (need to
remember alway escape < and >).
Is there any free blog hosting that is more "code friendly" (easy to
post code snippets and such)?

Thanks,

how about bracketing your code in the <pre></pre> tags?

Something like this:
<pre>
import sys, os, shutil

def getDir(fullPath):
dirName, fileName = os.path.split(fullPath)
return dirName
</pre>
 
M

Mel

Hai said:
how about bracketing your code in the <pre></pre> tags?

Something like this:
<pre>
import sys, os, shutil

def getDir(fullPath):
dirName, fileName = os.path.split(fullPath)
return dirName
</pre>

That won't help the escape problem, though it will preserve vital
Python whitespace. HTML has to be interpreting '<' characters to
recognize the '</pre>'.

Mel.
 
M

Miki

Hello Mel,

[Hai]
how about bracketing your code in the <pre></pre> tags?
[Mel]
That won't help the escape problem, though it will preserve vital
Python whitespace. HTML has to be interpreting '<' characters to
recognize the '</pre>'.
They also manage to mess up the first indentation in the <pre>
section :)

Thanks,
 
R

Ryan Ginstrom

On Behalf Of Miki
Posting code examples to blogger.com hosted blog is not fun
(need to remember alway escape < and >).
Is there any free blog hosting that is more "code friendly"
(easy to post code snippets and such)?

I use WordPress with the Dean's Code Highlighter plugin[1] (which uses the
Geshi code highlighter).
You write your code like this:
<pre lang="python">
print "hello, world!"</pre>

You do need to escape angle brackets, though. You also have to turn off
WYSIWYG editing in WordPress, or it'll mess things up.

Here's an example of how it turns out:
http://ginstrom.com/scribbles/2007/11/17/fixing-jis-mojibake-with-python/

[1] http://www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/

Regards,
Ryan Ginstrom
 
J

Jeroen Ruigrok van der Werven

-On [20080117 23:56] said:
Is there any free blog hosting that is more "code friendly" (easy to
post code snippets and such)?

I personally use a Wordpress installation on my own machine with an additional
plugin for syntax highlighting. http://wordpress.org/extend/plugins/wp-syntax/

IIRC it uses <pre lang="python"> for highlighting Python for example.
It works quite well.

If you can host stuff yourself you might even like to check out
http://textpress.pocoo.org/ - a beginning Python solution. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top