Difference between revisions of "Help:Funtoo Editing Guidelines/Basics"

From Funtoo
Jump to navigation Jump to search
Line 12: Line 12:
}}
}}


This will render as follows:
This will render in monospaced text as follows:


  foobar
  foobar
}}


This can rear its ugly head when specifying template parameters, so you will get this:
=== Template Parameters ===


{{note| ugh!}}
Templates are MediaWiki's versions of "macros" or functions, and typically look like this in wikitext:


...instead of this:
{{file|name=example wikitext for template call|body=<nowiki>
{{c|foobar}}
</nowiki>}}


{{note|This looks much better!}}
Above, we are calling the [[Template:C]] template and specifying its first parameter to be the string {{c|foobar}}. Another way to specify the first
parameter is using the {{c|1{{!}}}} convention, as follows, which does the same thing as the previous template call:


{{file|name=example wikitext for template call, now with 1{{!}}|body=<nowiki>
{{c|1=foobar}}
</nowiki>}}


{{Note|By default, Table of Contents is disabled on the Funtoo wiki. If you would like to enable the TOC, you can place a <code><nowiki>__TOC__</nowiki></code> on a blank line where you'd like the Table of Contents to appear, or place <code><nowiki>__FORCETOC__</nowiki></code> on a blank line anywhere in the wikitext to force the TOC to appear at the top of the page.}}
It is a common error for new wiki contributors to leave extra whitespace after the {{c|{{!}}}} character when specifying a parameter to a template, particularly when they are using {{c|<nowiki>{{note}}</nowiki>}} or similar templates. This will cause the first parameter to render as ''monospace'', which is not generally what you want! So, instead of getting a proper tip like this:
 
{{file|name=example wikitext of correctly-written tip|body=<nowiki>
{{tip|This is an example tip!}}
</nowiki>}}
 
{{tip|This is an example tip!}}
 
You will instead get the following:
 
{{tip| This is a broken tip because I have a leading space after {{!}}!}}
 
{{file|name=example wikitext of 'broken' tip|body=<nowiki>
{{tip| This is a broken tip because I have a leading space after {{!}}!}}
</nowiki>}}

Revision as of 02:54, February 24, 2019

Paragraphs

To create a new paragraph, insert a blank line between two lines of text. If a blank line doesn't exist between two lines of wikitext, they will be combined into a single flowing paragraph.

   Warning

If you leave leading whitespace at the beginning of a line, MediaWiki will render it as pre-formatted text. Beware of this. See below for more info.

Here's an example of how whitespace at the beginning of text (in this case, just a single space) will force mediawiki to render text as pre-formatted. This can be handy when you want it, and a pain when you don't want it -- so be aware of this feature!

   example wikitext
foobar

This will render in monospaced text as follows:

foobar

Template Parameters

Templates are MediaWiki's versions of "macros" or functions, and typically look like this in wikitext:

   example wikitext for template call

{{c|foobar}}

Above, we are calling the Template:C template and specifying its first parameter to be the string foobar. Another way to specify the first parameter is using the 1| convention, as follows, which does the same thing as the previous template call:

   example wikitext for template call, now with 1|

{{c|1=foobar}}

It is a common error for new wiki contributors to leave extra whitespace after the | character when specifying a parameter to a template, particularly when they are using {{note}} or similar templates. This will cause the first parameter to render as monospace, which is not generally what you want! So, instead of getting a proper tip like this:

   example wikitext of correctly-written tip

{{tip|This is an example tip!}}

   Tip

This is an example tip!

You will instead get the following:

   Tip
This is a broken tip because I have a leading space after |!
   example wikitext of 'broken' tip

{{tip| This is a broken tip because I have a leading space after {{!}}!}}