Help:Contributing/links: Difference between revisions
Append editor is now the built-in Edit page (Show preview / Show changes, no minor-edit); controls on every classic page (via update-page on MediaWiki MCP Server) |
Document explicit anchors and Main-namespace subpages (via update-page on MediaWiki MCP Server) |
||
| Line 70: | Line 70: | ||
The anchor is the heading text as written: if the heading is renamed, links to that section break. | The anchor is the heading text as written: if the heading is renamed, links to that section break. | ||
</blockquote> | </blockquote> | ||
=== Explicit anchors === | |||
A heading containing math or any of <code># < > [ ] | { }</code> cannot be linked to directly — those characters are not valid in a fragment. Put <code>{{anchor|Name}}</code> at the start of the heading: | |||
<syntaxhighlight lang="text" inline>=== {{anchor|sign composition}} $\operatorname{sign}(\sigma_1 \circ \sigma_2)$ ===</syntaxhighlight> | |||
Now <code>[[Permutation#sign composition]]</code> works. The section's <code>[Copy internal mention]</code> and <code>[Copy URL]</code> use that anchor (rendered as <code>sign_composition</code>) instead of the generated heading id. See [[Template:Anchor]] for the template's rules. | |||
Every heading also carries four controls next to its <code>[edit]</code> link, each in its own pair of brackets — just like <code>[edit]</code>. They appear on every classic page (article namespaces, <code>Help:</code>, and the <code>Source:</code>/<code>Person:</code>/<code>Collective:</code>/<code>FOSS:</code>/<code>Software:</code> pages), not only on content pages: | Every heading also carries four controls next to its <code>[edit]</code> link, each in its own pair of brackets — just like <code>[edit]</code>. They appear on every classic page (article namespaces, <code>Help:</code>, and the <code>Source:</code>/<code>Person:</code>/<code>Collective:</code>/<code>FOSS:</code>/<code>Software:</code> pages), not only on content pages: | ||
| Line 78: | Line 86: | ||
* <code>[Delete section]</code> opens a confirmation page that shows the section, then removes the whole section (heading and any subsections) when you confirm. | * <code>[Delete section]</code> opens a confirmation page that shows the section, then removes the whole section (heading and any subsections) when you confirm. | ||
The editor behind the <code>Add section</code> | The editor behind the page-wide <code>Add section</code> action and <code>[Add section below]</code> '''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 <code>== Vandermonde ==</code> heading gives <code>/* Vandermonde */</code>). | ||
== Subpages == | |||
A <code>/</code> in a title creates a hierarchy. <code>Matrix/Practice/Matrix_multiplication</code> is a subpage of <code>Matrix/Practice</code>, itself a subpage of <code>Matrix</code>; 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 == | ||
Revision as of 18:00, 18 October 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.
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.
Explicit anchors
A heading containing math or any of # < > [ ] | { } cannot be linked to directly — those characters are not valid in a fragment. Put at the start of the heading:
=== {{anchor|sign composition}} $\operatorname{sign}(\sigma_1 \circ \sigma_2)$ ===
Now Permutation#sign composition works. The section's [Copy internal mention] and [Copy URL] use that anchor (rendered as sign_composition) instead of the generated heading id. See Template:Anchor for the template's rules.
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