BBCode

From Compsci.ca Wiki

(Difference between revisions)
Jump to: navigation, search
(Combining Formatting Tags: supposed "incorrect" BBCode was actually correct)
Line 163: Line 163:
:This produces the CompSci.ca logo, and the image links to the CompSci.ca forum index.
:This produces the CompSci.ca logo, and the image links to the CompSci.ca forum index.
 +
 +
 +
==V3 BBCodes==
 +
The fallowing are some of the bbcodes being introduced in Verson 3 of the CompSci.ca software. Thess BBCodes are still in testing and may or may not aucatly be in [[V3]] and deftaly will not work on [[V2]].
 +
 +
===Wiki Tag===
 +
This tag allows us to quickly make a link to a page on the CompSci.ca Wiki by using the falowing tag and the page name. For Example:
 +
:<code>[wiki]BBcode[/wiki]</code>
 +
:This will make a link to this page on the wiki.
 +
 +
===Google Tag===
 +
Like the wiki tag this will make a link to sreach [[Google]] for the given text. This is usefull when directing users to sreach google for help. Example:
 +
:<code>[Google]CompSci[/google]</code>
 +
:This will make a link to sreach google for CompSci
 +
 +
===Yahoo Tag===
 +
Excatly like the Google tag but uses the [[Yahoo]] sreach engion. Example:
 +
:<code>[Yahoo]CompSci[/Yahoo]</code>
 +
:This will make a link to sreach yahoo for CompSci
 +
 +
===Ebay Tag===
 +
Like the above tags the ebay tag will sreach [[Ebay]] for an item listed. Example:
 +
:<code>[Ebay]Laptops[/Ebay]</code>
 +
:This will make a link to sreach ebay for laptops
 +
 +
===Username Tag===
 +
Simpley puts your username inplace of the tag. Example:
 +
:<code>[username]</code>
 +
:Will put your username in place of the tag.
 +
 +
===Strike Tag===
 +
Atacks the same as the the strike html tag and puts a strike threw the text. Example:
 +
:<code>[strike]Tony is the coolest[/strike]</code>
 +
:Will output <strike>Tony is the coolest</strike>
 +
 +
===Footnote Tag===
 +
This atacks much like footnotes in word processors and will put a number with the footnote at the bottom of the post. Example:
 +
:<code>Dan[footnote]Dan is a hacker[/footnote] likes popcorn.</code>
 +
:Will put "Dan<b><i>^1</b></i> likes popcorn" with ^1 being an supercased 1 and "<b><i>1. Dan is a Hacker</i></b>" at the end of the post.
 +
 +
===Offtopic Tag===
 +
This puts the words Offtopic in front of the taged text as well as making it italicesed and blue. Example:
 +
:<code>[offtopic]Martin is a lamer mod[/offtopic]</code>
 +
:Will output "<i>Offtopic: Martin is a lamer mod</i>" in a blue color. <i>Pic to come when v3 realsed</i>.
 +
 +
===Spoiler Tag===
 +
Ment for posts that may give somthing away the user may not whont to see right away. Like some tutorals or moive/game reviews (not that we get many of them). Example:
 +
:<code>[spoiler]Neo is the one[/spoiler]</code>
 +
:This will output a black box with the title spolier that can only be read when the text is highlighted with a mouse. <i>Pic to come when v3 realsted</i>.
 +
 +
===Tab Tag===
 +
Alows for tabs to be placed in posts, witch can be quite usefull some times esptaly with code exmaples.
 +
:<code>[Tab]Hello World</code>
 +
:Will out put "        Hello World" where the space is one tab length.

Revision as of 22:05, 12 February 2006

Contents

What is BBCode?

BBCode is a special implementation of HTML. Whether you can actually use BBCode in your posts on the forum is determined by the administrator. In addition, you can disable BBCode on a per post basis via the posting form. BBCode itself is similar in style to HTML: tags are enclosed in square braces [ and ] rather than < and > and it offers greater control over what and how something is displayed. Depending on the template you are using you may find adding BBCode to your posts is made much easier through a clickable interface above the message area on the posting form. Even with this you may find the following guide useful.

Please note that BBCode is not used in editing wiki pages. For information on how to edit wiki pages, please go here.

Text Formatting

BBCode includes tags to allow you to quickly change the basic style of your text.

Bold Text

To make a piece of text bold enclose it in [b][/b]. For example:

[b]Hello World[/b] becomes
Hello World

Underlining

To make a piece of text underlined, use [u][/u]. For example:

[u]Calvin and Hobbes[/u]
Calvin and Hobbes

Italics

To italicise text, use [i][/i]. For example:

I [i]like[/i] green [i]olives[/i] and ham, Sam I am.
I like green olives and ham, Sam I am.

Colour

Changing the colour of text is achieved by wrapping it in [color=][/color]. You can specify either a recognised colour name (eg. red, blue, yellow, etc.) or the hexadecimal triplet alternative, eg. #FFFFFF, #000000. For example, to create blue text you could use the following:

The colour [color=blue]blue[/color] is over used on the internet (and windows XP)
The colour blue is over used on the internet (and windows XP)
---Anyone know how to add colour to a wiki page?
[color=#00DEAD]This text is written in the colour 00DEAD[/color]

Size

Changing the text size is achieved in a similar way using [size=][/size]. This tag is dependent on the template you are using but the recommended format is a numerical value representing the text size in pixels, starting at 1 (so tiny you will not see it) through to 29 (very large). For example:

[size=9]small[/size]
small
[size=16]BIG[/size]
BIG

Centred Text

Text can be centred by wrapping it in [center][/center] tags. For example:

[center]Welcome to CompSci.ca[/center]

Coding

There are two ways of displaying code in a friendly manner that will not get you yelled at.

Basic Monospaced Code Tags

If you want to output a piece of code or in fact anything that requires a fixed width with a Courier-type font, you can enclose the text in [code][/code] tags. The following is some Ruby code, as you would type it into the reply box:

Making a class method private in Ruby
[code]
class << Foo
    def class_method
        puts "class method"
    end
    private :class_method
end
Foo.class_method    # --> Error!
[/code]

Syntax Highlighting

CompSci.ca also supports syntax highlighting. To use it, wrap your code in [syntax="language_name"][/syntax] tags. For example:

Hello World in Java
[syntax="java"]
public class HelloWorld
{
   public static void main(String[] args)
   {
      System.out.println("Hello world!");
   }
}
[/syntax]

Syntax highlighting will not work unless specific conditions are met.

  • Do not start the string with an upper case letter. "java" is used, not "Java".
  • Use letters only. "cpp" is used, not "c++"
  • Not all languages are supported.
    • The supported languages include Java ("java"), C ("c"), C++ ("cpp"), Python ("python"), Pascal ("pascal"), Lisp ("lisp"), Bash ("bash"), PHP ("php"), VisualBASIC ("vb"), SQL ("sql"), css ("css"), ada ("ada"), are supported.
    • Most other languages are not supported, such as Turing, Ruby, O'Caml, and Haskell are not supported.
      • This means that there will be no syntax highlighting for these languages. However,the "language_name:" code box will appear. In future versions, support for these languages may be added, so it is good to use [syntax][/syntax] tags on these languages anyways.

Quoting

There are two ways you can quote text: with a reference or without.

Basic Quoting

To create a basic quote, wrap the quotation in [quote][/quote] tags. For example:

An anonymous quotation
[quote]
God is man's way of glorifying his own importance.
[/quote]

Reference Quoting

To create a quotation and show who said it, wrap the quotation in [quote="name"][/quote] tags, where name represents the name of the person or thing that said the quotation. For example:

wtd's famous quote
[quote="wtd"]
Don't reinvent the wheel if there's an existing library function to do it for you.
[/quote]

Lists

We can create ordered and un-ordered lists with BBCode.

Un-ordered Lists

There are two types of unordered lists.

Non-bulleted Lists

To create an un-ordered, non-bulleted list, wrap the contents in [list][/list] tags. This will indent all text within the list tags. For example:

[list]
Pirate
Ninja
Foo
[/list]
This produces the following each of the three words on their own line, indented. Cervantes has used this to indent sections of his tutorials. A good example of this can be seen in The Introduction to Turing tutorial.

Bulleted Lists

To create an un-ordered, bulleted list, wrap the contents in [list][/list] tags. A bullet is represented by [*]. For example:

A bulleted list on CompSci.ca
[list]
[*]Pirate
[*]Ninja
[*]Foo
[/list]

Ordered Lists

There are two types of ordered lists. They are quite similar to the non-ordered, bulleted list, except instead of bullets, they use digits or letters. To create an ordered list, wrap the contents in either [list=1][/list] or [list=a][/list] tags. Each line is prefixed by a [*], as in the non-ordered, bulleted list. For example:

An ordered list on CompSci.ca
[list=1]
[*]Pirate
[*]Ninja
[*]Foo
[/list]

URL Links

BBCode allows us to insert links, or hypertext. There are two types of links.

Basic Link

To create a basic link, wrap the URL in [url][/url] tags. For example:

[url]http://www.google.ca[/url]
This produces the phpBB equivalent of http://www.google.ca

Named Link

To make text link to a webpage, wrap the text in [url="place complete URL here"][/url] tags. For example:

[url=http://maddox.xmission.com/]The Worst Page in the Universe[/url]
This produces the phpBB equivalent of The Worst Page in the Universe

Inserting Images

Oni Tony

BBCode allows us to insert images into the forums. Go easy on this, however. Inserting large images will get you in trouble. If you want to insert a large image, you can make a thumbnail of it.

To insert an image, wrap the URL to the image in [img][/img] tags. For example:

[img]http://www.compsci.ca/wiki/images/7/7d/OniTony.jpg[/img]
This inserts the image into the forum, located at the left.

Combining Formatting Tags

BBCode tags may be combined to produce, for example, bold, italicized, and large text. To do this, place all the initial tags one after each other, followed by the text, followed by the closing tags. For example:

This text will [b][i][size=16]really[/size][/i][/b] stick out!
This text will really stick out!


[url=http://www.compsci.ca/v2/index.php]
[img]http://www.compsci.ca/v2/templates/Appalachia/images/logo_phpBB.gif[/img]
[/url]
This produces the CompSci.ca logo, and the image links to the CompSci.ca forum index.


V3 BBCodes

The fallowing are some of the bbcodes being introduced in Verson 3 of the CompSci.ca software. Thess BBCodes are still in testing and may or may not aucatly be in V3 and deftaly will not work on V2.

Wiki Tag

This tag allows us to quickly make a link to a page on the CompSci.ca Wiki by using the falowing tag and the page name. For Example:

[wiki]BBcode[/wiki]
This will make a link to this page on the wiki.

Google Tag

Like the wiki tag this will make a link to sreach Google for the given text. This is usefull when directing users to sreach google for help. Example:

[Google]CompSci[/google]
This will make a link to sreach google for CompSci

Yahoo Tag

Excatly like the Google tag but uses the Yahoo sreach engion. Example:

[Yahoo]CompSci[/Yahoo]
This will make a link to sreach yahoo for CompSci

Ebay Tag

Like the above tags the ebay tag will sreach Ebay for an item listed. Example:

[Ebay]Laptops[/Ebay]
This will make a link to sreach ebay for laptops

Username Tag

Simpley puts your username inplace of the tag. Example:

[username]
Will put your username in place of the tag.

Strike Tag

Atacks the same as the the strike html tag and puts a strike threw the text. Example:

[strike]Tony is the coolest[/strike]
Will output Tony is the coolest

Footnote Tag

This atacks much like footnotes in word processors and will put a number with the footnote at the bottom of the post. Example:

Dan[footnote]Dan is a hacker[/footnote] likes popcorn.
Will put "Dan^1</b> likes popcorn" with ^1 being an supercased 1 and "<b>1. Dan is a Hacker" at the end of the post.

Offtopic Tag

This puts the words Offtopic in front of the taged text as well as making it italicesed and blue. Example:

[offtopic]Martin is a lamer mod[/offtopic]
Will output "Offtopic: Martin is a lamer mod" in a blue color. Pic to come when v3 realsed.

Spoiler Tag

Ment for posts that may give somthing away the user may not whont to see right away. Like some tutorals or moive/game reviews (not that we get many of them). Example:

[spoiler]Neo is the one[/spoiler]
This will output a black box with the title spolier that can only be read when the text is highlighted with a mouse. Pic to come when v3 realsted.

Tab Tag

Alows for tabs to be placed in posts, witch can be quite usefull some times esptaly with code exmaples.

[Tab]Hello World
Will out put " Hello World" where the space is one tab length.
Personal tools