Jump to content

code box text settings (prettyprint i think)

Featured Replies

Posted

I have always used code boxes for a number of things, whether it be to show coding, or using the code boxes for actual instruction (in a guide so it seperates them from the random talk you give in a guide)

But this whole prettyprint colouring thing IMO looks really tacky and im currently doing everything i can think of to avoid using them

Is there anychance of getting rid of it?

I like the pretty text but having a way to turn that on and off would prove usefull.

Not knowing the exact wording or the technical pieces, it's using Google code to generate the [code/php] boxes that you see.

I think that is called jquery.

No, it's called "prettyprint" as the original poster was referring to.

You could turn it off by editing the replacement code for the bbcode "code" tag. Remove class="prettyprint" from the pre tag. You could also format it in other ways (i.e. add a max width/height with an overflow attribute to force scrollbars if the code snippet is large) if you wanted. It's all configurable via the ACP.

So it's not using Google stuff? :blink:

http://google-code-prettify.googlecode.com/svn/trunk/README.html

Yes, Google wrote prettify.

  • Author

Thanks bfarber,

Ill go have a play around in the bb-code management

  • 2 weeks later...
  • Author

Ok finally got it to work the way i want it too, which is to not allow the use of scroll bars, but to get it wrap the text, took me a while, but i ended up adding a new pre class in the common css file

For those who also dont like the who prettyprint this is what i used

pre.codebox      		{ padding: 5px; background: #f8f8f8; border: 1px solid #c9c9c9; margin-left: 10px; font-size: 11px; line-height: 140%; max-width:100%; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word; }



Then i edited the "code" bb code from using "prettyprint" to "codebox" and it now works like a charm :)

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.