Basic Formatting: Difference between revisions

From Iskomunidad
No edit summary
No edit summary
Line 135: Line 135:


When inserting a section, edit the previous or following section, merge by deleting the heading if necessary, and adjust the edit summary accordingly.
When inserting a section, edit the previous or following section, merge by deleting the heading if necessary, and adjust the edit summary accordingly.
=Links=
Links are used to reference pages within MediaWiki, other wikis, or external websites.
=== Internal Links ===
To create a so-called internal link to a page on the same wiki (a "wikilink"), use double square brackets wiki markup, [[like this]]. When you preview or save your changes, you will see a link that can be followed to the target page. If the page exists the link is displayed in blue (like the word "create" in the first sentence of this paragraph); if the page does not exist, the link appears red (so the [[like this]] link is actually rendered like this). Note that the colors could be different if the color scheme of the wiki has been changed from the default. Following such a "redlink" to a missing page (whether or not it is actually red) will usually enable the user to create the page.
To markup any arbitrary string of text (not necessarily a page title) as a link, use a "vertical bar" or "pipe" character, like this: [[Help:Categories|category links]] results in the link category links.
The first letter of the link target is usually not case-sensitive (unless the wiki is configured otherwise), meaning links can be capitalized or not (so How to contribute and how to contribute are equivalent). However, the case of every subsequent letter must match the target page exactly (so How to contribute and How To Contribute are not equivalent). Spaces in the page title may be represented as underscores (so How to contribute and How_to_contribute are again equivalent), but using underscores in links will make them visible in the page text (but this can be prevented by using a "pipe").
If the page title you are linking to is that of the page you are editing, the result is not a hyperlink at all but simply bold text (for example, on this page the markup [[Help:Links]] gives the result Help:Links). If you're trying to create a wikilink to the current page, you probably want to link to a specific section or to an anchor within the page; see the examples below.
MediaWiki uses the pagelinks table to keep track of internal wikilinks.
{| border="1" class="wikitable"
! <translate><!--T:116--> Name</translate>/<translate><!--T:6--> Description</translate>
! <translate><!--T:117--> Syntax</translate>
! <translate><!--T:118--> Result</translate>
|-
| <translate><!--T:9--> Internal link</translate>
|<syntaxhighlight lang="mediawiki">
[[Main Page]]
[[Help:Contents]]
[[Extension:DynamicPageList (Wikimedia)]]
</syntaxhighlight>
|
[[Main Page]]
[[Help:Contents]]
[[Extension:DynamicPageList (Wikimedia)]]
|-
| <translate><!--T:10--> Piped link</translate>
|
<syntaxhighlight lang="mediawiki">[[Help:Editing pages|editing help]]</syntaxhighlight>
<translate><!--T:115--> Links to a section/anchor within the target page.</translate>
<syntaxhighlight lang="mediawiki">[[Help:Editing pages#Preview|previewing]]</syntaxhighlight>
<translate><!--T:18--> Piped link to an anchor on the same page</translate>
<syntaxhighlight lang="mediawiki">[[#See also|different text]]</syntaxhighlight>
<translate><!--T:11--> See also [[<tvar name=meta>Special:MyLanguage/Help:Links#Piped links</tvar>|Help:Piped link]].</translate>
|
[[Help:Editing pages|editing help]]
[[Help:Editing pages#Preview|previewing]]
[[#See also|different text]]
|-
|[[w:Help:Pipe_trick|Pipe trick]]
|<syntaxhighlight lang="mediawiki">
[[Manual:Extensions|]]
[[User:John Doe|]]
[[Extension:DynamicPageList (Wikimedia)|]]
[[Extension:DynamicPageList (disambiguation)|]]
</syntaxhighlight>
<translate><!--T:142--> The transformation done by the pipe trick can result in the same text for different link targets, as seen in the DynamicPageList examples.</translate>
|
{{ll|Manual:Extensions|Extensions}}
[[User:John Doe|John Doe]]
[[Extension:DynamicPageList (Wikimedia)|DynamicPageList]]
[[Extension:DynamicPageList (disambiguation)|DynamicPageList]]
|-
|<span id="linktrail"></span><translate><!--T:13--> Word-ending links</translate>
|<syntaxhighlight lang="mediawiki">
[[Help]]s
[[Help]]ing
[[Help]]ers
[[Help]]almostanylettersyoulikehere
[[Help]]BUTnotalways
</syntaxhighlight>
<translate><!--T:91--> Follows so-called "linktrail rules" [[<tvar name=loc>Special:MyLanguage/Localisation</tvar>|localised]] per [[<tvar name=msgxx>Special:MyLanguage/MessagesXx.php</tvar>|each language]].</translate>
|
[[Help]]s
[[Help]]ing
[[Help]]ers
[[Help]]almostanylettersyoulikehere
[[Help]]BUTnotalways
|-
| <translate><!--T:14--> Avoiding word-ending links</translate>
|<syntaxhighlight lang="mediawiki">
[[Help]]<nowiki />ful advice
[[wikipedia:GNU General Public License|GPL]]<nowiki />v3
</syntaxhighlight>
|
[[Help]]<nowiki />ful advice
[[wikipedia:GNU General Public License|GPL]]<nowiki />v3
|-
| <translate><!--T:17--> Link to an anchor on the same page</translate>
|<syntaxhighlight lang="mediawiki">[[#See also]]</syntaxhighlight>
<translate><!--T:77--> Anchors are provided automatically on [[<tvar name=formatting>Special:MyLanguage/Help:Formatting</tvar>|section headings]] and to the [[<tvar name=1>#top</tvar>|top]] (<tvar name=2><code><nowiki>[[#top]]</nowiki></code></tvar>) of the page.</translate>
|[[#See also]]
|-
| <translate><!--T:19--> Setting an anchor for incoming links</translate>
|<syntaxhighlight lang=html>
<div id="Unique anchor name 1">optional text</div>
<span id="Unique anchor name 2">optional text</span>
</syntaxhighlight>
<translate><!--T:92--> Rendered [[w:HTML element#Document body elements|block-level and inline]], respectively.</translate>
<translate><!--T:132--> Doing this would allow for <code><nowiki>[[#Unique anchor name 1]]</nowiki></code> on the same page or <code><nowiki>[[</nowiki>{{FULLPAGENAME}}#Unique anchor name 1]]</code> on a different page.</translate>
<translate><!--T:133--> Omit the "optional text" for an invisible anchor.</translate>
<translate>
<!--T:97-->
Setting an anchor in a section heading
</translate>
<syntaxhighlight lang=html>
==<span id="Alternate Section Title"></span>Section heading==
</syntaxhighlight>
<translate><!--T:98--> Note the placement.</translate>
<translate><!--T:134--> This must be a "span" tag, not a "div".</translate>
<translate><!--T:135--> (Such anchors allow sections to be retitled without breaking incoming links.)</translate>
|
<div id="<translate nowrap><!--T:93--> Unique anchor name 1</translate>"><translate><!--T:94--> optional text</translate></div>
<span id="<translate nowrap><!--T:95--> Unique anchor name 2</translate>"><translate><!--T:96--> optional text</translate></span>
<div style="color: #000000; background: none; overflow: hidden; page-break-after: avoid; font-size: 1.5em; font-family: Georgia,Times,serif; margin-top: 1em; margin-bottom: 0.25em; line-height: 1.3; padding: 0; border-bottom: 1px solid #AAAAAA;"><span id="Alternate Section Title"></span>Section heading</div>
|-
| <translate><!--T:20--> Link to an anchor at another page</translate>
|<syntaxhighlight lang=mediawiki>[[Help:Images#Supported media types for images]]</syntaxhighlight>
|[[Help:Images#Supported media types for images]]
|-
| <translate><!--T:21--> Link to the current page's talk page</translate>
|<syntaxhighlight lang=mediawiki>[[{{TALKPAGENAME}}|Discussion]]</syntaxhighlight>
<translate><!--T:22--> See also [[<tvar name=page-names>Special:MyLanguage/Help:Magic_words#Page_names</tvar>|Help:Magic words#Page names]]</translate>
|[[{{TALKPAGENAME}}|Discussion]]
|-
|{{anchor|Subpage_feature}}<translate><!--T:23--> Link to a subpage</translate>
|<syntaxhighlight lang=mediawiki>[[/example]]</syntaxhighlight>
<translate><!--T:78--> Shortcut for <tvar name=1><syntaxhighlight lang="mediawiki" inline>[[Help:Links/example|/example]]</syntaxhighlight></tvar>.</translate> <translate><!--T:122--> See also <tvar name=1>{{ll|Help:Subpages}}</tvar>.</translate>
|[[Help:Links/example|/example]]
|-
| <translate><!--T:24--> Link to a subpage without the leading slash</translate>
|<syntaxhighlight lang=mediawiki>[[/example/]]</syntaxhighlight>
<translate><!--T:99--> Shortcut for <tvar name=1><syntaxhighlight lang="mediawiki" inline>[[Help:Links/example|example]]</syntaxhighlight></tvar>.</translate>
|[[Help:Links/example|example]]
|-
| <translate><!--T:120--> Link to a subpage of parent page for current page.</translate> <translate><!--T:123--> Can only be used on subpages.</translate>
|<syntaxhighlight lang=mediawiki>[[../example2]]</syntaxhighlight>
<translate><!--T:121--> Shortcut for <tvar name=1><syntaxhighlight lang="mediawiki" inline>[[Help:Links/example2|example2]]</syntaxhighlight></tvar> if you post the link on <tvar name=2><syntaxhighlight lang="mediawiki" inline>[[Help:Links/example|example]]</syntaxhighlight></tvar> page.</translate>
|[[Help:Links/example2|example2]]
|-
| <translate><!--T:25--> Visible link to a category page</translate>
|<syntaxhighlight lang=mediawiki>[[:Category:Help]]</syntaxhighlight>
<translate><!--T:114--> Without the leading colon the link would not be visible and the page would instead be placed into the category; this is a very common mistake.</translate>
<translate><!--T:26--> See also <tvar name=1>{{ll|Help:Categories}}</tvar>.</translate>
|[[:Category:Help]]
|-
| <translate><!--T:27--> Visible link to an image or media file</translate>
|id="file-links"|<syntaxhighlight lang=mediawiki>
[[:File:Example.jpg]]
[[:File:Example.jpg|file label]]
[[Media:Example.jpg]]
[[Media:Example.jpg|file label]]
</syntaxhighlight>
<translate><!--T:100--> Without the leading colon on the "File:" examples, the images would actually be displayed.</translate>
<translate><!--T:124--> See also <tvar name=1>{{ll|Help:Images}}</tvar>.</translate>
<translate>
<!--T:112-->
The <tvar name=1><code>Media:</code></tvar> prefix is used to link directly to the uploaded file, rather than the file-information page.</translate>
|
[[:File:Example.jpg]]
[[:File:Example.jpg|file label]]
[[Media:Example.jpg]]
[[Media:Example.jpg|file label]]
|-
| <translate><!--T:29--> Link to a page specific to each reader (user page, etc.)</translate>
|<syntaxhighlight lang=mediawiki>
[[Special:MyPage]]
[[Special:MyTalk]]
[[Special:Preferences]]
</syntaxhighlight>
|
[[Special:MyPage]]
[[Special:MyTalk]]
[[Special:Preferences]]
|-
| <translate><!--T:101--> Internal link to a specific revision</translate>
|<syntaxhighlight lang=mediawiki>[[Special:PermanentLink/2393992]]</syntaxhighlight>
<translate><!--T:102--> Revision numbers can be found in each page's [[<tvar name=h-hist>Special:MyLanguage/Help:History</tvar>|edit history]].</translate>
<translate><!--T:136--> (It is very common to see links to specific revisions implemented as external links because it's easy to cut-and-paste an entire URL to form an external link.)</translate>
|[[Special:PermanentLink/2393992]]
|-
| <translate><!--T:103--> Internal link to a "diff"</translate>
|<syntaxhighlight lang=mediawiki>
[[Special:Diff/2393992]]
[[Special:Diff/2390639/2393992]]
</syntaxhighlight>
<translate><!--T:104--> The default (in the first example above) is to show the changes from the previous revision.</translate>
<translate><!--T:137--> See also the comments in the previous item.</translate>
|
[[Special:Diff/2393992]]
[[Special:Diff/2390639/2393992]]
|-
| <translate><!--T:15--> Redirect</translate>
|<pre>#REDIRECT [[Main Page]]</pre>
<translate><!--T:113--> Should be the first line on the page.</translate>
<translate><!--T:16--> See <tvar name=1>{{ll|Help:Redirects}}</tvar>.</translate>
| [[File:Redirect arrow without text (cropped).svg]]&nbsp;[[Main Page]]
|}

Revision as of 13:49, 6 December 2024

Tables

Markup Summary

{| table start, required
|+ table caption, optional; only between table start and table row
|- table row, optional on first row—wiki engine assumes the first row
! table header cell, optional. Consecutive table header cells may be added on same line separated by double marks (!!) or start on new lines, each with its own single mark (!).
| table data cell, optional. Consecutive table data cells may be added on same line separated by double marks (||) or start on new lines, each with its own single mark (|).
|} table end, required
  • The above marks must start on a new line except the double || and !! for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
  • HTML attributes. Each mark, except table end, optionally accepts one or more HTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
    • Cells and caption (| or ||, ! or !!, and |+) hold content. So separate any attributes from content with a single pipe (|). Cell content may follow on same line or on following lines.
    • Table and row marks ({| and |-) do not directly hold content. Do not add pipe (|) after their optional attributes. If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it and your final attribute if it was touching the erroneous pipe!
  • Content may (a) follow its cell mark on the same line after any optional HTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
    • Pipe character as content. To insert a pipe (|) character into a table, use the <nowiki>|</nowiki> escaping mark.

Create a Table using Toolbar

Navigate to your page and select Edit. In the toolbar, click on Advanced, then choose the Table button. A dialog box will open, allowing you to make adjustments. To preview the current changes or obtain a clearer view of the modifications, click on Preview.


From the dialog, you can choose whether to enable a table header row, to stylize the table with border and to make the table sortable. A preview example is displayed. You can also set row and column counts you need. Then, press Insert button.



By default, the following code is generated:


Wikicode

{| class="wikitable" style="margin:auto"
|+ Caption text
|-
! Header text !! Header text !! Header text
|-
| Example || Example || Example
|-
| Example || Example || Example
|-
| Example || Example} || Example
|}

Result

Caption Text
Header text Header text Header text
Example Example Example
Example Example Example
Example Example Example

For more advance editing features, visit MediaWiki .


Sections

Drafting sections and subsections begins with a header line .


Wikicode Result

== A section ==

=== A sub-section ===.

==== Another sub-subsection ====



  • Headers with only one equals sign on a side (=text here=) cause a title the size of the page name.
  • The section header cannot be combined with other content on the same line. For instance, ==Section Header==<br> will not as render a header, but a paragraph.
  • You can create separate sections on different pages with their own edit histories using a template/page. Each template/page can be inserted into a main page, adding content without changing the overall look. This setup makes it easier to track changes and manage specific parts of a page.

Table of contents (TOC)

A table of contents (TOC) is automatically generated for pages containing more than three section headings. However, editors may choose to exclude the TOC by adding the magic word __NOTOC__ (enclosed in double underscores) in the edit box of the article.

Guidelines for using table of contents

[edit]

  • A TOC is added to the wikitext, overriding __NOTOC__ when either __FORCETOC__ or __TOC__ (with two underscores on either side of the term) is added even if the page has fewer than four headings.
  • Using __FORCETOC__ forces the Table of Contents (TOC) to appear before the first section heading, while __TOC__ places it where you want the TOC to begin, allowing for flexible positioning such as on the right or within a table cell.
  • __TOC__ helps control where the table of contents (TOC) appears in an article. You put __TOC__ where you want the TOC to show up, like after an introduction or at the end of the page. This makes sure the TOC is in the right spot without needing extra headings.
  • Using __NOTOC__ stops the automatic table of contents from showing up on a page. If you want to make your simple table of contents, you can manually create links to different sections on the page using headings like == A == and then linking to them using section links like this [[#A|A]]".


Editing Sections

To edit specific sections of a page, you can click on the "[edit]" link next to the section heading.

Instead of using section titles, section editing uses section numbers. Subsections are represented with a single number (e.g., In the link above, section 2 in the table of content is numbered as 9 in the link. This allows for focused editing without the need to have the entire text of the page visible. It is particularly useful for large pages, as it simplifies the editing process and reduces clutter. Adding __NOEDITSECTION__ section editing via a URL you already have still works.

When inserting a section, edit the previous or following section, merge by deleting the heading if necessary, and adjust the edit summary accordingly.

Links

Links are used to reference pages within MediaWiki, other wikis, or external websites.

Internal Links

To create a so-called internal link to a page on the same wiki (a "wikilink"), use double square brackets wiki markup, like this. When you preview or save your changes, you will see a link that can be followed to the target page. If the page exists the link is displayed in blue (like the word "create" in the first sentence of this paragraph); if the page does not exist, the link appears red (so the like this link is actually rendered like this). Note that the colors could be different if the color scheme of the wiki has been changed from the default. Following such a "redlink" to a missing page (whether or not it is actually red) will usually enable the user to create the page.

To markup any arbitrary string of text (not necessarily a page title) as a link, use a "vertical bar" or "pipe" character, like this: category links results in the link category links.

The first letter of the link target is usually not case-sensitive (unless the wiki is configured otherwise), meaning links can be capitalized or not (so How to contribute and how to contribute are equivalent). However, the case of every subsequent letter must match the target page exactly (so How to contribute and How To Contribute are not equivalent). Spaces in the page title may be represented as underscores (so How to contribute and How_to_contribute are again equivalent), but using underscores in links will make them visible in the page text (but this can be prevented by using a "pipe").

If the page title you are linking to is that of the page you are editing, the result is not a hyperlink at all but simply bold text (for example, on this page the markup Help:Links gives the result Help:Links). If you're trying to create a wikilink to the current page, you probably want to link to a specific section or to an anchor within the page; see the examples below.

MediaWiki uses the pagelinks table to keep track of internal wikilinks.

<translate> Name</translate>/<translate> Description</translate> <translate> Syntax</translate> <translate> Result</translate>
<translate> Internal link</translate>
[[Main Page]]

[[Help:Contents]]

[[Extension:DynamicPageList (Wikimedia)]]

Main Page

Help:Contents

Extension:DynamicPageList (Wikimedia)

<translate> Piped link</translate>
[[Help:Editing pages|editing help]]

<translate> Links to a section/anchor within the target page.</translate>

[[Help:Editing pages#Preview|previewing]]

<translate> Piped link to an anchor on the same page</translate>

[[#See also|different text]]

<translate> See also [[<tvar name=meta>Special:MyLanguage/Help:Links#Piped links</tvar>|Help:Piped link]].</translate>

editing help

previewing

different text

Pipe trick
[[Manual:Extensions|]]

[[User:John Doe|]]

[[Extension:DynamicPageList (Wikimedia)|]]

[[Extension:DynamicPageList (disambiguation)|]]

<translate> The transformation done by the pipe trick can result in the same text for different link targets, as seen in the DynamicPageList examples.</translate>

Template:Ll

John Doe

DynamicPageList

DynamicPageList

<translate> Word-ending links</translate>
[[Help]]s

[[Help]]ing

[[Help]]ers

[[Help]]almostanylettersyoulikehere

[[Help]]BUTnotalways

<translate> Follows so-called "linktrail rules" [[<tvar name=loc>Special:MyLanguage/Localisation</tvar>|localised]] per [[<tvar name=msgxx>Special:MyLanguage/MessagesXx.php</tvar>|each language]].</translate>

Helps

Helping

Helpers

Helpalmostanylettersyoulikehere

HelpBUTnotalways

<translate> Avoiding word-ending links</translate>
[[Help]]<nowiki />ful advice

[[wikipedia:GNU General Public License|GPL]]<nowiki />v3

Helpful advice

GPLv3

<translate> Link to an anchor on the same page</translate>
[[#See also]]

<translate> Anchors are provided automatically on [[<tvar name=formatting>Special:MyLanguage/Help:Formatting</tvar>|section headings]] and to the [[<tvar name=1>#top</tvar>|top]] (<tvar name=2>[[#top]]</tvar>) of the page.</translate>

#See also
<translate> Setting an anchor for incoming links</translate>
<div id="Unique anchor name 1">optional text</div>

<span id="Unique anchor name 2">optional text</span>

<translate> Rendered block-level and inline, respectively.</translate> <translate> Doing this would allow for [[#Unique anchor name 1]] on the same page or [[Basic Formatting#Unique anchor name 1]] on a different page.</translate> <translate> Omit the "optional text" for an invisible anchor.</translate>

<translate> Setting an anchor in a section heading </translate>

==<span id="Alternate Section Title"></span>Section heading==

<translate> Note the placement.</translate> <translate> This must be a "span" tag, not a "div".</translate> <translate> (Such anchors allow sections to be retitled without breaking incoming links.)</translate>

<div id="<translate nowrap> Unique anchor name 1</translate>"><translate> optional text</translate>

<span id="<translate nowrap> Unique anchor name 2</translate>"><translate> optional text</translate>

Section heading
<translate> Link to an anchor at another page</translate>
[[Help:Images#Supported media types for images]]
Help:Images
<translate> Link to the current page's talk page</translate>
[[{{TALKPAGENAME}}|Discussion]]

<translate> See also [[<tvar name=page-names>Special:MyLanguage/Help:Magic_words#Page_names</tvar>|Help:Magic words#Page names]]</translate>

Discussion
Template:Anchor<translate> Link to a subpage</translate>
[[/example]]

<translate> Shortcut for <tvar name=1>[[Help:Links/example|/example]]</tvar>.</translate> <translate> See also <tvar name=1>Template:Ll</tvar>.</translate>

/example
<translate> Link to a subpage without the leading slash</translate>
[[/example/]]

<translate> Shortcut for <tvar name=1>[[Help:Links/example|example]]</tvar>.</translate>

example
<translate> Link to a subpage of parent page for current page.</translate> <translate> Can only be used on subpages.</translate>
[[../example2]]

<translate> Shortcut for <tvar name=1>[[Help:Links/example2|example2]]</tvar> if you post the link on <tvar name=2>[[Help:Links/example|example]]</tvar> page.</translate>

example2
<translate> Visible link to a category page</translate>
[[:Category:Help]]

<translate> Without the leading colon the link would not be visible and the page would instead be placed into the category; this is a very common mistake.</translate> <translate> See also <tvar name=1>Template:Ll</tvar>.</translate>

Category:Help
<translate> Visible link to an image or media file</translate>

File:Example.jpg

file label

Media:Example.jpg

file label

<translate> Link to a page specific to each reader (user page, etc.)</translate>
[[Special:MyPage]]

[[Special:MyTalk]]

[[Special:Preferences]]

Special:MyPage

Special:MyTalk

Special:Preferences

<translate> Internal link to a specific revision</translate>
[[Special:PermanentLink/2393992]]

<translate> Revision numbers can be found in each page's [[<tvar name=h-hist>Special:MyLanguage/Help:History</tvar>|edit history]].</translate> <translate> (It is very common to see links to specific revisions implemented as external links because it's easy to cut-and-paste an entire URL to form an external link.)</translate>

Special:PermanentLink/2393992
<translate> Internal link to a "diff"</translate>
[[Special:Diff/2393992]]

[[Special:Diff/2390639/2393992]]

<translate> The default (in the first example above) is to show the changes from the previous revision.</translate> <translate> See also the comments in the previous item.</translate>

Special:Diff/2393992

Special:Diff/2390639/2393992

<translate> Redirect</translate>
#REDIRECT [[Main Page]]

<translate> Should be the first line on the page.</translate> <translate> See <tvar name=1>Template:Ll</tvar>.</translate>

 Main Page