Help:Editing: Difference between revisions
Jump to navigation
Jump to search
| Line 97: | Line 97: | ||
| |
| |
||
|- |
|- |
||
| |
|'''Page REDIRECT''' - To automatically redirect one page to another: |
||
:<source lang="html4strict" enclose="prevalid"> |
|||
#REDIRECT [[SomePage]] |
|||
</source> |
|||
| |
|||
#REDIRECT [[SomePage]] |
|||
|} |
|} |
||
Revision as of 12:20, 22 February 2010
Styles in this Wiki
| Hint | Result |
|---|---|
Hide long source file
The following scripts a well-known message
{{pl2|
{{hidden|<tt>/path/file.sh</tt>
([{{#filelink: file.sh}} download])|{{#fileanchor: file.sh}}
<source lang="bash">
#! /bin/bash
echo Hello, World
</source>|headerstyle=background:#ccccff;text-align:left;}} }}
|
The following scripts a well-known message /path/file.sh
([{{#filelink: file.sh}} download])
{{#fileanchor: file.sh}} #! /bin/bash
echo Hello, World
|
Hint and Tips
| Hint | Result | ||
|---|---|---|---|
Use the template Template:pl2 to intend pre, source... block by 2em:
* Some header
{{pl2|<pre>A left padded block</pre>}}
|
A left padded block | ||
... but the template above can't be used for tables:
* Some header
<div style="padding-left:2em;">
{|
|-
| hello || world
|}
</div>
|
| ||
Use template Template:Hidden to hide some section with toggle button (see [1]).
{{hidden|header|hidden message
|style=background:#ccccff
|headerstyle=text-align:left;
|contentstyle=text-align:right}}
|
header
hidden message | ||
Use template Template:Hide for a simpler version
Below you can find some hidden text {{hide|
'''This is the famous hidden text'''}}
|
Below you can find some hidden text
This is the famous hidden text
| ||
Use template Template:Toggle and _toggler class for more elaborate use. _toggler is used to create button to toggle visibility of tags of given class. Note that you can assign several classes to the same tag:
* {{toggle|item1|ITEM1|item1 item}}
* {{toggle|item2|ITEM2|item2 item}}
* <span class="_toggler-item1">toggle item1</span>
* <span class="_toggler-item2">toggle item2</span>
* <span class="_toggler-item">toggle both items</span>
|
| ||
| Use __TOC__ to control the location of the Table Of Content. This is particularly handy when there are some texts before the first heading in a page, and you want the TOC to appear first. | |||
Page REDIRECT - To automatically redirect one page to another:
|
|
Frequently Used
| Description | You type | You get |
| anywhere | ||
| Arrows entities |
⇒ ⇐ ⇓ ⇑ ⇔ → ↓ ↑ ← ↔ |
⇒ ⇐ ⇓ ⇑ ⇔ → ↓ ↑ ← ↔ |
| Space |
|
|
| only at the beginning of the line | ||
| Definition list |
;Definition |
|
HTML Tags
| Description | You type | You get |
| font tag | Change the <font color="red">font color</font> Change the <font size="3">font size</font> |
Change the font color Change the font size |
Tables
Basic syntax for table is
{| [opt-table-attr]
|- [opt-line-attr]
|[opt-cell-attr |]Orange
|[opt-cell-attr |]Apple
|- [opt-line-attr
|[opt-cell-attr |]
|[opt-cell-attr |]Pie
|- [opt-line-attr
|[opt-cell-attr |]Butter |[opt-cell-attr]| Ice cream
|}
Table can be easily formatted using templates like:
{| {{Prettytable}}
|-
|{{Hl2}}|First
|Second
|-
|Third
|{{Hl2}}|Fourth
|}
|
| |||||||||
Or better yet, using CSS (eg. see MediaWiki:Common.css) class wikitable (see Table):
{| class="wikitable"
|-
!First
|Second
|-
|Third
!Fourth
|}
|
| |||||||||
Cell content can be formatted for each cell individually or for all cells on a same row
{| class="wikitable"
|-
!Very long header
!Very long header
!Very long header
|-
|align="left"|left
|align="center"|center
|align="right"|right
|- align="center"
|center
|center
|center
|}
|}
|
|
Using Extensions
Raw File
See reference syntax here
Example without anchor (best choice when block immediately follows the link).
Download [{{#file: HelpRawScript.sh}} this file].
<source lang="bash">
#! /bin/bash
echo 'Hello, World!'
</source>
|
Download [{{#file: HelpRawScript.sh}} this file]. #! /bin/bash
echo 'Hello, World!'
|
| Example with an anchor (necessary when there is intermediate block - but need keeping name in sync!). When anchor is on another page, use notation Download [{{#filelink: HelpAnotherRawScript.sh}} this file].
<pre>
This block is just to confuse RawFile
</pre>
{{#fileanchor: HelpAnotherRawScript.sh}}
<source lang="bash">
#! /bin/bash
echo 'Hello, World!'
</source>
|
Download [{{#filelink: HelpAnotherRawScript.sh}} this file].
This block is just to confuse RawFile {{#fileanchor: HelpAnotherRawScript.sh}} #! /bin/bash
echo 'I said "Hello, World!"'
|
For very long text, it is possible to hide the file content using CSS style="display:none"
Download [{{#file: HiddenRawScript.sh}} this file].
<div style="display:none"><source lang="bash">
#! /bin/bash
echo 'Hello, Wonderland!'
</source></div>
|
Download [{{#file: HiddenRawScript.sh}} this file]. |
External Links
MediaWiki
MediaWiki - Meta
- Help Contents
- Editing
- Advanced editing | Editing FAQ | Edit toolbar | Export | Import | Shortcuts
- Style & formatting
- Wikitext examples | Reference card | HTML in wikitext | List | Table | Sorting | CSS
- Images
- Images and Uploaded files