This session will cover:
This session will be useful if:
You will need:
Wiki markup (or Wikitext) is one of many lightweight markup languages (LML) that prioritise human readability.
Here is a table demonstrating how Wiki Markup compares to HTML (from Wiki#Basic syntax):
As we begin, you may find it helpful to turn on syntax highlighting!
'''foo'''
''foo''
'''''foo'''''
{{strikethrough|foo}}
{{underline|foo}}
{{smallcaps|foo}}
To format a link, add the apostrophes around the parentheses: '''[[foo]]'''
If you do it the other way around, it will not work since the parentheses interpret the apostrophes as part of the page name.
<br>
, <br/>
, or {{
pb}}. But, use sparingly.* a * b ** c
produces:
# a # b ## c
produces:
[[foo]]
to link to an article|
) to insert a parameter which changes what the link says. For example:
[[Wikipedia:About]]
gives
Wikipedia:About[[Wikipedia:About|About page of Wikipedia]]
gives
About page of WikipediaLink images in the same way that you would link any other internal page. For example, [[File:Abacus 6.png]]
gives:
Extended syntax for an image looks something like this:
[[File:Name|Type|Border|Location|Alignment|Size|link=Link|alt=Alt|page=Page|lang=Langtag|Caption]]
Here, only File is technically necessary. Most images only require:
[[File:Name|thumb|alt=Alt|Caption]]
Here, thumb
stands in for the size
parameter.
Please: always insert alt text! Alt text describes visual content for users of screen readers and other visual-to-auditory assistive technologies. Rule of thumb: write out alt text as if you're describing the image to someone in another room.
:
two-letter language code :
article name to link directly to the other-language Wikipedia page
[[:fa:زرتشت]]
gives
fa:زرتشت. This is the Farsi page for
Zarathustra|
) to insert a parameter which changes what the link says
[[:fa:زرتشت|Zarathustra in Farsi]]
gives
Zarathustra in Farsi{{interlanguage link|INRS-Institut Armand-Frappier|fr}}
gives
INRS-Institut Armand-Frappier[[:wikt:toothbrush]]
gives
wikt:toothbrush[[:simple:toothbrush]]
gives
simple:toothbrush{{q|Q20155952}}
gives
Reasonator (Q20155952){{q|P197}}
gives
adjacent station (P197){{ill|Reasonator|wd=Q20155952}}
gives
Reasonator{{ill|Reasonator|wd=Q20155952|reasonator=1}}
gives
Reasonator{{ill|Reasonator|reasonator=1}}
gives
Reasonator
|wd=
is given, Reasonator will perform a search for the item. Note that this can be imprecise, and often requires
disambiguation.[foo]
to add an external, non-Wikimedia link
[[foo]]
) make those look much cleaner[https://insulin.library.utoronto.ca/]
just gives
[1][https://insulin.library.utoronto.ca/ Insulin Collection at the University of Toronto Libraries]
gives
Insulin Collection at the University of Toronto Libraries~
) to sign off on comments, add yourself to Wikiprojects, etc.
@Username
will not automatically ping the user.On talk pages, add a colon(:) to indent every time you reply within a thread. For example:
Hello world! ~~~~ :I see your comment. ~~~~ ::{{re|Utl_jung}} I, too, see your comment. ~~~~
produces:
Hello world! Utl jung ( talk) 17:13, 7 August 2020 (UTC)
Once there are too many indents, it can help to {{ outdent}} ({{ out}} for short) for better readability. For example:
[...] :::::The latest in a long thread of comments. ~~~~ {{out|:::::}}{{re|Utl_jung}} Let's reset the indents for readability. ~~~~
produces:
[...]
@ Utl jung: Let's reset the indents for readability. Utl jung ( talk) 17:13, 7 August 2020 (UTC)
When writing documentation, it can help to know a few templates and HTML snippets which make it easier to distinguish input from output.
<nowiki>...</nowiki>
to escape all contained Wiki markup<code>...</code>
to stylise contained text as code{{
tl}}
to write about a template without triggering the template itself
{{tl
+ |
+ template name + }}
{{tl|archival records}}
displays the link to, but does not trigger, {{
archival records}}To transclude any source page (within a single MediaWiki project, such as en:Wikipedia), use the following code in the target page:
{{SOURCEPAGE}}
Any time you write the code ({{SOURCEPAGE}}
) in a target page, you are telling Wikipedia software to put the entire content of SOURCEPAGE
in the target page.
In the example below, look at target page A and SOURCEPAGE
B.
If B is transcluded in A, Wikipedia software will include in that specific place not the code ({{B}}
) itself but the content of source page B (which is just the word foo).
The top row shows how target pages A, P, and Q will look with the changes in code seen in the bottom row to transclude source page B. Note the position of the code in each example target page.
The source page content, foo, will not be highlighted or boxed on the target page. (Foo is in a light blue box here for ease of illustration and understanding.)
Transclusion creates a "live" link between a source page and the target page(s) where the source page's contents appear. This means that when you edit a source page, you will be updating its content across all the target pages that include it. Let's say you create a source page in Wikipedia with the address, date, and time of a local Wikimedia event that you want to invite 50 local editors to. Next, you transclude the invitation source page onto your talk page as well as the talk pages of the other 50 editors. A week later you discover the place for the event must be moved. You would then update the source page, and the new address will automatically appear on all the other attendees' talk pages. You could also tell the editors to invite people you may have missed. They could then simply transclude the invitation source page into other editors' talk pages themselves.
Remember to be extremely careful about editing any source page, especially if it contains transclusions from other source pages. Breaking existing transclusions in a source page is called breakage. Please avoid breakage(s) because not only the larger source page you are editing and all the target pages that include it will be affected. So will both the already embedded (now broken) source page that was used to add content to the larger source page, as well as every target page where the embedded source page was transcluded.
Once comfortable with the basics of Wiki markup, I highly recommend that you reference these wonderful existing documentation pages to do more and more things with Wiki markup!
This session will cover:
This session will be useful if:
You will need:
Wiki markup (or Wikitext) is one of many lightweight markup languages (LML) that prioritise human readability.
Here is a table demonstrating how Wiki Markup compares to HTML (from Wiki#Basic syntax):
As we begin, you may find it helpful to turn on syntax highlighting!
'''foo'''
''foo''
'''''foo'''''
{{strikethrough|foo}}
{{underline|foo}}
{{smallcaps|foo}}
To format a link, add the apostrophes around the parentheses: '''[[foo]]'''
If you do it the other way around, it will not work since the parentheses interpret the apostrophes as part of the page name.
<br>
, <br/>
, or {{
pb}}. But, use sparingly.* a * b ** c
produces:
# a # b ## c
produces:
[[foo]]
to link to an article|
) to insert a parameter which changes what the link says. For example:
[[Wikipedia:About]]
gives
Wikipedia:About[[Wikipedia:About|About page of Wikipedia]]
gives
About page of WikipediaLink images in the same way that you would link any other internal page. For example, [[File:Abacus 6.png]]
gives:
Extended syntax for an image looks something like this:
[[File:Name|Type|Border|Location|Alignment|Size|link=Link|alt=Alt|page=Page|lang=Langtag|Caption]]
Here, only File is technically necessary. Most images only require:
[[File:Name|thumb|alt=Alt|Caption]]
Here, thumb
stands in for the size
parameter.
Please: always insert alt text! Alt text describes visual content for users of screen readers and other visual-to-auditory assistive technologies. Rule of thumb: write out alt text as if you're describing the image to someone in another room.
:
two-letter language code :
article name to link directly to the other-language Wikipedia page
[[:fa:زرتشت]]
gives
fa:زرتشت. This is the Farsi page for
Zarathustra|
) to insert a parameter which changes what the link says
[[:fa:زرتشت|Zarathustra in Farsi]]
gives
Zarathustra in Farsi{{interlanguage link|INRS-Institut Armand-Frappier|fr}}
gives
INRS-Institut Armand-Frappier[[:wikt:toothbrush]]
gives
wikt:toothbrush[[:simple:toothbrush]]
gives
simple:toothbrush{{q|Q20155952}}
gives
Reasonator (Q20155952){{q|P197}}
gives
adjacent station (P197){{ill|Reasonator|wd=Q20155952}}
gives
Reasonator{{ill|Reasonator|wd=Q20155952|reasonator=1}}
gives
Reasonator{{ill|Reasonator|reasonator=1}}
gives
Reasonator
|wd=
is given, Reasonator will perform a search for the item. Note that this can be imprecise, and often requires
disambiguation.[foo]
to add an external, non-Wikimedia link
[[foo]]
) make those look much cleaner[https://insulin.library.utoronto.ca/]
just gives
[1][https://insulin.library.utoronto.ca/ Insulin Collection at the University of Toronto Libraries]
gives
Insulin Collection at the University of Toronto Libraries~
) to sign off on comments, add yourself to Wikiprojects, etc.
@Username
will not automatically ping the user.On talk pages, add a colon(:) to indent every time you reply within a thread. For example:
Hello world! ~~~~ :I see your comment. ~~~~ ::{{re|Utl_jung}} I, too, see your comment. ~~~~
produces:
Hello world! Utl jung ( talk) 17:13, 7 August 2020 (UTC)
Once there are too many indents, it can help to {{ outdent}} ({{ out}} for short) for better readability. For example:
[...] :::::The latest in a long thread of comments. ~~~~ {{out|:::::}}{{re|Utl_jung}} Let's reset the indents for readability. ~~~~
produces:
[...]
@ Utl jung: Let's reset the indents for readability. Utl jung ( talk) 17:13, 7 August 2020 (UTC)
When writing documentation, it can help to know a few templates and HTML snippets which make it easier to distinguish input from output.
<nowiki>...</nowiki>
to escape all contained Wiki markup<code>...</code>
to stylise contained text as code{{
tl}}
to write about a template without triggering the template itself
{{tl
+ |
+ template name + }}
{{tl|archival records}}
displays the link to, but does not trigger, {{
archival records}}To transclude any source page (within a single MediaWiki project, such as en:Wikipedia), use the following code in the target page:
{{SOURCEPAGE}}
Any time you write the code ({{SOURCEPAGE}}
) in a target page, you are telling Wikipedia software to put the entire content of SOURCEPAGE
in the target page.
In the example below, look at target page A and SOURCEPAGE
B.
If B is transcluded in A, Wikipedia software will include in that specific place not the code ({{B}}
) itself but the content of source page B (which is just the word foo).
The top row shows how target pages A, P, and Q will look with the changes in code seen in the bottom row to transclude source page B. Note the position of the code in each example target page.
The source page content, foo, will not be highlighted or boxed on the target page. (Foo is in a light blue box here for ease of illustration and understanding.)
Transclusion creates a "live" link between a source page and the target page(s) where the source page's contents appear. This means that when you edit a source page, you will be updating its content across all the target pages that include it. Let's say you create a source page in Wikipedia with the address, date, and time of a local Wikimedia event that you want to invite 50 local editors to. Next, you transclude the invitation source page onto your talk page as well as the talk pages of the other 50 editors. A week later you discover the place for the event must be moved. You would then update the source page, and the new address will automatically appear on all the other attendees' talk pages. You could also tell the editors to invite people you may have missed. They could then simply transclude the invitation source page into other editors' talk pages themselves.
Remember to be extremely careful about editing any source page, especially if it contains transclusions from other source pages. Breaking existing transclusions in a source page is called breakage. Please avoid breakage(s) because not only the larger source page you are editing and all the target pages that include it will be affected. So will both the already embedded (now broken) source page that was used to add content to the larger source page, as well as every target page where the embedded source page was transcluded.
Once comfortable with the basics of Wiki markup, I highly recommend that you reference these wonderful existing documentation pages to do more and more things with Wiki markup!