Adding [code][/code] tags to your posts
Tags bbcode, linuxquestions
In LQ it is beneficial to use [code][/code] tags around your code.
All you need to do is to border your code with the [code][/code] tags and the result will appear as following:
Do I have to type the tags in, or are there widgets to help me with this?
In Advanced edit mode the # (number sign) icon will assist you with this, it will add tags around selected text, or add tags where you can then type in, or paste code between the tags.
What should I do if I've already posted code not using this convention?
Posters can edit an existing former post to fix this and make things more clear.
What's the big deal?
It will help to separate code from your questions and comments. It will help responders to read and review your code, or to copy/paste your code into a real editor and compile or use it to further work towards providing you with assistance.
How'd they do that?
And if you're asking yourself, "How can I 'see' those tags here but when I 'use' them they do the right thing?" The answer is that you can always use the "noparse" tags, [noparse] and the slash noparse one will cause whatever is within those tags to not be parsed as tags and thus show up literally in a post.
All you need to do is to border your code with the [code][/code] tags and the result will appear as following:
Code:
#include <stdio.h> int main() { ... }
In Advanced edit mode the # (number sign) icon will assist you with this, it will add tags around selected text, or add tags where you can then type in, or paste code between the tags.
What should I do if I've already posted code not using this convention?
Posters can edit an existing former post to fix this and make things more clear.
What's the big deal?
It will help to separate code from your questions and comments. It will help responders to read and review your code, or to copy/paste your code into a real editor and compile or use it to further work towards providing you with assistance.
How'd they do that?
And if you're asking yourself, "How can I 'see' those tags here but when I 'use' them they do the right thing?" The answer is that you can always use the "noparse" tags, [noparse] and the slash noparse one will cause whatever is within those tags to not be parsed as tags and thus show up literally in a post.