how do i explain to noobs
how to use [code] tags?
specifically, how do i type the opening and closing code tags in my post, as an example, without causing the code tags to activate?
like this:
HEY NOOB! USE CODE TAGS, AIGHT???
int main(void)
{
// your noob code here
return 0;
}
with [ square ] instead of < angle > brackets of course.
jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
Use [code = php]
[/code]
Without a space on either side of = . ;)
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Without a space on either side of =
Used to do the same before Peter_Budo told me about the noparse tags.
You can use the noparse tags around your code block like this :-
[noparse]
[code=xyz]
[/code]
[/noparse]
You can read more about the various vB tags here .
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
Used to do the same before Peter_Budo told me about the noparse tags.
You can use the noparse tags around your code block like this :-
[noparse]
[code=xyz]
[/code]
[/noparse]
You can read more about the various vB tags here .
Thanks! I didn't know about[noparse] tags. :)
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
The only problem with explaining the usage of noparse tags is that it becomes somewhat cumbersome to explain the exact usage of the noparse tags themselves. For example, consider the following:
Use noparse tags like this:
[noparse] [code] code goes here [/code] [/noparse]
The above example was created by using two nested levels of noparse tags. But that's so dull and boring! Some bbcode formatting would help make our theoretical explanation clearer. The problem is of course, you can't put bbcode formatting inside a noparse tag because of the very nature of a noparse tag. Therefore, we have to resort to a little bit of bbcode black magic. Using the fact that[some[b][/b]tag] will be parsed into [sometag], we can quickly see that we can implement the same intended functionality of noparse while still being able to selectively enable the bbcode parser.
Thus, we can write the following in our post:
[no[b][/b]parse] [b][co[b][/b]de=[col[b][/b]or="red"]c[/color]][/b] [inlinecode]code goes here[/inlinecode] [b][/code][/b] [/noparse]
Which parses down nicely to become:
[noparse] [code=c] code goes here [/code] [/noparse]
There. Now you can with confidence explain to other people not only how to use code tags, but how to clearly use noparse tags with full bbcode formatting. :)
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
I am getting a head ache.
GrimJack
Posting Maven
2,920 posts since Feb 2004
Reputation Points: 1,448
Solved Threads: 22
And if you don't like having to type so much to yell at the noobs, the Clippings add-on for Firefox can it effortless :)
Ezzaral
Posting Genius
15,985 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847