Recent Topics

1 Aug 17, 2004 06:36    

So i'm wondering if anyone has come up with some clever ideas/hack/plugins for posting source code on their sites?

I've played around with a few different options and have thus far been unhappy with them all. My favorite method thus far (though still not really adequate) is using a nice little plugin i have in my favorite text editor ([url=http://www.jedit.org]jEdit[/url]) called HTMLizer which converts source code into HTML with color coding and formatting and all. The problem is that it uses the <pre> tag to retain the indenting and such, which causes a significant on fixed width templates and definitely on scalable templates. The source code typically blows right off the side of the page which sucks.

If you don't use <pre> though then you end up with the problem that it looks like total garbage with no formatting.

So, has anyone come up with any good ideas apart from manually formatting your code to fit within your template width?

2 Aug 17, 2004 17:10

Is it possible to define the attributes of the <pre> tag by using css? That's the only solution that comes to mind.

nate

3 Aug 17, 2004 17:52

Hmmm,

well i just checked the <pre> tag again at [url=http://www.w3schools.com]w3schools[/url] and there is a property to set the maximum width of the pre tag, but i'm not all that confident that it's going to work how I want it to. ie i think the wrapping won't look all that good.

Oh well, i guess i'll have to play around with it and see.

5 Aug 17, 2004 18:39

Awesome.

That is pretty slick indeed. That will address my problems with displaying code i think.

Thanks for that one.

:)

6 Aug 17, 2004 20:59

i just use

pre {                  overflow: auto;
                  width:95%;
}

8 Aug 20, 2004 18:19

Mark,

The imgins and codeins plugins are on my todo list :)


Form is loading...