BBCode
From Compsci.ca Wiki
(→Inserting Images: took out "1000" sitting in the middle of the article) |
(→V3 BBCodes: proofed) |
||
Line 235: | Line 235: | ||
==V3 BBCodes== | ==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 | + | 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 acually be in [[V3]] and definitely will not work on [[V2]]. |
===Wiki Tag=== | ===Wiki Tag=== | ||
- | This tag allows us to quickly make a link to a page on the CompSci.ca Wiki by using the | + | This tag allows us to quickly make a link to a page on the CompSci.ca Wiki by using the following tag and the page name. For Example: |
:<code>[wiki]BBcode[/wiki]</code> | :<code>[wiki]BBcode[/wiki]</code> | ||
:This will make a link to this page on the wiki. | :This will make a link to this page on the wiki. | ||
===Google Tag=== | ===Google Tag=== | ||
- | Like the wiki tag this will make a link to | + | Like the wiki tag this will make a link to search [[Google]] for the given text. This is useful when directing users to search google for help. Example: |
:<code>[Google]CompSci[/google]</code> | :<code>[Google]CompSci[/google]</code> | ||
- | :This will make a link to | + | :This will make a link to search google for CompSci |
===Yahoo Tag=== | ===Yahoo Tag=== | ||
- | Excatly like the Google tag but uses the [[Yahoo]] | + | Excatly like the Google tag but uses the [[Yahoo]] search engine. Example: |
:<code>[Yahoo]CompSci[/Yahoo]</code> | :<code>[Yahoo]CompSci[/Yahoo]</code> | ||
- | :This will make a link to | + | :This will make a link to search yahoo for CompSci |
===Ebay Tag=== | ===Ebay Tag=== | ||
- | Like the above tags the ebay tag will | + | Like the above tags the ebay tag will search [[Ebay]] for an item listed. Example: |
:<code>[Ebay]Laptops[/Ebay]</code> | :<code>[Ebay]Laptops[/Ebay]</code> | ||
:This will make a link to sreach ebay for laptops | :This will make a link to sreach ebay for laptops | ||
===Username Tag=== | ===Username Tag=== | ||
- | + | Simply puts your username in place of the tag. Example: | |
:<code>[username]</code> | :<code>[username]</code> | ||
:Will put your username in place of the tag. | :Will put your username in place of the tag. | ||
===Strike Tag=== | ===Strike Tag=== | ||
- | + | Will put the text with a strike threw it. Example: | |
:<code>[strike]Tony is the coolest[/strike]</code> | :<code>[strike]Tony is the coolest[/strike]</code> | ||
:Will output <strike>Tony is the coolest</strike> | :Will output <strike>Tony is the coolest</strike> | ||
===Footnote Tag=== | ===Footnote Tag=== | ||
- | This | + | This attacks 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> | :<code>Dan[footnote]Dan is a hacker[/footnote] likes popcorn.</code> | ||
- | :Will put "Dan<b><i>^1</i></b> likes popcorn" with ^1 being | + | :Will put "Dan<b><i>^1</i></b> likes popcorn" with ^1 being a super script, and "<b><i>1. Dan is a Hacker</i></b>" at the end of the post. |
===Offtopic Tag=== | ===Offtopic Tag=== | ||
- | This puts | + | This puts the words "Offtopic" in front of the tagged text as well as making it italicised and blue. Example: |
- | + | ||
- | + | ||
:<code>[offtopic]Martin is a lamer mod[/offtopic]</code> | :<code>[offtopic]Martin is a lamer mod[/offtopic]</code> | ||
- | :Will output "<i>Offtopic: Martin is a lamer mod</i>" in a blue | + | :Will output "<i>Offtopic: Martin is a lamer mod</i>" in a blue colour. <i>Pic to come when v3 realsed</i>. |
===Spoiler Tag=== | ===Spoiler Tag=== | ||
- | + | Meant for posts that may give something away the user may not want to see right away. Like some tutorials or film/game reviews (not that we get many of them). Example: | |
:<code>[spoiler]Neo is the one[/spoiler]</code> | :<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 | + | :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 released</i>. |
===Tab Tag=== | ===Tab Tag=== | ||
- | + | Allows for tabs to be placed in posts, which can be quite useful some times especially with code examples. | |
:<code>[Tab]Hello World</code> | :<code>[Tab]Hello World</code> | ||
:Will out put " Hello World" where the space is one tab length. | :Will out put " Hello World" where the space is one tab length. |
Latest revision as of 21:55, 28 April 2009
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 brackets, "[" 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:
[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:
[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".
- Insert non-formatted text here. Use letters only: "cpp" is used, not "c++"
- Not all languages are supported.
The supported languages include:
- French ActionScript ("actionscript-french")
- ActionScript ("actionscript")
- ADA ("ada")
- Apache ("apache")
- AppleScript ("applescript")
- ASM ("asm")
- ASP ("asp")
- AutoIt("autoit")
- Bash ("bash")
- Blitz Basic ("blitzbasic")
- C ("c", "caddcl")
- CadLisp("cadlisp")
- CFM ("cfm")
- C++ ("cpp")
- C# ("csharp")
- CSS ("css")
- C Mac("c_mac")
- D ("d")
- Delphi ("delphi")
- Diff ("diff")
- Div ("div")
- Dos ("dos")
- Eiffel ("eiffel")
- Free Basic("freebasic")
- GML ("gml")
- Haskell("haskell")
- HTML 4 - Strict ("html4strict")
- INI ("ini")
- INNO ("inno")
- Java ("java")
- Java 5 ("java5")
- JavaScript ("javascript")
- Lisp("lisp")
- LUA("lua")
- MatLab("matlab")
- MPasm("mpasm")
- MySQL("mysql")
- NSIS ("nsis")
- Objective C ("objc")
- O'Caml-Brief("ocaml-brief")
- O'Caml ("ocaml")
- OOBas ("oobas", "oracle8")
- PASCAL ("pascal")
- Perl ("perl")
- PHP-Brief ("php-brief")
- PHP("php")
- Python ("python")
- QBasic("qbasic")
- Robots("robots")
- Ruby ("ruby")
- Scheme ("scheme")
- SDL Basic("sdlbasic")
- Smarty ("smarty")
- SQL ("sql")
- TSQL ("tsql")
- Turing("turing")
- Visual Basic ("vb")
- Visual Basic.Net ("vbnet")
- VHDL ("vhdl")
- Visual FoxPro ("visualfoxpro")
- XML ("xml")
Some of these tags require special formatting to work, they will be posted in due time.
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:
[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:
[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:
[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:
[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
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/v3/index.php]
[img]http://compsci.ca/v3/templates/subSilver/images/logo_phpBB.gif[/img]
[/url]
- This produces the CompSci.ca logo, and the image links to the CompSci.ca forum index.
Staff Only BBCodes
Curently (as of V2) there is only one bbcode that can only be used by some of the staff. However this may chage come the adadtion of V3 and many new BBCodes (see V3 BBCodes).
Mod Tag
This tag can only be used by a user who has mod powers in the forum in question. It places a message in a box like the qoute and code tags but stands out more. Also it has the nice effect of making the post uneditable by anyone who dose not have mod powers in the fourm. The mod tag can be used anonymously or it can state a name the same way the qoute tag works. An exmaple of the mod tag is as fallows:
[mod="Hacker Dan"]All your base are belong to us.[/mod]
- This will put a big red box with the text "All your base are belong to us." in it and a title of "Moderator by Hacker Dan:".
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 acually be in V3 and definitely 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 following 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 search Google for the given text. This is useful when directing users to search google for help. Example:
[Google]CompSci[/google]
- This will make a link to search google for CompSci
Yahoo Tag
Excatly like the Google tag but uses the Yahoo search engine. Example:
[Yahoo]CompSci[/Yahoo]
- This will make a link to search yahoo for CompSci
Ebay Tag
Like the above tags the ebay tag will search Ebay for an item listed. Example:
[Ebay]Laptops[/Ebay]
- This will make a link to sreach ebay for laptops
Username Tag
Simply puts your username in place of the tag. Example:
[username]
- Will put your username in place of the tag.
Strike Tag
Will put the text with a strike threw it. Example:
[strike]Tony is the coolest[/strike]
- Will output
Tony is the coolest
Footnote Tag
This attacks 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 likes popcorn" with ^1 being a super script, and "1. Dan is a Hacker" at the end of the post.
Offtopic Tag
This puts the words "Offtopic" in front of the tagged text as well as making it italicised and blue. Example:
[offtopic]Martin is a lamer mod[/offtopic]
- Will output "Offtopic: Martin is a lamer mod" in a blue colour. Pic to come when v3 realsed.
Spoiler Tag
Meant for posts that may give something away the user may not want to see right away. Like some tutorials or film/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 released.
Tab Tag
Allows for tabs to be placed in posts, which can be quite useful some times especially with code examples.
[Tab]Hello World
- Will out put " Hello World" where the space is one tab length.