Mediawiki cheatsheet: Difference between revisions
Line 10: | Line 10: | ||
<pre> | <pre> | ||
[[File:isbn_barcode.jpeg|150px|thumb|ISBN barcode]]</pre> | [[File:isbn_barcode.jpeg|150px|thumb|ISBN barcode]]</pre> | ||
1. The first part of the link is necessary to display the uploaded image, in this case the file named ''isbn_barcode.jpeg''. | 1. The first part of the link is necessary to display the uploaded image, in this case the file named ''isbn_barcode.jpeg''. |
Revision as of 14:55, 15 July 2020
Styling images
MediaWiki documentation on images
Images can be included and styled in many different ways. The example below is for an image that has the following settings:
[[File:isbn_barcode.jpeg|150px|thumb|ISBN barcode]]
breakdown
The settings above, separated by vertical bars (|), specify the settings that the image will be displayed under in read mode.
[[File:isbn_barcode.jpeg|150px|thumb|ISBN barcode]]
1. The first part of the link is necessary to display the uploaded image, in this case the file named isbn_barcode.jpeg.
2. 150px = the size the image will appear at on the page. Not necessary, but if not specified the image will appear at full size.
3. thumb = a thumbnail image. Also not necessary, but images will appear frameless by default unless otherwise specified. Other options include "framed" for a picture frame, and "frameless" for one without a frame.
4. ISBN barcode = a caption for the image. Not necessary, but handy for the reader.
Adding footnotes
MediaWiki documentation on the cite extension, which allows you to add footnotes
To allow footnotes to be cited on a page correctly, with automatically generated links that jump to them, use a bit of HTML, and the ref and references tags.
N.B: The full text you want to have displayed in the footnote should appear within the body of your text, enclosed in opening and closing tags like so:
Blah blah blah <ref>Text for the footnote here</ref> blah blah blah blah
Finally, add the
<references />
tag at the bottom of the section you are editing.
Blah blah blah <ref>Text for the footnote here</ref> blah blah blah blah. Yada yada yada <ref>My second footnote</ref> yada yada yada <references />
This will appear like so:
Blah blah blah [1] blah blah blah blah. Yada yada yada [2] yada yada yada
All references will be automatically numbered in sequential order as they appear on the page. The ref tags tell MediaWiki where footnotes should appear in the text, and the references tag tell it where to put the list of footnotes.
Making categories
https://www.mediawiki.org/wiki/Help:Categories
Categories are useful ways to produce tables of content based on automatically produced indices. To do this, use the Category namespace.
Add the name of the category to the following text (where Name is the name of the category):
[[Category:Name]]
For example, if you want to name a category "Tasks" this is how to add it:
e.g.
[[Category:Tasks]]
Usually this is added at the bottom of a page (in edit mode), but it can be placed anywhere and still work.
The first time this is added to a page, the link will appear in red (in read mode) at the bottom of a page, meaning that the page for this new category has not been made yet. Click the link, and create the page, where you can add a description of the category. After this, the link will appear in blue, and you can start adding other pages to the same category.
Transclusion
Mediawiki documentation on transcluding pages
If you want to have the same content included in more than one place on the wiki, transclusion is useful. This way you only have to edit the source page, and it will appear updated on any target page where it is transcluded. You can transclude a source page within target pages by adding the name of the page you want to transclude, enclosed in a pair of curly braces
{{source page name}}
e.g:
{{User:Simon/A note to the reader}}