Help:Examples

From RHESSI Wiki

(Difference between revisions)
Jump to: navigation, search
(added code example)
 
Line 1: Line 1:
 +
== Widgets ==
 +
 +
=== Youtube Video ===
 +
To insert this widget, use the following code:
 +
<nowiki>{{#widget:YouTube|id=DWef69ItVrU}}</nowiki>
 +
which gives the following.
 +
 +
{{#widget:YouTube|id=DWef69ItVrU}}
 +
 +
=== Scribd ===
 +
To insert this widget, use the following code:
 +
 +
<nowiki>{{#widget:</nowiki>{{PAGENAME}}<nowiki>
 +
|id=2881106
 +
|access_key=key-2iauog0xawlbp6a4yxph
 +
}}</nowiki>
 +
 +
 +
 +
== Code ==
== Code ==
Code snippets can be formatted automatically for example for IDL code,  
Code snippets can be formatted automatically for example for IDL code,  

Latest revision as of 20:15, 24 November 2010

Contents

Widgets

Youtube Video

To insert this widget, use the following code:

{{#widget:YouTube|id=DWef69ItVrU}}

which gives the following.

Scribd

To insert this widget, use the following code:

{{#widget:Examples
|id=2881106
|access_key=key-2iauog0xawlbp6a4yxph
}}



Code

Code snippets can be formatted automatically for example for IDL code,

<source lang="ittvis_idl">
  xrt_file = [f]vso_files[/f]('25-Jan-2007 06:57', instr='xrt')
  [p]vso_prep[/p], xrt_file, oprep=xrt_obj
  xrt_obj->[p]plotman[/p], /colors, plotman=p
</source>

yields the following

  xrt_file = vso_files('25-Jan-2007 06:57', instr='xrt')
  vso_prep, xrt_file, oprep=xrt_obj
  xrt_obj->plotman, /colors, plotman=p

Images

Multiple Images

There are two ways to display multiple images together (e.g. image comparisons), the first uses the "galleries" and the second uses standard tables. Tables enable each image to be formatted separately which is not true in galleries.

Here is example code for a gallery

<gallery caption="Sample gallery" widths="100px" heights="100px" perrow="6">
Image:Icon116.jpg|[[w:Drenthe|Drenthe]], the least crowded province
Image:Icon116.jpg
Image:Icon116.jpg|[[w:Friesland|Friesland]] has many lakes
Image:Icon116.jpg
Image:Icon116.jpg
Image:Icon116.jpg
Image:Icon116.jpg
</gallery>

which then displays

To use tables, you must use wikimedia's syntax for tables which is not straightforward. An example of images displayed in a table is given by the following code

{| border="0"
|+'''Provinces of the Netherlands'''
|-
| valign="top"|
[[Image:Icon116.jpg|thumb|left|150px|[[w:Drenthe|Drenthe]], the least crowded province]]
| valign="bottom"|
[[Image:Icon116.jpg|thumb|left|100px|]]
| valign="top"|
[[Image:Icon116.jpg|thumb|left|100px|]]
|-
|
|-
| valign="top"|
[[Image:Icon116.jpg|thumb|left|100px|]]
| valign="top"|
[[Image:Icon116.jpg|thumb|left|100px|[[w:South Holland|South Holland]], the most crowded province]]
| valign="top"|
[[Image:Icon116.jpg|thumb|left|50px|]]
|}

which is responsible for the following display.

Provinces of the Netherlands
Drenthe, the least crowded province
Icon116.jpg
Icon116.jpg
Icon116.jpg
South Holland, the most crowded province
Icon116.jpg
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox