MozillaZine Knowledge Base:Formatting: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
 
(28 intermediate revisions by 16 users not shown)
Line 1: Line 1:
==Character Formatting==
{{org}}
== Links ==
This is quite easy. Use double <nowiki>[[ ]]</nowiki> or single <nowiki>[ ]</nowiki> brackets, depending on whether you are linking to another page within the Knowledge Base or to an external site.


===Emphasis===
=== Linking to another Knowledge Base page ===
*<nowiki>''Two single quotes''</nowiki> = ''Two single quotes''
* Put the exact name of the page inside double brackets. Example: <tt><nowiki>[[Rules]]</nowiki></tt> = [[Rules]].
*<nowiki>'''Three single quotes'''</nowiki> = '''Three single quotes'''
* If the page name contains two or more separate words, write the words separated by a space rather than connected with an underline. Example: use <tt><nowiki>[[Profile Manager]]</nowiki></tt> and not <tt><nowiki>[[Profile_Manager]]</nowiki></tt> to create [[Profile Manager]].
*<nowiki>'''''Five single quotes'''''</nowiki> = '''''Five single quotes'''''
* Be careful about capital letters. Example: to link to the [[Global Inbox]] article, you need to use <tt><nowiki>[[Global Inbox]]</nowiki></tt> and not <tt><nowiki>[[Global inbox]]</nowiki></tt>.
* Lowercase can be used for the first letter in the page name. Example: &ldquo;<tt><nowiki>Read the [[rules]] for editing</nowiki></tt>&rdquo; = &ldquo;Read the [[rules]] for editing&rdquo;.
* To use different display text for the link, insert the pipe character "|" followed by the text you want to show for the link. Example: <tt><nowiki>[[Rules | rules for editing]]</nowiki></tt> = [[Rules | rules for editing]].
* Pipe trick: for a page name ending with text in parentheses, if you insert the pipe character "|" without any text following it, the text in parentheses will not be displayed in the link. Examples: <tt><nowiki>[[Filters (Thunderbird)|]]</nowiki></tt> = [[Filters (Thunderbird)|Filters]].
* It's possible to link to a specific section in a Knowledge Base page using this syntax: <tt><nowiki>[[page name#section name | display text]]</nowiki></tt>. Example: <tt><nowiki>[[In-house style#Commonly used names | Application and OS names]]</nowiki></tt> = [[In-house style#Commonly used names | Application and OS names]]. For a section in the current page you can omit the page name. Example: <tt><nowiki>[[#Document structure | Headers and lists]]</nowiki></tt> = [[#Document structure | Headers and lists]]. However, be aware that such a link will no longer lead to the specified section if someone edits the target page and changes the section name.
 
===Link to a category within the knowledge base===
Linking to a category is very similar to linking to a page, the only change you need to make is to preface the category with a colon. For example, you can add a link to Category:Visual_customizations_(Thunderbird) using <nowiki>[[:Category:Visual_customizations_(Thunderbird)]] </nowiki> .
 
=== Linking to an external site===
Use the following syntax when linking to a page outside the Knowledge Base.
* Numbered external links: <tt><nowiki>[http://mozilla.org/]</nowiki></tt> = [http://mozilla.org/]
* Named external links: <tt><nowiki>[http://mozilla.org/  Mozilla Home]</nowiki></tt> = [http://mozilla.org/  Mozilla Home]
* Explicit external links: &ldquo;<tt><nowiki>visit http://mozilla.org/ now</nowiki></tt>&rdquo; = &ldquo;visit http://mozilla.org/ now&rdquo;


===Code===
Note: If you want to include a web address without a link,  use the <nowiki><nowiki></nowiki> and <nowiki></nowiki></nowiki> tags:
Code may be entered as monospace lines by beginning a line
*<tt><nowiki><nowiki>http://mozilla.org</nowiki></nowiki></tt> = <nowiki>http://mozilla.org</nowiki>
with a space. Formatting is preserved.
For example:
for(int a=0;a<1;a++)
    {
      do_something();
    }   
HTML and Wiki-code is '''still processed''' in monospace lines.


==URLs, links==
===Linking to bugzilla===
This is quite easy, use single [] or double <nowiki>[[ ]]</nowiki>.
* Bug numbered reference to a comment: <tt><nowiki>[https://bugzilla.mozilla.org/show_bug.cgi?id=450850#c2]</nowiki></tt> = [https://bugzilla.mozilla.org/show_bug.cgi?id=450850#c2]
*Internal links: <nowiki>[[Rules]]</nowiki> = [[Rules]].
* Bug report: <tt><nowiki>({{bug|404507}})</nowiki></tt> = ({{bug|404507}})
*To assist you when creating internal links within sentences, you may uncapitalize the first letter of the article: <nowiki>&ldquo;read the [[rules]] for editing&rdquo;</nowiki> = &ldquo;read the [[rules]] for editing&rdquo;.
*Named internal links: <nowiki>[[Rules | rules for editing]]</nowiki> = [[Rules | rules for editing]].
*Contracted external links: <nowiki>[http://mozilla.org/]</nowiki> = [http://mozilla.org/].
*Named external links: <nowiki>[http://mozilla.org/  Mozilla Home]</nowiki> = [http://mozilla.org/ Mozilla Home].
*Explicit external links: <nowiki>&ldquo;visit http://mozilla.org/ now&rdquo;</nowiki> = &ldquo;visit http://mozilla.org/ now&rdquo;.


*Using link anchors (&lt;a name="..."> in HTML):
''Note: The braces make use of a special [[Rules/Templates|template]] .''
**Creating anchors. An anchor is created automatically for each section of a page. You can create additional anchors by putting an '''id''' attribute on any HTML tag understood by MediaWiki. Example: <nowiki><div id="anchor">Text with anchor</div></nowiki> = <div id="anchor">Text with anchor</div> Note, that neither <a name="anchor">, nor <a id="anchor"> will work.
**Linking to an anchor. You can link to an anchor on a page using this syntax: <nowiki>[[In-House Style#Commonly used names|Commonly used names]]</nowiki> = [[In-House Style#Commonly used names|Commonly used names]]. For anchors on current page you can use <nowiki>[[#anchor|anchor]]</nowiki> = [[#anchor|anchor]].


==Document structure==
==Document structure==
Section headers: <nowiki>=Header Example=</nowiki> gives you a:
===Headers===
===Header Example===
Section headers within a page are made by putting two or three equal signs on each side of the desired header text: use "==" for a level 2 header or "===" for a level 3 header. Example: in the "Links" section above, the headers were made by inserting the following:
which will add an entry to the table of contents.
 
Subsections: in order to have subsections, add one more equal sign to both sides of the code (<nowiki>====Subheader Example====</nowiki>)
<tt>
====Subheader Example====
<nowiki>== Links ==</nowiki><br>
and adds an entry to the table of contents.
<nowiki>=== Linking to another Knowledge Base page ===</nowiki><br>
Note: there are six levels of document headers in MediaWiki, hence six different header code (largest header has one equal sign, second largest has two, etc.)
<nowiki>=== Linking to an external site ===</nowiki>
</tt>
 
There are actually six levels of headers that can be created in the same fashion, but most articles in the Knowledge Base use only level 2 and level 3 headers.  


===Lists===
===Lists===
Lists: <nowiki>*,#</nowiki> at the beginning of a line gives
* Unordered list
# Ordered list
For levels of lists, add more <nowiki>*,#</nowiki>s:
** Unordered list
## Ordered list


===Indented Text===
Put <nowiki>*</nowiki> or <nowiki>#</nowiki> at the beginning of a line to make an unordered (bulleted) or ordered (numbered) list, respectively. To make a list within a list, use <nowiki>**</nowiki> or <nowiki>##</nowiki> instead. Examples:
When you use the : (colon) at the beginning of a line it will be indented.<br>
 
For example:<br>
<tt>
:Hello I am the indented line
<nowiki>* list item 1</nowiki><br>
:Hello I am the next indented line.
<nowiki>* list item 2</nowiki><br>
Gives:<br>
<nowiki>** list item 2a</nowiki><br>
:Hello I am the indented line
<nowiki>** list item 2b</nowiki><br>
:Hello I am the next indented line.
<nowiki>* list item 3</nowiki>
</tt>
 
will produce
 
* list item 1
* list item 2
** list item 2a
** list item 2b
* list item 3
 
Whereas using <nowiki>#</nowiki> instead of <nowiki>*</nowiki> will produce
 
# list item 1
# list item 2
## list item 2a
## list item 2b
# list item 3
 
You can also produce mixed lists, such as a bulleted list within a numbered list.  Example:
 
<tt>
<nowiki># list item 1</nowiki><br>
<nowiki># list item 2</nowiki><br>
<nowiki>#* list item 2a</nowiki><br>
<nowiki>#* list item 2b</nowiki><br>
<nowiki># list item 3</nowiki>
</tt>
 
will produce
 
# list item 1
# list item 2
#* list item 2a
#* list item 2b
# list item 3
 
===Indented text===
 
Indenting is used most often in [[Talk]] pages. To indent a line, put a : (colon) at the beginning of the line. For example:
 
<tt>
<nowiki>:Hello, I am the first indented line.</nowiki><br>
<nowiki>:I am the next indented line.</nowiki><br>
<nowiki>::I am a doubly indented line.</nowiki>
</tt>
 
produces
 
:Hello, I am the first indented line.
:I am the next indented line.
::I am a doubly indented line.


===Tables===
===Tables===
[[MozillaZine Knowledge Base:Tables | Tables are explained on a separate page]].
Tables are explained on a [[MozillaZine Knowledge Base:Tables | separate page]].
 
===Table of Contents===
You can hide the table of contents using <nowiki>__NOTOC__</nowiki>
 
==Character formatting==
 
===Emphasis===
Although the current [[In-house style | style guidelines]] say that italics and bold should be used as sparingly as possible, there are some situations when you may want to use them. To do so:
 
*<tt><nowiki>''Two single quotes''</nowiki></tt> = ''Two single quotes''
*<tt><nowiki>'''Three single quotes'''</nowiki></tt> = '''Three single quotes'''
*<tt><nowiki>'''''Five single quotes'''''</nowiki></tt> = '''''Five single quotes'''''
 
===Code===
 
Code may be entered as monospace lines by beginning each line with a space. For example:
 
<tt><nowiki>&nbsp;user_pref("mail.ui.display.dateformat.default", 2);</nowiki></tt>
 
produces
 
user_pref("mail.ui.display.dateformat.default", 2);
 
This will preserve manually inserted spacing within your text, as in this example:
 
for(int a=0;a<1;a++)
    {
      do_something();
    }
 
For longer, multiline blocks of code, instead of beginning each line with a space, the preferred way is to enclose the whole block of code in a single set of &lt;pre&gt; tags. Also note that HTML and Wiki-code are still processed in monospace lines.
 
== Signatures ==
 
Though signatures are not used in regular Knowledge Base articles, it helpful if you include your signature when commenting in a [[Talk]] page, so that people reading the Talk page later can understand who said what when. To insert your signature:


==Miscellaneous==
* Nickname and date: <tt><nowiki>~~~~</nowiki></tt> = [[User:Heroist|Heroist]] 09:27, 31 Jan 2004 (PST).
*For those of us that like center aligned text: <nowiki><center>'''Me'''</center></nowiki>
* Nickname only: <tt><nowiki>~~~</nowiki></tt> = [[User:Heroist|Heroist]].
gives you:<br>
<center>'''Me'''</center>


===Signatures===
==See also==
*Sign with nickname: <nowiki>~~~</nowiki> = [[User:Heroist|Heroist]] .
* [[MozillaZine Knowledge Base:Tables]]
*Nickname and date: <nowiki>~~~~</nowiki> = [[User:Heroist|Heroist]] 09:27, 31 Jan 2004 (PST).
* [[In-house style]]


==More Information==
==External links==
More advanced editing is explained at [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide:_Editing_overview Wikipedia's MetaWiki].
*[http://meta.wikimedia.org/wiki/Help:Editing Help:Editing (Wikimedia Meta-Wiki)]  
*[http://meta.wikimedia.org/wiki/Help:Advanced_editing Help:Advanced Editing (Wikimedia Meta-Wiki)]

Latest revision as of 01:09, 18 April 2011

Links

This is quite easy. Use double [[ ]] or single [ ] brackets, depending on whether you are linking to another page within the Knowledge Base or to an external site.

Linking to another Knowledge Base page

  • Put the exact name of the page inside double brackets. Example: [[Rules]] = Rules.
  • If the page name contains two or more separate words, write the words separated by a space rather than connected with an underline. Example: use [[Profile Manager]] and not [[Profile_Manager]] to create Profile Manager.
  • Be careful about capital letters. Example: to link to the Global Inbox article, you need to use [[Global Inbox]] and not [[Global inbox]].
  • Lowercase can be used for the first letter in the page name. Example: “Read the [[rules]] for editing” = “Read the rules for editing”.
  • To use different display text for the link, insert the pipe character "|" followed by the text you want to show for the link. Example: [[Rules | rules for editing]] = rules for editing.
  • Pipe trick: for a page name ending with text in parentheses, if you insert the pipe character "|" without any text following it, the text in parentheses will not be displayed in the link. Examples: [[Filters (Thunderbird)|]] = Filters.
  • It's possible to link to a specific section in a Knowledge Base page using this syntax: [[page name#section name | display text]]. Example: [[In-house style#Commonly used names | Application and OS names]] = Application and OS names. For a section in the current page you can omit the page name. Example: [[#Document structure | Headers and lists]] = Headers and lists. However, be aware that such a link will no longer lead to the specified section if someone edits the target page and changes the section name.

Link to a category within the knowledge base

Linking to a category is very similar to linking to a page, the only change you need to make is to preface the category with a colon. For example, you can add a link to Category:Visual_customizations_(Thunderbird) using [[:Category:Visual_customizations_(Thunderbird)]] .

Linking to an external site

Use the following syntax when linking to a page outside the Knowledge Base.

  • Numbered external links: [http://mozilla.org/] = [1]
  • Named external links: [http://mozilla.org/ Mozilla Home] = Mozilla Home
  • Explicit external links: “visit http://mozilla.org/ now” = “visit http://mozilla.org/ now”

Note: If you want to include a web address without a link, use the <nowiki> and </nowiki> tags:

  • <nowiki>http://mozilla.org</nowiki> = http://mozilla.org

Linking to bugzilla

  • Bug numbered reference to a comment: [https://bugzilla.mozilla.org/show_bug.cgi?id=450850#c2] = [2]
  • Bug report: ({{bug|404507}}) = (bug 404507)

Note: The braces make use of a special template .

Document structure

Headers

Section headers within a page are made by putting two or three equal signs on each side of the desired header text: use "==" for a level 2 header or "===" for a level 3 header. Example: in the "Links" section above, the headers were made by inserting the following:

== Links ==
=== Linking to another Knowledge Base page ===
=== Linking to an external site ===

There are actually six levels of headers that can be created in the same fashion, but most articles in the Knowledge Base use only level 2 and level 3 headers.

Lists

Put * or # at the beginning of a line to make an unordered (bulleted) or ordered (numbered) list, respectively. To make a list within a list, use ** or ## instead. Examples:

* list item 1
* list item 2
** list item 2a
** list item 2b
* list item 3

will produce

  • list item 1
  • list item 2
    • list item 2a
    • list item 2b
  • list item 3

Whereas using # instead of * will produce

  1. list item 1
  2. list item 2
    1. list item 2a
    2. list item 2b
  3. list item 3

You can also produce mixed lists, such as a bulleted list within a numbered list. Example:

# list item 1
# list item 2
#* list item 2a
#* list item 2b
# list item 3

will produce

  1. list item 1
  2. list item 2
    • list item 2a
    • list item 2b
  3. list item 3

Indented text

Indenting is used most often in Talk pages. To indent a line, put a : (colon) at the beginning of the line. For example:

:Hello, I am the first indented line.
:I am the next indented line.
::I am a doubly indented line.

produces

Hello, I am the first indented line.
I am the next indented line.
I am a doubly indented line.

Tables

Tables are explained on a separate page.

Table of Contents

You can hide the table of contents using __NOTOC__

Character formatting

Emphasis

Although the current style guidelines say that italics and bold should be used as sparingly as possible, there are some situations when you may want to use them. To do so:

  • ''Two single quotes'' = Two single quotes
  • '''Three single quotes''' = Three single quotes
  • '''''Five single quotes''''' = Five single quotes

Code

Code may be entered as monospace lines by beginning each line with a space. For example:

 user_pref("mail.ui.display.dateformat.default", 2);

produces

user_pref("mail.ui.display.dateformat.default", 2);

This will preserve manually inserted spacing within your text, as in this example:

for(int a=0;a<1;a++)
   {
     do_something();
   }

For longer, multiline blocks of code, instead of beginning each line with a space, the preferred way is to enclose the whole block of code in a single set of <pre> tags. Also note that HTML and Wiki-code are still processed in monospace lines.

Signatures

Though signatures are not used in regular Knowledge Base articles, it helpful if you include your signature when commenting in a Talk page, so that people reading the Talk page later can understand who said what when. To insert your signature:

  • Nickname and date: ~~~~ = Heroist 09:27, 31 Jan 2004 (PST).
  • Nickname only: ~~~ = Heroist.

See also

External links