Help:Contributing/links: Difference between revisions
Automatic section anchors for math headings; explicit {{anchor}} remains the override (via update-page on MediaWiki MCP Server) |
Document the smart mention rendering and the bare Copy internal mention snippet (via update-page on MediaWiki MCP Server) |
||
| Line 44: | Line 44: | ||
A piped link with an empty label shows an abbreviated title — the namespace is dropped: <syntaxhighlight lang="text" inline>[[Item:Q162|]]</syntaxhighlight> shows [[Item:Q162|Q162]]. | A piped link with an empty label shows an abbreviated title — the namespace is dropped: <syntaxhighlight lang="text" inline>[[Item:Q162|]]</syntaxhighlight> shows [[Item:Q162|Q162]]. | ||
=== Classic per-kind pages === | |||
The five classic per-kind namespaces are shortened automatically for an '''unpiped''' link: <code>Person:</code>, <code>Collective:</code>, <code>Source:</code>, <code>FOSS:</code> and <code>Software:</code>. The namespace prefix is dropped, and a <code>Source:</code> link is additionally italic: | |||
{| class="wikitable" style="width:100%" | |||
! What you type !! What you get | |||
|- | |||
| <syntaxhighlight lang="text" inline>[[Person:Edwin Hubble]]</syntaxhighlight> | |||
| [[Person:Edwin Hubble]] | |||
|- | |||
| <syntaxhighlight lang="text" inline>[[Collective:Club of Rome]]</syntaxhighlight> | |||
| [[Collective:Club of Rome]] | |||
|- | |||
| <syntaxhighlight lang="text" inline>[[Source:Beloved]]</syntaxhighlight> | |||
| [[Source:Beloved]] | |||
|} | |||
A pipe still controls the display text: <syntaxhighlight lang="text" inline>[[Person:Edwin Hubble|Hubble]]</syntaxhighlight> shows [[Person:Edwin Hubble|Hubble]]. The '''Copy internal mention''' button on those pages copies the bare <syntaxhighlight lang="text" inline>[[Person:Edwin Hubble]]</syntaxhighlight> (no pipe), so the renderer supplies the caption. | |||
To make one title an alias of another, put <syntaxhighlight lang="text" inline>#REDIRECT [[Main Page]]</syntaxhighlight> as the first line of the page — it then redirects to the target. See [https://www.mediawiki.org/wiki/Help:Redirects Help:Redirects] (official). | To make one title an alias of another, put <syntaxhighlight lang="text" inline>#REDIRECT [[Main Page]]</syntaxhighlight> as the first line of the page — it then redirects to the target. See [https://www.mediawiki.org/wiki/Help:Redirects Help:Redirects] (official). | ||
Revision as of 15:27, 3 November 2026
Links connect the pages of this wiki to each other and to the outside world. This page covers the link syntax you will use day to day: internal links, links to sections, external links and interwiki shortcuts.
Internal links
A wikilink points to another page on this wiki. Write the page title inside double square brackets.
| What you want | What you type | What you get |
|---|---|---|
| Link to a page | [[Main Page]]
|
Main Page |
| Link with your own label — the part after the pipe is shown | [[Help:Contributing|the contributor hub]]
|
the contributor hub |
| Link to an item — entity pages are ordinary pages here | [[Item:Q162|Blue Marble (photograph)]]
|
Blue Marble (photograph) |
| Link to a property | [[Property:P1|instance of]]
|
instance of |
| Link to a page that does not exist — a red link | [[My new page]]
|
My new page |
Following a red link opens the editor for that page: a red link is an invitation to create the page.
The first letter of the target is not case-sensitive —
[[main Page]]and[[Main Page]]are the same link. Every later letter must match the page title exactly:[[Item:q162]]is a red link, not the item. Spaces in a title are interchangeable with underscores.
Linking to the page you are editing renders as bold text, not as a link.
Prefer an internal link whenever the target lives on this wiki. A red link invites someone to create the page; an external link to the same page does not.
A piped link with an empty label shows an abbreviated title — the namespace is dropped: [[Item:Q162|]] shows Q162.
Classic per-kind pages
The five classic per-kind namespaces are shortened automatically for an unpiped link: Person:, Collective:, Source:, FOSS: and Software:. The namespace prefix is dropped, and a Source: link is additionally italic:
| What you type | What you get |
|---|---|
[[Person:Edwin Hubble]]
|
Edwin Hubble |
[[Collective:Club of Rome]]
|
Club of Rome |
[[Source:Beloved]]
|
Beloved |
A pipe still controls the display text: [[Person:Edwin Hubble|Hubble]] shows Hubble. The Copy internal mention button on those pages copies the bare [[Person:Edwin Hubble]] (no pipe), so the renderer supplies the caption.
To make one title an alias of another, put #REDIRECT [[Main Page]] as the first line of the page — it then redirects to the target. See Help:Redirects (official).
Links to sections
Every heading is an automatic anchor, so a link can point straight at a section.
| What you want | What you type | What you get |
|---|---|---|
| A section on another page | [[Help:Contributing/code#House rules|house rules]]
|
house rules |
| A section on the same page | [[#See also|jump to the end]]
|
jump to the end |
| The top of the page | [[#top|back to top]]
|
back to top |
The anchor is the heading text as written: if the heading is renamed, links to that section break.
Automatic anchors
A heading that mixes text and math stays linkable: the $…$ math is dropped from the anchor, and a heading that is only math keeps it (normalised, so the characters that cannot appear in a fragment — # < > [ ] | { } — become _).
| Heading | Link |
|---|---|
=== Symmetric groups $\mathcal{S}_{n}$ ===
|
[[Page#Symmetric_groups]]
|
=== $\operatorname{sign}(\sigma)$ ===
|
the normalised math is kept |
The section's [Copy internal mention] and [Copy URL] use the automatic anchor.
Explicit anchors
For a different, readable anchor — especially for a math-only or long heading — put {{anchor|Name}} at the start of the heading. It wins over the automatic one:
=== {{anchor|sign composition}} $\operatorname{sign}(\sigma_1 \circ \sigma_2)$ ===
Now [[Permutation#sign composition]] works. See Template:Anchor for the template's rules.
Section controls
Every heading also carries four controls next to its [edit] link, each in its own pair of brackets — just like [edit]. They appear on every classic page (article namespaces, Help:, and the Source:/Person:/Collective:/FOSS:/Software: pages), not only on content pages:
[Copy internal mention]copies[[Page title#section|(without the closing brackets — type your own display text after the final pipe);[Copy URL]copies the section's absolute web address;[Add section below]opens the editor targeting that section, inserting your content at its end;[Delete section]opens a confirmation page that shows the section, then removes the whole section (heading and any subsections) when you confirm.
The editor behind the page-wide Add section action and [Add section below] is the ordinary Edit page — the same wikitext toolbar, with Show preview and Show changes — and just one difference: it has no This is a minor edit checkbox. It appends your content instead of replacing the page. Leave the Summary blank and it is filled in from the first heading of your content (the section-edit convention: a == Vandermonde == heading gives /* Vandermonde */).
Subpages
A / in a title creates a hierarchy. Matrix/Practice/Matrix_multiplication is a subpage of Matrix/Practice, itself a subpage of Matrix; the child shows a breadcrumb back to the parent. Subpages are enabled in every namespace, including the main one. Create the parent page first — the breadcrumb only links ancestors that exist.
External links
External links point to other websites. The URL comes first, the label after, inside single square brackets.
| What you want | What you type | What you get |
|---|---|---|
| Labelled link | [https://www.mediawiki.org MediaWiki]
|
MediaWiki |
| Bare URL — linked automatically, no brackets needed | https://www.mediawiki.org
|
https://www.mediawiki.org |
| No label — numbered automatically | [https://www.mediawiki.org]
|
[1] |
The URL and its label must stay on one line: a line break inside the brackets breaks the link, and the
[shows up literally.
External links carry a small arrow icon to show they leave this wiki.
Interwiki links
Interwiki links are shortcuts to other wikis, written like internal links with a prefix. This wiki comes with the standard prefixes: wikipedia, wikidata, commons, mw, and more.
| What you want | What you type | What you get |
|---|---|---|
| A Wikipedia article | [[wikipedia:Sunflower|sunflower]]
|
sunflower |
| A Wikidata item | [[wikidata:Q42|Q42]]
|
Q42 |
| A MediaWiki help page | [[mw:Help:Links|MediaWiki help]]
|
MediaWiki help |
Remote pages always render blue — interwiki links do not check whether the target page exists on the other wiki. The full list of prefixes is on Special:Interwiki.
The language versions of this wiki's pages are linked with the
{{Languages}}bar, not interlanguage markup — see Languages and translation.
Files and categories
A leading colon makes a file or category link visible as text instead of performing its action.
| What you want | What you type | What you get |
|---|---|---|
| A text link to a file page | [[:File:Example.png|Example.png]]
|
Example.png |
| A text link to a category | [[:Category:HowItWorks]]
|
Category:HowItWorks |
Without the colon,
[[File:…]]embeds the file and[[Category:…]]is treated as a plain page under theCategorynamespace.
Embedding images and media is covered in Help:Contributing/richMediaContent.
Markdown syntax does not work with wikis
- Internal links is:
[[Page title]], not[text](url). - External links is
[https://example.com label], not[label](https://example.com).
See also
- Help:Links (MediaWiki official) — the complete link reference
- Help:Redirects (MediaWiki official)
- Help:Piped link (MediaWiki official)
- Code blocks and syntax highlighting
- Items and properties
- Help:Contributing — the contributor hub