Library > Syntax Examples
For security reasons we do not allow html to be used in the library. You can instead markup the text using Markdown syntax. Here are a few common examples.
Subscripts are created by enclosing the subscript in double ~ (tilde)
H~~2~~O
renders as
H2O
Superscripts are created by enclosing the superscripts in double ^ (caret)
e^^x^^
Renders as
ex
**bold**
renders as bold
*italics*
renders as italics
| heading1 | heading2 | heading 3 |
|---|---|---|
| cell 1 | cell 2 | cell 3 |
| cell 1 | cell 2 | cell 3 |
| cell 1 | cell 2 | cell 3 |
| cell 1 | cell 2 | cell 3 |
Syntax:
heading1 | heading2 | heading 3
---------|----------|-----------
cell 1 | cell 2 | cell 3
cell 1 | cell 2 | cell 3
cell 1 | cell 2 | cell 3
cell 1 | cell 2 | cell 3
For AVR C Code:
~~~~~~~~~~~~~.c_avr
uint8_t my_func(uint16_t an_int){
//do stuff
while(1){
//stay busy
}
}
~~~~~~~~~~~~~
produces:
uint8_t my_func(uint16_t an_int){
//do stuff
while(1){
//stay busy
}
}
For Python code:
~~~~~~~~~~~~~.python
def my_func(param):
print str(param)
~~~~~~~~~~~~~
produces:
def my_func(param):
print str(param)
Languages currently supported are c_avr, python, c, javascript, plain, and none.
The plain class produces a preformatted code block that will still be shown with line numbers, but will not be highlighted; this is good for quoting things, or for explaining forum syntax.
A code block marked with ~ that does not specify a language, or indenting a block with 4 spaces will default to c_avr.
The none class will cause the syntax highlighter to not touch touch the code block at all and leave it as a preformatted text block.
~~~~~~~~~~~~.none
This text is not
formatted at all.
Just stays the way it is.
~~~~~~~~~~~~
Renders as:
This text is not
formatted at all.
Just stays the way it is.
For unordered lists use the * operator:
* an item
* a different item
* a third item
Will render as:
For ordered lists use a number:
1. first item
1. second item
1. third item
Will render as:
To link to an external (not part of the library) link, make sure you use http:// at the beginning of the link.
[Title of link](http://www.linktosomewhere.domain)
To link to a wiki page the page must be preceded with the /library/ path
[Link to a wiki Page](/library/my_cool_page/)
Links to other library pages that do not exist yet are marked by a [?]. Clicking the [?] will take you to the form to create that page. To create a new page, just create a link to your new page, and then click the [?] link.
To embed an image, use the following syntax to embed your image:
!Alt Text[\[?\]](/library/Direct Link/)
A few notes:
After a little bit of research, we are recommending imgur as the service of choice for uploading images. Imgur is free, you don't have to sign up for account with them if you don't want to, and it allows direct linking to images.
Here is how to embed an image using imgur:
Creating an account with imgur is not necessary, but we do recommend it. Creating an account will ensure that your image is available from them forever.
Special Note: It is also possible to have a link to the image without embedding the image in your post. To do this simply leave out the ! to make it into a normal link. In this case the text between the [ ] will be the link text. If you are linking images in this way from imgur you can copy the URL in the "Link" box instead of "Direct Link." Photobucket and Flickr will also allow you to link to their images this way.
You should always give a reference to any other materials you use in your Library contributions. A reference or footnote consists of two parts, a label and a definition. Here is an example:
This is an example of a label [^1] and so is [^this] also this [^one].
And this is how you create the definitions.
[^1]: I can write stuff here
[^this]: You can link to there pages
[^one]: Another reference
Will render like this:

You can put the definitions wherever you want in the document. They will always all render at the bottom of the page.
|
Did you know that you can make a capacitive proximity sensor with some aluminum foil and paperclips? Learn more...
|