Help:Markup reference

From Camera-wiki.org
Revision as of 02:58, 16 April 2011 by Zuleika (talk | contribs) (Categories)
Jump to: navigation, search

This may eventually grow into something worth moving into a new “Help:” ... but it has a hell of a long way to go first.

This page explains the technical aspects of writing articles. This primarily involves special markup for Mediawiki, the software behind not only Camera-wiki.org but also Wikipedia (for which it was created) and many other wikis. If you're experienced with one of these other wikis, you should find that almost all of what follows tells you what you already know. And if you aren't, then remember that what's below may tax your patience but you'll be able to apply your skills elsewhere too.

Some of this markup is inspired by XHTML; and there's also a limited amount of actual XHTML that is, or may be, involved.

Page organization

Paragraphs (and line breaks)

Single line breaks have no effect within paragraphs. To separate a paragraph from the previous one, insert a blank line between them (hit the Enter key twice).

Don't attempt to indent the first line of a paragraph.

To indent a block quotation, start the block with “<blockquote>” and end it with “</blockquote>”.

There's a convention whereby a comment in a talk page is indented further from the left than is the comment that prompted it. For each level of indentation from the left, add one colon (“:”) at the very start of your comment.

For a simple line break, use “<br />”. (In normal body text this is unnecessary; it can help within captions and the like.)

Headers (subtitles)

Think of an article as having a hierarchy of organization. Any article that is not particularly short needs subdivision by headers. As an example of this in action, we'll look at the article “Pearlette”.

The very start rightly has no header. (Don't add headers such as “Introduction”, “Preamble”, or similar.)

There follows a table of contents, which the software has generated automatically. Note within it:

3 Second generation: hinged back
3.1 1933 model

and take a quick look at these sections. The former is the topmost level of classification; it was added with a pair of double equals signs: “==Second generation: hinged back==”. The latter is one stage below this, and uses a pair of treble equals signs: “===1933 model===”. Note that they're not numbered: the numbering too is generated automatically.

Put a header on a new line, and start anything that follows it on a new line.

For a further level of subdivision, ====a third level==== (four equals signs on each side) can be used. And if even this is not enough, a fourth and a fifth level (with five and six on each side respectively) can be used too.

Page ingredients

Images

The method of adding images — as well as copyright issues and other helpful advice — is explained in Adding images.

Tables

Tables need to be explicitly opened and closed, and their contents must be written row by row. Here's a 2×2 example:

{|
|-
! Header 1
! Header 2
|-
| row 1, cell 1
| row 1, cell 2
|-
| row 2, cell 1
| row 2, cell 2
|}

This produces:

Header 1 Header 2
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2

Of course this looks dreadful. Let's replace the initial “{|” with

{|class="toccolours" border="1" style="clear:both; margin:2em auto; text-align:center; border-collapse:collapse;"

The result is now:

Header 1 Header 2
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2

Let's look at the options here.

[???]

For details, see Wikipedia's “Help:Table”.

Lists

Lists are remarkably easy. There are two kinds, unordered (not numbered) and ordered (numbered).

What it looks like What you type Comments
Unordered:
  • This
  • That
  • The other
*This
*That
*The other
asterisks
Ordered:
  1. This
  2. That
  3. The other
#This
#That
#The other
hash marks

A list item should be typed on one line (it should not include a line break).

Lists may be nested, and in any combination: either an ordered or an unordered list may be nested within either an ordered or an unordered list. An example:

What it looks like What you type Comments
Unordered within ordered:
  1. Prewar
  2. Postwar film
    • 35mm and smaller
    • Larger than 35mm
  3. Digital
#Prewar
#Postwar film
#*35mm and smaller
#*Larger than 35mm
#Digital
A hash mark for every item, and not just for every top-level item

Character formatting

The way that text appears within a paragraph, list item, etc, can be altered via either Mediawiki-specific use of apostrophes[1] or certain XHTML tags. First, the apostrophes:

What it looks like What you type Comments
Italics: Asahi Camera is helpful
''Asahi Camera'' is helpful
Two (plain) apostrophes to start, two to finish.
Bold: It is marked SP
It is marked '''SP'''
Three (plain) apostrophes to start, three to finish.

And yes, you can combine italics and bold.

Secondly, the XHTML tags. You mark the start of an area needing some change with “<XXX>” and you mark its end with “</XXX>” — though not with “XXX” but instead with something else, as explained below:

What it looks like What you type Comments
Superscript: marketed as the “330D” in Europe
marketed as the “330<sup>D</sup>” in Europe
Subscript: marketed as the “A41” in Japan
marketed as the “<sub>A</sub>41” in Japan
Small: [not verified]
<small>[not verified]</small>
Rarely helpful in the text of an article.

(Editors familiar with CSS can also format within <span style="[CSS rules]"> and </span>.)

Characters

Characters on your keyboard

You should be able to type just about any character that's on your keyboard, to have it rendered in the normal way. Exceptions are:

  • combinations of characters that most people would never want (such as pairs of single quotation marks)
  • the two inequality signs “<” and “>

The last pair will seldom be useful in the context of cameras; but if you do need them, type “&lt;” and “&gt;” respectively. (They're mnemonic; “lt” and “gt” stand for “less than” and “greater than” respectively.)

Characters not on your keyboard

As for all the characters that aren't on most people's keyboards and that are occasionally useful — áàäâāăãåą and more — you can either:

  • copy them from elsewhere and paste them
  • insert them via the “numeric references” (eg “&#333;” for “ō”) or named “character entities” (eg “&uuml;” for “ü”) that are standard for HTML or XHTML in regular web pages

Many web resources help with the latter; a good resource is Alan Wood’s Unicode resources.

Page layout

It's rarely a good idea to set out to design an article, but it may help to design small parts of a page.

For small agglomerations of images, the use of tables (described above) is acceptable. But tables are better avoided for anything large, as they tend to force a lot of scrolling in small browser windows.

If you know CSS, you can make judicious use of the div element with the style attribute for page layout. (An example follows.)

Use “<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">” to start and “</div>” to end a block of text that you want centered.

Links

For links from graphics, see Adding images.

Internal links

Link to another page, or to a points within one or a point within the same page, where this seems useful.

For example, when writing about a camera made by Nikon, link "Nikon" to the page about it (i) the first time that "Nikon" is mentioned in the article, (ii) at any point where Nikon, the maker, is discussed (rather than merely mentioned), and optionally also (iii) when "Nikon" is first mentioned in a section coming some way below any previous link to that same page.

Case (the capital/lowercase distinction), spaces, the distinction between hyphen and en dash, and so forth, are all significant.

Linking to another page

Camera-wiki.org has a page titled “Pearlette”. The simple way to link to it is “[[Pearlette]]” (for “Pearlette”).

If it helps to link to the page by another name, this other name follows the title and the pipe character (“|”): “[[Pearlette|Konishiroku Pearlette]]” (for “Konishiroku Pearlette”).

The case (capital versus lowercase) of the first letter doesn't matter. Camera-wiki.org has an article “Light meter”, but a link to “[[light meter]]” works for it: (“light meter”). (Case is important elsewhere.)

What immediately follows such an internal link (and is not separated by a space, an apostrophe, etc.) is visually “blended” into the link. Thus “[[light meter]]sappears as a link to “light meters”, plural (“light meters”), but actually links to the title within the brackets.[2]

When followed by nothing at all, the pipe character (“|”) hides title endings in parentheses: “[[Semi Wester (postwar)|]]” for “Semi Wester”.

Linking to a point within a page

Link to a given header within another page via “[[Article_title#Header|Text]]”. (Find the XHTML form of the header by examining the URL as shown in your browser after you have arrived at the header after clicking its title within the table of contents.) For example, “[[Olympus#Pen_Digital_.28micro_four_thirds.29|µ4/3 Pen]]” for “µ4/3 Pen” — i.e. the section “Pen Digital (micro four thirds)” within Olympus.

Linking to a point within the same page

In order to link to a point within the same page, skip the article title and instead simply start with “#”; for example, “[[#Tables|Tables]]” for “Tables” within this page.

Rather than plain “(see above)” or “(see below)”, it's helpful to write “(see [[#Tables|above]])” — for “(see above)” — or similar.

Link rot

If a page is later moved, an existing (or new) link to it under its former name should still work. So even after the article “Carl Flex” was moved to “Carlflex”, any link to the former (example) has been automatically redirected to the latter.

However, if a the title of a header within an article is changed, a link to it no longer works (and instead sends the browser to the top of the page). Therefore only link to a header within a page that already seems to have been edited to a stable state, and consider adding a hidden comment next to the target of the link, telling subsequent editors that they should only rename it if they do so with care.

External links

Simply, for a link to a page outside Camera-wiki.org, use within single (square) brackets, the URL followed by a space (no pipe character) and the page title: “[http://www.tlr-cameras.com/ TLR Cameras Website]” for TLR Cameras Website.

Interwiki links work for some other wikis. For example, “[[Wikipedia:Fujifilm]]” brings Wikipedia:Fujifilm. Combination with a pipe and an alternative title works: “[[Wikipedia:Fujifilm|Fujifilm (Wikipedia)]]” brings Fujifilm (Wikipedia). Likewise, “[[Commons:File:Perfekta_6x6_IMGP4292.jpg|Perfekta (Wikimedia Commons)]]” brings Perfekta (Wikimedia Commons). There's also a handy shortcut employing the pipe character: “[[Wikipedia:Fujifilm|]]” brings Fujifilm.

Footnoting

After either a factual assertion that would benefit from being sourced to an authority, or an opinion or quotation, add a source footnote. The markup for any footnote is the same. ???

If the article is to have any footnotes, then there should be the single self-closing tag “<references />” somewhere below the point from which the last of the footnotes is to be linked. (It normally goes under — and indeed is the only text under — the header “==Notes==”.

Write each footnote at the point in the main text from which there should be an index number. Insert “<ref>XYZ</ref>”. This will lead to the automatic generation of an appropriate index number and a footnote that reads “XYZ”.

A given footnote may be pointed to from two or more places. In any one of these places — among which the first is recommended, as this position aids subsequent editing — add the footnote in full, but with a name.[3] Example: “<ref name="perfekta66">XYZ</ref>”. Each of the other pointers to the same footnote is simply a self-closing tag with the same name: “<ref name="perfekta66" />”.

Categories

For more on categories, see ???

In order to add a page to a category,[4] add a link to the category at the foot of the page. Thus in order to add Luxette to the category “German 4x4”, add “[[Category:German 4x4]]” to the foot of the former (but don't touch the latter).

Within the category, the page that you categorize is normally listed according to its title (so Luxette will be under “L”). More often than not this is appropriate. But it's sometimes better to force a different listing.

First, consider the Minolta SR-T 201. Within Category:Japanese 35mm SLR, it's better listed among the Minoltas, under “M”. But if Category:Minolta SR mount has all the SR-mount Minolta models listed under under “M”, the result may be difficult to use and certainly will be ridiculous. The solution is the combination of “[[Category:Japanese 35mm SLR]]” and “[[Category:Minolta SR mount|SR-T 201]]”: in the latter, “|SR-T 201” results in listing as if titled “SR-T 201”.

Secondly, consider the article Minolta itself. It should certainly be listed within Category:Minolta, but where? Not lost under “M”, but instead at the top. The kludge for this is an asterisk after the pipe: “[[Category:Minolta|*]]”.

Exceptionally, you may want to link to a category. If so, prefix a colon (“:”) to “Category”. Thus “[[:Category:German 4x4]]” renders “Category:German 4x4”.

Miscellaneous

Hidden comments

Material written between an opening “<--” and a closing “-->” is visible to anyone who edits the page but isn't otherwise visible. (This is useful for temporarily “commenting out” material that's seriously flawed but that could later be fixed.)

Any material can be placed in a hidden comment, as long as it does not include a pair of hyphens. (An implication of this is that one comment cannot be nested in another comment.)

Horizontal rules

Make a horizontal rule (line) by placing an unbroken set of four hyphens (“----”), and only these hyphens, on a line.

Notes

  1. These must be standard, straight-from-the-keyboard apostrophes: ' . “Typographic quotes” — opening- and closing-specific quotation marks and — won't work for this.
  2. On rare occasion this “blending” isn't wanted. It can then be suppressed via the “<nowiki>” tag. Thus although “[[light meter]]ed” appears as “light metered” (perhaps giving the misleading impression of an article about the process of metering), “[[light meter]]<nowiki>ed</nowiki>” appears as “light metered”.
  3. The name should start with a simple letter (A–Z, a–z), and should only include letters, digits (0–9), underlines and/or hyphens.???
  4. Or to categorize it, or to add the category to the page — these are widely used ways of expressing the same one idea.

See also