[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

[OT] "Code Friendly" Blog?

Miki

1/17/2008 10:51:00 PM

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,
--
Miki <miki.tebeka@gmail.com>
http://pythonwise.bl...
12 Answers

Hai Vu

1/18/2008 12:19:00 AM

0

On Jan 17, 2:50 pm, Miki <miki.teb...@gmail.com> wrote:
> 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,
> --
> Miki <miki.teb...@gmail.com>http://pythonwise.bl...

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>

Mel

1/18/2008 12:27:00 AM

0

Hai Vu wrote:
> On Jan 17, 2:50 pm, Miki <miki.teb...@gmail.com> wrote:
>> 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,
>> --
>> Miki <miki.teb...@gmail.com>http://pythonwise.bl...
>
> 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.

Miki

1/18/2008 12:42:00 AM

0

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,
--
Miki <miki.tebeka@gmail.com>
http://pythonwise.bl...

Ryan Ginstrom

1/18/2008 1:55:00 AM

0

> 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-wi...

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

Regards,
Ryan Ginstrom


Steven D'Aprano

1/18/2008 2:59:00 AM

0

On Thu, 17 Jan 2008 16:18:37 -0800, Hai Vu wrote:

> On Jan 17, 2:50 pm, Miki <miki.teb...@gmail.com> wrote:
>> 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,
>> --
>> Miki <miki.teb...@gmail.com>http://pythonwise.bl...
>
> how about bracketing your code in the <pre></pre> tags?

And how will that help with the problem the Original Poster asked about?



--
Steven

Jeroen Ruigrok van der Werven

1/18/2008 6:57:00 AM

0

-On [20080117 23:56], Miki (miki.tebeka@gmail.com) wrote:
>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/...

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.... - a beginning Python solution. :)

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
ã?¤ã?§ã?«ã?¼ã?³ ã?©ã?¦ã??ã?­ã??ã?¯ ã?´ã?¡ã?³ ã??ã?« ã?¦ã?§ã?«ã?´ã?§ã?³
http://www.in-n... | http://www.ra...
Buried deep are the Souls that are waiting for you...

Guy Rutenberg

1/18/2008 12:58:00 PM

0

On Jan 18, 8:56 am, Jeroen Ruigrok van der Werven <asmo...@in-
nomine.org> wrote:

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

I use the same configuration (Wordpress + wp-syntax) too. I can say
I'm pretty satisfied with it. I had no problem posting python code.
IIRC Wordpresss will automatically escape < and > for you (if it's no
part of tag).

Regards,
Guy

http://www.guyrute...

Hai Vu

1/18/2008 9:16:00 PM

0

Miki,
Why don't you try to use Code Colorizer:
http://www.chamisplace.com/colori...

Stefan Behnel

1/30/2008 7:04:00 PM

0

Hai Vu wrote:
> Why don't you try to use Code Colorizer:
> http://www.chamisplace.com/colori...

Looks like it lacks support for one important language, though...

Stefan

Mouse

6/26/2011 2:35:00 PM

0

Sherry in Vermont <sherry13@together.net> wrote in
news:2011062602020143658-sherry13@togethernet:

>>
>> Those are the nicest terms I could think of for a complete phony like
>> you. I'd rather not discuss anything with you personally
>>
>
>
> Right, because you prefer to hide so you can be an asshole. Me, I'm
> don't mess with people's heads. No games, no bullshit, no lies. That
> makes me phony how, exactly? And what do you call your responses to me,
> if not discussing anything with me personally?
>
> Sherry in Vermont
>
>

You are a complete phony and your righteous indignation here is an example
of that.