PHP Code tags
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: PHP Code tags
maybe have the expand / contract button open them to full-height instead of closing them? So toggle between a max-height and unrestricted?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: PHP Code tags
Indeed. The scroll bar is a bit annoying on any decent resolution since your so limited the amount of code viewable..Kieran Huggins wrote:maybe have the expand / contract button open them to full-height instead of closing them? So toggle between a max-height and unrestricted?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: PHP Code tags
Then how about adding a default view of it in the User control panelKieran Huggins wrote:maybe have the expand / contract button open them to full-height instead of closing them? So toggle between a max-height and unrestricted?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP Code tags
Sheesh!
All this hacking to do on someone else's code....
/me agrees with everything said...
/me agrees with everything said...
Re: PHP Code tags
Ok, I found out what has to be done about the code blogs: remove the font-family:monospace; It looks illegible. Removing that brings back my beloved font-family Lucida grande as the font used for the code blocks.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP Code tags
I'm actually messing around with the syntax tags right now and have just tried what you said. Although it may work nicely with your browser settings, in my FF and in Safari I end up with a non-monospaced font (same as the page maybe?):matthijs wrote:Ok, I found out what has to be done about the code blogs: remove the font-family:monospace; It looks illegible. Removing that brings back my beloved font-family Lucida grande as the font used for the code blocks.
Code: Select all
class Foo {
function bar($x) {
for ($i = 0; $i < $x; $i++) {
//something
}
}
}Re: PHP Code tags
Yes, I also end up with the non-monospaced font, Lucida grande in my case
That's much better.
Should it be mono-space? I also noticed that increasing the font-size a bit also helped a lot.
Code: Select all
stylesheet.css (line 242)
.postbody {
font-family:"Lucida Grande","Trebuchet MS",Helvetica,Arial,sans-serif;
font-size:1.3em;
line-height:1.4em;
}Should it be mono-space? I also noticed that increasing the font-size a bit also helped a lot.
Re: PHP Code tags
Are you joking? The code should be displayed in a monospace font, that's for sure. Otherwise all code formatting will go wild. Or were you talking about something else?matthijs wrote: Should it be mono-space? I also noticed that increasing the font-size a bit also helped a lot.
Re: PHP Code tags
No, I wasn't joking :)
Then just a text-size increase of .1em or something for the code will do the trick. I live-edited the styles for the code block and .1 or .2 was enough to make a big difference. Of course, how something looks will depend on someone's system, so it can never be perfect for everybody. But if code text is tiny for me, having good eyesight, I'm sure more people would appreciate a tiny bit bigger.
But again, the moderators will have to decide what's best, this is just my feedback.
Then just a text-size increase of .1em or something for the code will do the trick. I live-edited the styles for the code block and .1 or .2 was enough to make a big difference. Of course, how something looks will depend on someone's system, so it can never be perfect for everybody. But if code text is tiny for me, having good eyesight, I'm sure more people would appreciate a tiny bit bigger.
But again, the moderators will have to decide what's best, this is just my feedback.
Re: PHP Code tags
matthijs: are you saying it should or shouldn't be monospaced!?
I'm confused
I'm confused
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: PHP Code tags
I think it should be monospace (perhaps even Courier or Courier New) and I think it should be at 9pt. If a fixed size is not appropriate then maybe we can use a relative size compared to the board defaults.
Re: PHP Code tags
relative sizes ftw!Everah wrote: If a fixed size is not appropriate then maybe we can use a relative size compared to the board defaults.
Re: PHP Code tags
Sorry, I wasn't clear. I just noticed that removing the monospace font, and thereby having a non-monospaced font render the text, made it a lot more readable. But, I didn't think about the spacing issue. A monospace font is, of course, better for code fomatting.JayBird wrote:matthijs: are you saying it should or shouldn't be monospaced!?
I'm confused :|
Then the next best thing to do to improve the legibility is to increase the font-size a bit. I know I can do that myself by ctrl+ / cmnd +, but it's annoying to do that for every visit. And besides that, it's not the font-size of the board itself, only the font-size of the code blocks that's too small. In my humble opinion, that is (and for my specific system. But that's a default Mac setting, so wouldn't be too uncommon in the population visiting this forum).