Desmond
Joined: 7th Jun 2010
Posts: 2424
Code tags?
This doesn't seem to go anywhere else so I thought why not post it here?
Anyhow... Is there some kind of code tags that can be used on these forums like BBCode or something? I know that [code][/code] hasn't been implemented but some people use <code></code> too so was just wondering.
If this forum doesn't have a code block then I think it would be a nice feature for sausage to add as people do post source code on here too.
I hope that there is enough information in this post for you to understand what I mean.
Desmond Taylor
---
I am an alien and not crazy!
14 years, 30 weeks ago
|
Nerrevar
Joined: 14th Mar 2009
Posts: 780
Re: Code tags?
also as an add on to a code function.
A syntax highlighter would be pretty awesome too.
It makes reading the code so much easier!
14 years, 30 weeks ago
|
Sordie
Joined: 3rd Apr 2009
Posts: 2044
Re: Code tags?
Pretty much any HTML can be used within forum posts here. If you really must use a code box then I'd recommend using a <div> with the appropriate style.
Here's an example:
procedure TForm1.FormPaint(Sender: TObject);
const
step = 0.01;
scale = 100;
var
a, l: Extended;
x, y: Integer;
begin
a := -PI;
Canvas.FillRect(ClientRect);
repeat
l := (1.0 + (0.90 * cos( 8 * a))) *
(1.0 + (0.10 * cos( 24 * a))) *
(0.9 + (0.05 * cos(200 * a))) *
(1.0 + sin( a) );
x := (ClientWidth shr 1) + round(sin(a + (PI / 2)) * (l * scale));
y := (ClientHeight shr 1) + round(cos(a + (PI / 2)) * (l * scale));
if a = -PI then
Canvas.MoveTo(x, y)
else
Canvas.LineTo(x, y);
a := a + step;
until a > PI;
end;
To be honest though, for large amounts of code you should be linking to a pastebin type site.
Also, you don't need to put your name at the bottom of your posts. We know who you are XD
EDIT: Ooops I messed up the formatting, but you get the general idea =P
---
http://sordie.co.uk
http://twitter.com/@SordieEO
14 years, 30 weeks ago
|
|
Re: Code tags?
I think code tags should be used rather then Pastebin, Pastebin requires another window being open.. Not that this is a big deal lol,
Think about it you can have every code in a code tag, Its much more easier then going to stupid paste bin for one big code.
Reason why I say this, the code "page" where you scroll to view the full code, Makes it easy you can just copy and paste it.
If sausage wanted to, he could do much more, such as (click to copy).
14 years, 30 weeks ago
|
Scott
Joined: 4th Sep 2008
Posts: 1806
Re: Code tags?
microchip posted: (8th Jun 2010 12:09 am)
I think code tags should be used rather then Pastebin, Pastebin requires another window being open.. Not that this is a big deal lol,
Think about it you can have every code in a code tag, Its much more easier then going to stupid paste bin for one big code.
Reason why I say this, the code "page" where you scroll to view the full code, Makes it easy you can just copy and paste it.
If sausage wanted to, he could do much more, such as (click to copy).
I must disagree. I hope you mean't another tab because I don't know any browser that doesn't support tabs now. Pastebin usually has syntax highlighting which is quite helpful. Code blocks on the other hand wouldn't have syntax highlighting.
14 years, 30 weeks ago
|
Sordie
Joined: 3rd Apr 2009
Posts: 2044
Re: Code tags?
Mmmm Maybe it doesn't require a new window to be open ;]
OK Errr maybe it does should
---
http://sordie.co.uk
http://twitter.com/@SordieEO
14 years, 30 weeks ago
|
|
Re: Code tags?
Sordie posted: (8th Jun 2010 12:27 am)
Mmmm Maybe it doesn't require a new window to be open ;]
OK Errr maybe it does should
Exactly :P, I do think what I said is much better. But good try. It's way easier for the poster, and the people that want it.
@Scott, Yeah I did mean a new tab. But doesn't IE just open a new window? I've been thinking it did, but what am I talking about I don't even use it.
14 years, 30 weeks ago
|
kenobi13
Joined: 3rd Jun 2009
Posts: 881
Re: Code tags?
I guess html is only for admins? let me try
<div style="font-family: monospace; overflow: auto; white-space: pre; height: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); border-style: solid;
border-width:1px;">heh</div>
14 years, 30 weeks ago
|
Klutz
Joined: 14th Jul 2009
Posts: 1737
Re: Code tags?
only for admins & mods :(
---
Web developer, currently looking for graphic artists / designers.
14 years, 30 weeks ago
|
Sordie
Joined: 3rd Apr 2009
Posts: 2044
Re: Code tags?
Nope. It's for anyone that knows how to use their web browser's HTML editor. That's what this forum uses when you input your post. =P
---
http://sordie.co.uk
http://twitter.com/@SordieEO
14 years, 30 weeks ago
|
kenobi13
Joined: 3rd Jun 2009
Posts: 881
Re: Code tags?
14 years, 30 weeks ago
|
Klutz
Joined: 14th Jul 2009
Posts: 1737
Re: Code tags?
---
Web developer, currently looking for graphic artists / designers.
14 years, 30 weeks ago
|
kenobi13
Joined: 3rd Jun 2009
Posts: 881
Re: Code tags?
14 years, 30 weeks ago
|
Sordie
Joined: 3rd Apr 2009
Posts: 2044
Re: Code tags?
Friendly word of warning though, start abusing this in posts and you will be -'d or in extreme cases banned. If you absolutely have to use some html in your posts then keep in mind even something like a font change will get you shouted at. Only use it if you really, really have to.
---
http://sordie.co.uk
http://twitter.com/@SordieEO
14 years, 30 weeks ago
|
Desmond
Joined: 7th Jun 2010
Posts: 2424
Re: Code tags?
Sordie posted: (8th Jun 2010 12:27 am)
Mmmm Maybe it doesn't require a new window to be open ;]
OK Errr maybe it does should
Yes it should. People will only exploit that.
Thankyou for your help with this too :)
I don't know how to edit pages using the Built in HTML Editor cuz I is dumb :) I know how to do most things but I never have once needed to mess around with FireFox so any sites where I could learn this? so that I can at least have a nice DIV area for snipets of code :)
---
I am an alien and not crazy!
14 years, 30 weeks ago
| | | | | | | | | | | | | |