Help - Search - Members - Calendar
Full Version: Need A Way To Post "java/perl Code" To My Weblog
Movable Type Community Forum > Other Product Discussion > Desired Features
mozkill
Hello,

A feature that I would very much like, especially in my TypePad blog, is to be able to wrap programming code so that it appears nicely in my weblog entries.

Currently I have to hack around this problem by using a "html textfield" to enter my code, and it looks terrible.

Any ideas?
Su-
QUOTE (mozkill @ Feb 8 2008, 04:41 PM) *
A feature that I would very much like, especially in my TypePad blog, is to be able to wrap programming code so that it appears nicely in my weblog entries.


So, is this actually about your TypePad blog? Because this isn't a TypePad forum.

And what exactly do you mean by "appears nicely?" What's wrong with using a proper <pre><code>STUFF</code></pre> construct and styling it to look however you like?
mozkill
This happens to be in my Typepad blog, but it also occurs in Moveable type.

http://learningjava.typepad.com/

The <pre><code> wrap thing doesnt work because it cuts off text to the right hand side instead of wrapping it.

Can you tell me how to turn off window wrapping for entries that I make in Moveable Type? I assume I have to edit the style sheet or something.

-jon
Su-
I think you might have some conflicting assumptions.

QUOTE (mozkill @ Mar 5 2008, 06:00 PM) *
The <pre><code> wrap thing doesnt work because it cuts off text to the right hand side instead of wrapping it.

This in itself isn't wrong or a problem, it's by and large the point of the pre tag; it preserves your whitespace. Depending upon your readership, you might get away with using that width attribute, but note that IE6(I haven't checked 7) seems to ignore it.

The best thing I can suggest in your current situation is to add a rule to your stylesheets that sets the pre tag to overflow: auto so that you'll get a horizontal scrollbar within the code blocks only, when they're needed. It's actually the .entry selector that's applying this to the entire entry, which is overall probably desirable, though you can make this change there if you prefer.

Ultimately, though, this is a layout issue, not one of styling. Your content column is too narrow for what you are commonly putting into it, and you should probably look at changing that instead.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.