LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Blogs > rtmistler
User Name
Password

Notices


Rating: 2 votes, 5.00 average.

Adding [code][/code] tags to your posts

Posted 12-02-2014 at 06:23 AM by rtmistler
Updated 08-30-2018 at 11:37 AM by rtmistler

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:
Code:
#include <stdio.h>

int main()
{
 ...
}
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.
Posted in LQ Information
Views 1383 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 03:21 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration