| | |
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:
with [ square ] instead of < angle > brackets of course.
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???
<code=c>
int main(void)
{
// your noob code here
return 0;
}
</code>
•
•
•
•
Without a space on either side of =
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.
Last edited by stephen84s; Apr 22nd, 2009 at 4:34 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
•
•
•
•
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.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
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:
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:
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.
•
•
•
•
Use noparse tags like this:
[noparse] [code] code goes here [/code] [/noparse]
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]
"Technological progress is like an axe in the hands of a pathological criminal."
All my posts may be freely redistributed under the terms of the MIT license.
All my posts may be freely redistributed under the terms of the MIT license.
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
![]() |
Similar Threads
- Remove all mention of code tags from the site (DaniWeb Community Feedback)
- Virus Programming (Assembly)
Other Threads in the Geeks' Lounge Forum
- Previous Thread: Banned Commercials
- Next Thread: How do you upload to sourceforge
| Thread Tools | Search this Thread |
advice amazon apple article bankrupt bear beard beijing books bot chat children clocks code comedy complaint console consoles convert daniweb development disk ebook facebook feed financialcrisis future games gaming garbage google grandtheftauto gta gtaiv halo3 happiness hardware information internet iphone ipod java kids kindle knife language larnyx library linux love lynx mad madden merger microsoft netbook neuropathology news nintendo obama olympics operating opinion os outlook playstation programming ps3 ps4 python research school search software softwaredevelopment sony source space starteam stocks subversion survey systems tablet thelostanddamned time tinfoil_hat video videogames walmart wave wii windows windows>all windows_wins world wow www xbox xbox360






