Difference between revisions of "User:Evon R'al/Wiki coding notes"
m (→Special cases: Add missing >) |
m (More notes on linking.) |
||
Line 42: | Line 42: | ||
=== Linking === | === Linking === | ||
− | + | See also: [[mediawikiwiki:Help:Links]] | |
− | + | ==== Piped link ==== | |
− | + | A piped link is an internal or [[#interwiki|interwiki]] link where the link target and link label are both specified. | |
− | |||
− | |||
− | |||
− | Internal | + | ==== Internal ==== |
+ | Internal (or intrawiki) links check the existence of the target page. If the page doesn't exist, is misspelled or the case is incorrect the link turns [[redlink|red]]. | ||
+ | |||
+ | '''Syntax:''' <code><nowiki>[[<namespace>:<page name>#<anchor>|<label>]]</nowiki></code> | ||
+ | :; Namespace : The namespace of the page, separated from the Page name by a colon(:). Default is the main namespace. Options: User, Template, etc. Namespace is NOT case sensitive. | ||
+ | :; Page name : The name of the page<ref name="main">In the main namespace called article</ref>. Page name is case sensitive with the exception of the first letter. | ||
+ | :; Anchor : To an ID somewhere inside a page. Anchor must be preceded by a #. Headings have an automatic ID identical to the header name. ID can be added manually by using {{T|Anchor}} or adding an <code>ID=</code> manually. ID's must be unique. Anchor's are case sensitive. | ||
+ | :; Label : The text that appears visible. Only needed when different from the linking(target) part. the label is preceded by the pipe(|) symbol | ||
'''Usage:''' | '''Usage:''' | ||
− | ; Page name only : Using the page name only links to a page<ref name="main" /> in the main namespace with display identical to page name:<br> | + | :; Page name only : Using the page name only links to a page<ref name="main" /> in the main namespace with display identical to page name:<br> |
− | <nowiki>[[Venture]]</nowiki> results in [[Venture]]<br> | + | <code><nowiki>[[Venture]]</nowiki></code> results in [[Venture]]<br> |
− | As the first letter is not case sensitive <nowiki>[[venture]]</nowiki> also results in a valid link [[venture]] | + | As the first letter is not case sensitive <code><nowiki>[[venture]]</nowiki></code> also results in a valid link [[venture]] |
+ | |||
+ | {{Note box|'''Link end "trick"''' (Word-ending links) | ||
+ | Putting text directly connecting to the closing ]] results in that text being added to the displayed text.<br> | ||
+ | <code><nowiki>[[Venture]]s</nowiki></code> results in [[Venture]]s while the link still goes to Venture.<br> | ||
+ | <code><nowiki>[[Venture]]abunchofletters</nowiki></code> results in [[Venture]]abunchofletters while the link still goes to Venture. | ||
− | + | For more details see: [[mediawikiwiki:Help:Links]] | |
− | + | |italics= no}} | |
− | |||
− | ; Namespace and Page name | + | :; Namespace and Page name : To go to a page outside the main namespace the namespace needs to be added to the link |
− | : To go to a page outside the main namespace the namespace needs to be added to the link | + | <code><nowiki>[[User:Evon R'al]]</nowiki></code> gives [[User:Evon R'al]]<br> |
− | <nowiki>[[User:Evon R'al]]</nowiki> gives [[User:Evon R'al]]<br> | + | <code><nowiki>[[UniWiki:Manual of Style]]</nowiki></code> gives [[UniWiki:Manual of Style]] |
− | <nowiki>[[UniWiki:Manual of Style]]</nowiki> gives [[UniWiki:Manual of Style]] | ||
− | ; Page name and Anchor : Using a Page name and an Anchor gets to a specific location within a page. | + | :; Page name and Anchor : Using a Page name and an Anchor gets to a specific location within a page. |
− | : Using an Anchor only, leads to a specific location within the page. | + | :: Using an Anchor only, leads to a specific location within the page. |
− | <nowiki>[[combat sites#Expeditions]]</nowiki> gives [[combat sites#Expeditions]]<br> | + | <code><nowiki>[[combat sites#Expeditions]]</nowiki></code> gives [[combat sites#Expeditions]]<br> |
The existence of the page is still checked, but the existence of the anchor is not.<br> | The existence of the page is still checked, but the existence of the anchor is not.<br> | ||
Note: If a non existing anchor is used the link goes to the top of the page.<br> | Note: If a non existing anchor is used the link goes to the top of the page.<br> | ||
− | <nowiki>[[combat sites#no exist]]</nowiki> gives [[combat sites#no exist]], leading ot the top of the combat sites page | + | <code><nowiki>[[combat sites#no exist]]</nowiki></code> gives [[combat sites#no exist]], leading ot the top of the combat sites page |
+ | |||
+ | <code><nowiki>[[#Signatures]]</nowiki></code> gives [[#Signatures]] leading to the Signatures heading on this page. | ||
+ | |||
+ | :; Page name and label | ||
+ | <code><nowiki>[[Venture|Venture]]</nowiki></code> results in [[Venture|Venture]]. More then double the amount of typing for the same result as when using a page name only link and more cluttered reading in the source.<br> | ||
+ | But when doing this: <code>Example of a <nowiki>[[Venture|mining]]</nowiki> frigate</code>, we get "Example of a [[Venture|mining]] frigate" leading to the Venture article. | ||
+ | |||
+ | The use of label is particularly useful when namespaces or anchors are used. To increase readability.<br> | ||
+ | <code><nowiki>[[User:Evon R'al|Evon R'al]]</nowiki>'s user page</code> gives [[User:Evon R'al|Evon R'al]]'s user page<br> | ||
+ | <code>A link to <nowiki>[[combat sites#Expeditions|Expeditions]]</nowiki></code> gives "A link to [[combat sites#Expeditions|Expeditions]]". | ||
+ | {{Note|While not particularly useful the link end trick will work.}} | ||
+ | |||
+ | {{Note box|'''Pipe trick''': | ||
− | < | + | The pipe trick uses the pipe character ("{{!}}") to save typing the label of a piped link for several kinds of wiki links. This can avoid potentially making an error while typing the label.<br> |
+ | The basic rule when the pipe trick is used is that an (initial) namespace prefix, a final part beginning with a comma, or a final parenthesis is suppressed in the rendering of the link.<br> | ||
+ | The expansion of the text happens when saving. The expansion is also visible when previewing the edit making it possible to check if it gives the desired result. | ||
− | + | Example's: | |
− | |||
− | |||
− | + | Typing <code><nowiki>[[User:Evon R'al|]]</nowiki></code> will produce <nowiki>[[User:Evon R'al|Evon R'al]]</nowiki>.<br> | |
− | <nowiki>[[User:Evon R'al| | + | <code><nowiki>[[Guardian's Gala (2020)|]]</nowiki></code> gives <nowiki>[[Guardian's Gala (2020)|Guardian's Gala]]</nowiki> |
− | |||
+ | For more details see [[wikipedia:Help:Pipe trick]] and [[metawikipedia:Help:Piped link]] | ||
+ | |italics= no}} | ||
===== Special cases ===== | ===== Special cases ===== | ||
; File namespace | ; File namespace | ||
− | <nowiki>[[File:Helpicon.png]]</nowiki> gives [[File:Helpicon.png]] the file embedded at the location of the link.<br> | + | <code><nowiki>[[File:Helpicon.png]]</nowiki></code> gives [[File:Helpicon.png]] the file embedded at the location of the link.<br> |
To get a link to the file page the namespace needs to be preceded by a colon (:)<br> | To get a link to the file page the namespace needs to be preceded by a colon (:)<br> | ||
− | <nowiki>[[:File:Helpicon.png]]</nowiki> gives [[:File:Helpicon.png]] a link to the file page.<br> | + | <code><nowiki>[[:File:Helpicon.png]]</nowiki></code> gives [[:File:Helpicon.png]] a link to the file page.<br> |
− | <nowiki>[[:File:Evon R'al.jpg]]</nowiki> gives [[:File:Evon R'al.jpg]]<br> | + | <code><nowiki>[[:File:Evon R'al.jpg]]</nowiki></code> gives [[:File:Evon R'al.jpg]]<br> |
− | + | A label can be used like <code><nowiki>[[:File:Evon R'al.jpg|Evon R'al]]</nowiki></code> to change the presentation: The file page of [[:File:Evon R'al.jpg|Evon R'al]]'s portrait.<br> | |
− | For parameters to influence size and placement of a file see [[Mediawikiwiki:Help:Images]] | + | For parameters to influence size and/or placement of a file see [[Mediawikiwiki:Help:Images]] |
; Media namespace : Is a virtual namespace which gives a direct link to a file. | ; Media namespace : Is a virtual namespace which gives a direct link to a file. | ||
− | <nowiki>[[Media:Evon R'al.jpg]]</nowiki> gives [[Media:Evon R'al.jpg]]<br> | + | <code><nowiki>[[Media:Evon R'al.jpg]]</nowiki></code> gives [[Media:Evon R'al.jpg]] (follow the link to see the difference)<br> |
− | + | A label can be used: <code><nowiki>[[Media:Evon R'al.jpg|portrait]]</nowiki></code> to get Evon R'al's [[Media:Evon R'al.jpg|portrait]]. | |
; Category namespace | ; Category namespace | ||
− | <nowiki>[[Category:Pilots]]</nowiki> gives a link to the Category category and the | + | <code><nowiki>[[Category:Pilots]]</nowiki></code> gives a link to the Category category and the Pilots category in a separate box at the bottom of the page.<br> |
− | To get a link to the Pilots category in the text use <nowiki>[[:Category:Pilots]]</nowiki> which gives [[:Category:Pilots]] | + | To get a link to the Pilots category in the text use <code><nowiki>[[:Category:Pilots]]</nowiki></code> which gives [[:Category:Pilots]] |
+ | |||
+ | * [https://wiki.eveuniversity.org/api.php?action=query&meta=siteinfo&siprop=namespaces&format=xml List of namespaces (In raw XML)] | ||
+ | |||
+ | ==== Interwiki ==== | ||
+ | Interwiki links are internal-style links to other websites using an "interwiki prefix". For a list of valid interwiki prefixes see [[Special:interwiki]]. | ||
+ | |||
+ | Interwiki links are made by using the interwiki prefix as the first parameter in an internal link. | ||
+ | |||
+ | A intrawiki link to MediaWiki's help page about links looks like <code><nowiki>[[Mediawikiwiki:Help:Links]]</nowiki></code> which gives [[Mediawikiwiki:Help:Links]] | ||
+ | |||
+ | The link end and pipe tricks described at internal links work for interwiki links just as-well. | ||
+ | |||
+ | ==== External ==== | ||
+ | External links are rendered different from internal and interwiki links. On the UNI Wiki the links have a marker at the end. The exact marker depends on if the link is HTTP of HTTPS. | ||
+ | |||
+ | The most basic form for an external link is to just put in the raw link, like <code><nowiki>https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al</nowiki></code> which produces https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al. While it works as a link it does not look particularly nice. | ||
+ | |||
+ | More control over the link can be reached by using single square braces.<br> | ||
+ | '''Syntax:''' <code>[URL label]</code> | ||
+ | ; URL : the full URL of the link | ||
+ | ; label : the text visible in the page (optional) | ||
+ | The wiki parser uses the first space it encounters as the divider between the URL and the label. | ||
+ | |||
+ | * Without using a label <code><nowiki>[https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al]</nowiki></code> produces [https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al]. The wiki parser automatically adds a number as the label. | ||
− | + | * Using a label <code><nowiki>[https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al Evon R'al's user page]</nowiki></code> produces [https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al Evon R'al's user page]. | |
− | [https://wiki.eveuniversity.org/ | + | * Finally the external link rendering can be suppressed by using the CSS class {{Co|wheat|plainlinks}} making the link look like an internal one. <code><nowiki><span class="plainlinks">[https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al Evon R'al's user page]</span></nowiki></code> produces <span class="plainlinks">[https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al Evon R'al's user page]</span> |
=== MessageBox with logo === | === MessageBox with logo === |
Revision as of 14:18, 5 February 2022
Notes
Signatures
Usage: --<Signature>
Description | Markup | Result |
---|---|---|
Signature plus timestamp | ~~~~ | Evon R'al (talk) 16:54, 7 December 2021 (UTC) |
Signature alone | ~~~ | Evon R'al (talk) |
Timestamp alone | ~~~~~ | 16:54, 7 December 2021 (UTC) |
Futher reading:
Code snippets
Small stuf
No more mineable asteroids in missons:
Various mission site locations have had mineable asteroids replaced with cosmetic asteroids. (30/03/2020) <ref>https://www.eveonline.com/news/view/patch-notes-for-march-2020-release 30/03/2020</ref> |
Various mission site locations have had mineable asteroids replaced with cosmetic asteroids. (30/03/2020)[1]
{{Hatnote}} to link back to multi level/faction disambiguation pages:
{{hatnote|This article details the Level ?, <Faction> version of this mission. For other variants, see [[<Mission>|<Mission> (disambiguation)]].}} |
Linking
See also: mediawikiwiki:Help:Links
Piped link
A piped link is an internal or interwiki link where the link target and link label are both specified.
Internal
Internal (or intrawiki) links check the existence of the target page. If the page doesn't exist, is misspelled or the case is incorrect the link turns red.
Syntax: [[<namespace>:<page name>#<anchor>|<label>]]
- Namespace
- The namespace of the page, separated from the Page name by a colon(:). Default is the main namespace. Options: User, Template, etc. Namespace is NOT case sensitive.
- Page name
- The name of the page[2]. Page name is case sensitive with the exception of the first letter.
- Anchor
- To an ID somewhere inside a page. Anchor must be preceded by a #. Headings have an automatic ID identical to the header name. ID can be added manually by using {{Anchor}} or adding an
ID=
manually. ID's must be unique. Anchor's are case sensitive. - Label
- The text that appears visible. Only needed when different from the linking(target) part. the label is preceded by the pipe(|) symbol
Usage:
- Page name only
- Using the page name only links to a page[2] in the main namespace with display identical to page name:
[[Venture]]
results in Venture
As the first letter is not case sensitive [[venture]]
also results in a valid link venture
- Namespace and Page name
- To go to a page outside the main namespace the namespace needs to be added to the link
[[User:Evon R'al]]
gives User:Evon R'al
[[UniWiki:Manual of Style]]
gives UniWiki:Manual of Style
- Page name and Anchor
- Using a Page name and an Anchor gets to a specific location within a page.
- Using an Anchor only, leads to a specific location within the page.
[[combat sites#Expeditions]]
gives combat sites#Expeditions
The existence of the page is still checked, but the existence of the anchor is not.
Note: If a non existing anchor is used the link goes to the top of the page.
[[combat sites#no exist]]
gives combat sites#no exist, leading ot the top of the combat sites page
[[#Signatures]]
gives #Signatures leading to the Signatures heading on this page.
- Page name and label
[[Venture|Venture]]
results in Venture. More then double the amount of typing for the same result as when using a page name only link and more cluttered reading in the source.
But when doing this: Example of a [[Venture|mining]] frigate
, we get "Example of a mining frigate" leading to the Venture article.
The use of label is particularly useful when namespaces or anchors are used. To increase readability.
[[User:Evon R'al|Evon R'al]]'s user page
gives Evon R'al's user page
A link to [[combat sites#Expeditions|Expeditions]]
gives "A link to Expeditions".
Note: | While not particularly useful the link end trick will work. |
Special cases
- File namespace
[[File:Helpicon.png]]
gives the file embedded at the location of the link.
To get a link to the file page the namespace needs to be preceded by a colon (:)
[[:File:Helpicon.png]]
gives File:Helpicon.png a link to the file page.
[[:File:Evon R'al.jpg]]
gives File:Evon R'al.jpg
A label can be used like [[:File:Evon R'al.jpg|Evon R'al]]
to change the presentation: The file page of Evon R'al's portrait.
For parameters to influence size and/or placement of a file see Mediawikiwiki:Help:Images
- Media namespace
- Is a virtual namespace which gives a direct link to a file.
[[Media:Evon R'al.jpg]]
gives Media:Evon R'al.jpg (follow the link to see the difference)
A label can be used: [[Media:Evon R'al.jpg|portrait]]
to get Evon R'al's portrait.
- Category namespace
[[Category:Pilots]]
gives a link to the Category category and the Pilots category in a separate box at the bottom of the page.
To get a link to the Pilots category in the text use [[:Category:Pilots]]
which gives Category:Pilots
Interwiki
Interwiki links are internal-style links to other websites using an "interwiki prefix". For a list of valid interwiki prefixes see Special:interwiki.
Interwiki links are made by using the interwiki prefix as the first parameter in an internal link.
A intrawiki link to MediaWiki's help page about links looks like [[Mediawikiwiki:Help:Links]]
which gives Mediawikiwiki:Help:Links
The link end and pipe tricks described at internal links work for interwiki links just as-well.
External
External links are rendered different from internal and interwiki links. On the UNI Wiki the links have a marker at the end. The exact marker depends on if the link is HTTP of HTTPS.
The most basic form for an external link is to just put in the raw link, like https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al
which produces https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al. While it works as a link it does not look particularly nice.
More control over the link can be reached by using single square braces.
Syntax: [URL label]
- URL
- the full URL of the link
- label
- the text visible in the page (optional)
The wiki parser uses the first space it encounters as the divider between the URL and the label.
- Without using a label
[https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al]
produces [1]. The wiki parser automatically adds a number as the label.
- Using a label
[https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al Evon R'al's user page]
produces Evon R'al's user page.
- Finally the external link rendering can be suppressed by using the CSS class plainlinks making the link look like an internal one.
<span class="plainlinks">[https://wiki.eveuniversity.org/index.php?title=User:Evon_R%27al Evon R'al's user page]</span>
produces Evon R'al's user page
MessageBox with logo
Some possible logo's
{{MessageBox |On activating gate: [[File:Logo ded.png|35px|bottom|link=|alt= DED logo]] Database Information |Text |collapsed= yes }} |
On activating gate: Database Information |
---|
Text |
Some table stuff
HTML table with border="1"
Amarr, Blood Raider, Sansha, CONCORD | Helium isotopes |
Caldari, Gurista | Nitrogen isotopes |
Gallente, ORE, Serpentis | Oxygen isotopes |
Minmatar | Hydrogen isotopes |
Wiki markup table
Faction | Isotope type |
---|---|
Amarr, Blood Raider, Sansha, CONCORD | Helium |
Caldari, Gurista | Nitrogen |
Gallente, ORE, Serpentis | Oxygen |
Minmatar | Hydrogen |
Wiki markup table with class="wikitable"
Faction | Isotope type |
---|---|
Amarr, Blood Raider, Sansha, CONCORD | Helium |
Caldari, Gurista | Nitrogen |
Gallente, ORE, Serpentis | Oxygen |
Minmatar | Hydrogen |
Wiki markup table with class="sortable"
Faction | Isotope type |
---|---|
Amarr, Blood Raider, Sansha, CONCORD | Helium |
Caldari, Gurista | Nitrogen |
Gallente, ORE, Serpentis | Oxygen |
Minmatar | Hydrogen |
Wiki markup table with class="collapsible"
Faction | Isotope type |
---|---|
Amarr, Blood Raider, Sansha, CONCORD | Helium |
Caldari, Gurista | Nitrogen |
Gallente, ORE, Serpentis | Oxygen |
Minmatar | Hydrogen |
Wiki markup table with class="collapsible collapsed"
Faction | Isotope type |
---|---|
Amarr, Blood Raider, Sansha, CONCORD | Helium |
Caldari, Gurista | Nitrogen |
Gallente, ORE, Serpentis | Oxygen |
Minmatar | Hydrogen |
Collapsible div
Found in {{SkillQueue}}
Key: Classes mw-collapsible, mw-collapased and mw-collapsible-content
<div class="mw-collapsible" style="border: 2px solid white; padding: 0.5em;"> Content of outer div. <div class="mw-collapsible-content"> Content of inner div. </div> </div>
Results in:
Content of outer div.
Content of inner div.
References
- ^ https://www.eveonline.com/news/view/patch-notes-for-march-2020-release 30/03/2020
- ^ a b In the main namespace called article