Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
dean84 Posted June 16, 2010 Posted June 16, 2010 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?
Amy T Posted June 16, 2010 Posted June 16, 2010 I like the pretty text but having a way to turn that on and off would prove usefull.
Wolfie Posted June 16, 2010 Posted June 16, 2010 Not knowing the exact wording or the technical pieces, it's using Google code to generate the [code/php] boxes that you see.
bfarber Posted June 16, 2010 Posted June 16, 2010 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.
bfarber Posted June 16, 2010 Posted June 16, 2010 http://google-code-prettify.googlecode.com/svn/trunk/README.html Yes, Google wrote prettify.
dean84 Posted June 17, 2010 Author Posted June 17, 2010 Thanks bfarber, Ill go have a play around in the bb-code management
dean84 Posted June 29, 2010 Author Posted June 29, 2010 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 usedpre.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 :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.