Help:Wiki format brief overview
From Mod Wiki
(Difference between revisions)
Revision as of 09:32, 9 June 2007 (edit) Smile (Talk | contribs) ← Previous diff |
Current revision (16:16, 15 July 2008) (edit) (undo) Don Reba (Talk | contribs) (added the GeSHi link) |
||
(One intermediate revision not shown.) | |||
Line 1: | Line 1: | ||
This page will get you familiar with the basic methods of formatting text in wiki environment, which is necessary to arrange a full-fledged article. Let's start from the principles. | This page will get you familiar with the basic methods of formatting text in wiki environment, which is necessary to arrange a full-fledged article. Let's start from the principles. | ||
+ | |||
+ | __TOC__ | ||
==Main principles== | ==Main principles== | ||
Line 28: | Line 30: | ||
*Use the pair '''<nowiki><pre>...</pre></nowiki>''' to create a block. Bear in mind that the enclosed text will not be combined with the other tags, however the text will be displayed in the place where you put it, retaining all spaces and tabulations. | *Use the pair '''<nowiki><pre>...</pre></nowiki>''' to create a block. Bear in mind that the enclosed text will not be combined with the other tags, however the text will be displayed in the place where you put it, retaining all spaces and tabulations. | ||
{{sample|<nowiki><pre>Block</pre></nowiki>|<pre>Block</pre>}} | {{sample|<nowiki><pre>Block</pre></nowiki>|<pre>Block</pre>}} | ||
+ | |||
+ | |||
+ | ===Source code=== | ||
+ | Use the pair '''<nowiki><source lang="..."></source</nowiki>''' to enclose source code blocks. This highlights the code to make it easier to read. The main kinds are "ini" for [[Ltx]] scripts, "lua" for [[Lua]] scripts, and "xml" for [[Xml]]. | ||
+ | |||
+ | <span title="Пример Wiki-разметки" style="font-size:85%; cursor:help; margin-left:0.2em; color:#888;">Example:</span> | ||
+ | {|style="border-spacing: 2px; border: 1px solid #f0f0f0;" | ||
+ | |style="font-size:smaller; padding-left: 1em; padding-right: 1em; padding-top: 0.1em; padding-bottom: 0.1em; background:#f0f0f0;"|'''how to write''' | ||
+ | |style="font-size:smaller; padding-left: 1em; padding-right: 1em; padding-top: 0.1em; padding-bottom: 0.1em; background:#f0f0f0;"|'''how it looks''' | ||
+ | |- | ||
+ | |style="padding-left: 0.7em; padding-right: 0.7em; padding-top: 0.7em; padding-bottom: 0.7em;"|<nowiki><source lang="ini"></nowiki> | ||
+ | |style="padding-left: 0.7em; padding-right: 0.7em; padding-top: 0.7em; padding-bottom: 0.7em;"|<source lang="ini"> | ||
+ | [2515] | ||
+ | ; cse_abstract properties | ||
+ | section_name = smart_terrain | ||
+ | name = esc_bandits_smart_terrain | ||
+ | position = 131.02030944824,0.065616846084595,-248.9094543457 | ||
+ | direction = 0,0,0 | ||
+ | </source> | ||
+ | |- | ||
+ | |style="padding-left: 0.7em; padding-right: 0.7em; padding-top: 0.7em; padding-bottom: 0.7em;"|<nowiki><source lang="lua"></nowiki> | ||
+ | |style="padding-left: 0.7em; padding-right: 0.7em; padding-top: 0.7em; padding-bottom: 0.7em;"|<source lang="lua"> | ||
+ | for index = 1, #states do | ||
+ | table.insert(tbl.state, states[index]) | ||
+ | end | ||
+ | </source> | ||
+ | |- | ||
+ | |style="padding-left: 0.7em; padding-right: 0.7em; padding-top: 0.7em; padding-bottom: 0.7em;"|<nowiki><source lang="xml"></nowiki> | ||
+ | |style="padding-left: 0.7em; padding-right: 0.7em; padding-top: 0.7em; padding-bottom: 0.7em;"|<source lang="xml"> | ||
+ | <string id="wpn_ak100_m1"> | ||
+ | <text>AK 100</text> | ||
+ | </string> | ||
+ | </source> | ||
+ | |} | ||
+ | |||
+ | See http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi for a complete description. | ||
===Headings=== | ===Headings=== |
Current revision
This page will get you familiar with the basic methods of formatting text in wiki environment, which is necessary to arrange a full-fledged article. Let's start from the principles.
Contents |
Main principles
The main formatting principles are
- Surrounding tags - with the text enclosed in them.
- Single markers - indicate the format of the text after them.
- Templates - complex tags, which create the portions of the text, for convenient use.
Surrounding tags
Bold text
- You can get the bold text by enclosing the text section between three single inverted comas
Example:
how to write | how it looks |
'''Bold''' | Bold |
Italicize text
- Put the text between two single inverted comas to make the text Italic
Example:
how to write | how it looks |
''Italic'' | Italic |
Underlining
- Put the text between the tags <u>...</u> to underline it
Example:
how to write | how it looks |
<u>Underlining</u> | Underlining |
Tags combination
- Tags can be used in combinations, it's important to keep the correct sequence.
Example:
how to write | how it looks |
'''<u>Underlining</u>''' | Underlining |
Block
- Use the pair <pre>...</pre> to create a block. Bear in mind that the enclosed text will not be combined with the other tags, however the text will be displayed in the place where you put it, retaining all spaces and tabulations.
Example:
how to write | how it looks |
<pre>Block</pre> | Block |
Source code
Use the pair <source lang="..."></source to enclose source code blocks. This highlights the code to make it easier to read. The main kinds are "ini" for Ltx scripts, "lua" for Lua scripts, and "xml" for Xml.
Example:
how to write | how it looks |
<source lang="ini"> | [2515] ; cse_abstract properties section_name = smart_terrain name = esc_bandits_smart_terrain position = 131.02030944824,0.065616846084595,-248.9094543457 direction = 0,0,0 |
<source lang="lua"> | for index = 1, #states do table.insert(tbl.state, states[index]) end |
<source lang="xml"> | <string id="wpn_ak100_m1"> <text>AK 100</text> </string> |
See http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi for a complete description.
Headings
- The heading tags are very important because they separate the logical sections. You can see how the headings function below.
==Общие принципы== ... ==Surrounding tags== ... ==Single markers== ... ===Alternative block===
Single markers
Alternative block
- The drawback of creating block with <pre>...</pre> tags is its inability to format text enclosed within it. There's no such problems with alternative blocks; you can create it, having put space in the beginning of each phrase of the block.
Example:
how to write | how it looks |
Alternative |
Alternative Block |
Contents
- Appears automatically when the text has more than three headings, however the contents box can be displayed forcibly with the tags below.
Example:
how to write | how it looks |
__TOC__ |
Templates
Example
- On this page I used the example template for a number of times. The condition is often enclosed into the NON-formatiing tag <nowiki>...</nowiki>.
{{sample|<nowiki>Condition</nowiki>|Condition}}