Help:Wikitext: Difference between revisions

4,408 bytes added ,  5 years ago
no edit summary
mNo edit summary
No edit summary
Line 1:
{{Help page}}
{{Tip|You can view a simplified version of this page at [[Help:Cheatsheet]] that lists the most commonly used wiki formatting codes you need to know.}}
''Page is a WIP''
 
'''Wikitext''', also known as '''wiki markup''', refers to the syntax, keywords, and punctuation marks used by {{SITENAME}} to format a page. For example, to make text italicized, you would type <code><nowiki>''text to be italicized''</nowiki></code> into the page when [[Help:Editing|editing]] it. You will see wikitext if you click on '{{int:visualeditor-ca-editsource}}' to edit a page. If you use the new [[Help:VisualEditor|VisualEditor]] to edit a page, you will not see wikitext when editing, and will instead edit the page like you would a Word document.
 
Line 635 ⟶ 633:
| %20 || %22 || %27 || %2c || %3b || %3c || %3e || %3f || %5b || %5d
|}
 
===Redirects===
{{Main|Help:Redirect}}
You can redirect a page to another page by adding <code><nowiki>#REDIRECT [[</nowiki>''Target page name'']]</code> to the very first line of the page, with nothing else on the same line. When the edit is saved, the page will automatically redirect users that visit it.
 
You can redirect to a section of a page by adding <code><nowiki>#REDIRECT [[</nowiki>''Target page name''#''Target section]]</code>.
 
<pre style="margin:0;border:none;padding:0; word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-o-pre-wrap;white-space:-pre-wrap;white-space:pre-wrap;">
#REDIRECT [[Africa]]
 
#REDIRECT [[Africa#Culture]]
</pre>
 
==Musical notation==
Line 740 ⟶ 750:
 
===Nowiki tags===
The <code><nowiki><nowiki></nowiki></nowiki></code> tags can be used to tell the wiki software not to convert wiki markup into HTML, instead displaying them in their raw form on the page. For example, <code><nowiki>'''Bold text'''</nowiki></code> would be rendered as <nowiki>'''Bold text'''</nowiki>, rather than as '''Bold text''' like it normally would. Anything placed between these tags will not have their wiki markup processed, and new lines and multiple spaces will be stripped. It will still interpret HTML character codes.
 
You can also use a single <code><nowiki><nowiki /></nowiki></code> to "break" certain interpretations. For example, placing <code><nowiki><nowiki /></nowiki></code> before a list entry (either <code>#</code> or <code>*</code>) will cause that entry to not be considered part of the list.
Line 762 ⟶ 772:
|-
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|<pre style="margin:0;border:none;padding:0; word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-o-pre-wrap;white-space:-pre-wrap;white-space:pre-wrap;">
A [[micro-]]second.
 
A [[micro-]]<nowiki><nowiki /></nowiki>second.
</pre>
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|
A [[micro-]]second.
 
A [[micro-]]<nowiki />second.
|-
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|<pre style="margin:0;border:none;padding:0; word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-o-pre-wrap;white-space:-pre-wrap;white-space:pre-wrap;">
'<nowiki><nowiki /></nowiki>'Italics' markup'<nowiki><nowiki /></nowiki>'
</pre>
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|
'<nowiki />'Italics' markup'<nowiki />'
|-
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|<pre style="margin:0;border:none;padding:0; word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-o-pre-wrap;white-space:-pre-wrap;white-space:pre-wrap;">
a<nowiki><nowiki></nowiki>
 
b</nowiki>
</pre>
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|
a<nowiki>
 
b</nowiki>
|-
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|<pre style="margin:0;border:none;padding:0; word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-o-pre-wrap;white-space:-pre-wrap;white-space:pre-wrap;">
<nowiki><nowiki></nowiki><!-- revealed --></nowiki>
</pre>
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|
<nowiki><!-- revealed --></nowiki>
|-
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|<pre style="margin:0;border:none;padding:0; word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-o-pre-wrap;white-space:-pre-wrap;white-space:pre-wrap;">
<nowiki><nowiki></nowiki>&amp;rarr;</nowiki>
</pre>
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|
<nowiki>&rarr;</nowiki>
|-
|style="width:50%; border-width:1px;border-style:solid none none none;border-color:#ddd; padding:5px; vertical-align:top;"|
Line 771 ⟶ 814:
 
===Preformatted text block===
The <code><nowiki><pre></pre></nowiki></code> tag ignores wiki markup like the &lt;nowiki&gt; tag. It will also display the text in a monospace font, and does not reformat text and spaces. It will still interpret HTML character codes.
 
{| style="width:100%;"
!scope="col" style="width:50%;"| You type
Line 777 ⟶ 822:
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|{{#tag:pre|
<nowiki><pre></nowiki>
Wiki markup, like '''bold''', ''italics'', and [[link]]s are not followed, and spaces will not be reformatted. However, some HTML entities are kept, like &amp;amp;.<nowiki>
</pre></nowiki>|style="margin:0;border:none;padding:0; word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-o-pre-wrap;white-space:-pre-wrap;white-space:pre-wrap;"}}
|style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|<pre>Wiki markup, like '''bold''', ''italics'', and [[link]]s are not followed, and spaces will not be reformatted. However, some HTML entities are kept, like &amp;.</pre>
|-
|style="width:50%; border-width:1px;border-style:solid none none none;border-color:#ddd; padding:5px; vertical-align:top;"|
|style="width:50%; border-width:1px;border-style:solid none none none;border-color:#ddd; padding:5px; vertical-align:top;"|
|}
 
Preformatted text blocks do not wrap, so text may extend off-screen past the browser window. To resolve this, you can use CSS styling to add wrapping or a horizontal scrollbar.
 
* Wrapping: <code><nowiki><pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;"></nowiki></code>
* Scrollbar: <code><nowiki><pre style="overflow:auto; width:auto;"></nowiki></code>
 
==Hidden text (comments)==
{{Main|Help:Hidden text}}
Hidden comments can be inserted into the text by surrounding them with <code><nowiki><!-- --></nowiki></code>. Any text entered between these tags will be visible when editing the page, but not when the page is rendered. For example:
 
<pre><nowiki><!-- An example of hidden comments
This won't be visible except in "edit" mode. --></nowiki></code>
 
Comments can be used to leave notes for other editors, or to explain what bits of code does when editing complex [[Help:Template|templates]].
 
==See also==