Difference between revisions of "Help:Markup reference"

From Camera-wiki.org
Jump to: navigation, search
m (Spanning columns and rows; formatting individual cells: bulk reduction)
(Cut. For one thing, the value of attribute valign cannot be "center"; it must be one of "top", "middle", "bottom", "baseline".)
Line 405: Line 405:
 
| style="text-align:left" | price in Japan
 
| style="text-align:left" | price in Japan
 
| ₩525 || ₩620 || [export] || ₩525 || [export] || colspan="3" | ₩620
 
| ₩525 || ₩620 || [export] || ₩525 || [export] || colspan="3" | ₩620
|}
 
 
==== [needs attention] ====
 
Is more control needed? Then let’s replace the initial “'''|'''” of the table fields with "'''||'''". Between the two upright lines normal HTML attributes can be applied for alignment, background color and more. The general attributes for the whole table are just added after the table's initial "'''{|'''".
 
 
<div style="padding:5px; margin-left:30px; color:#000; background-color:#ddf;">
 
<nowiki>{|class="toccolours" border="1" style="clear:both; background-color:#e0e0e0; margin:2em auto; text-align:center; border-collapse:collapse;"</nowiki><br />
 
! longer Header 1<br />
 
! longer Header 2<br />
 
! longer Header 3<br />
 
|-<br />
 
|bgcolor=yellow| row 1,&lt;br /> cell 1<br />
 
|valign=bottom bgcolor=lightpink| row 1, cell 2<br />
 
|rowspan=2 valign=center| high cell<br />
 
|-<br />
 
|align=left bgcolor=lightgreen| row 2, cell 1<br />
 
|align=right bgcolor=cyan| row 2, cell 2<br />
 
|-<br />
 
|colspan=2| wide cell<br />
 
|| row 3, cell 2<br />
 
|}</div>
 
 
The first "'''|-'''" is omitted for briefness. The result is now:
 
 
{|class="toccolours" border="1" style="clear:both; background-color:#e0e0e0; margin:2em auto; text-align:center; border-collapse:collapse;"
 
! longer Header 1
 
! longer Header 2
 
! longer Header 3
 
|-
 
|bgcolor=yellow| row 1,<br/> cell 1
 
|valign=bottom bgcolor=lightpink| row 1, cell 2
 
|rowspan=2 valign=center| high cell
 
|-
 
|align=left bgcolor=lightgreen| row 2, cell 1
 
|align=right bgcolor=cyan| row 2, cell 2
 
|-
 
|colspan=2| wide cell
 
|| row 3, cell 2
 
 
|}
 
|}
  

Revision as of 04:23, 24 April 2011

This page is within the userspace of Zuleika. The plan is first to improve it and then to move it, to "Help:Markup reference" or similar. After the move, it may of course be edited and improved by any Camera-wiki.org editor who is sufficiently well-informed and careful. And no doubt various improvements will be possible. In the meantime, it's editable by Zuleika, and by specific invitation. Other editors are most welcome to make suggestions for it; these suggestions can be placed in User talk:Zuleika/Junkyard.

This is an intermediate-level reference guide to the technical aspects of writing articles. It concentrates on telling you how to format articles in the way you wish. But there’s also some guidance on what to do. If you’re a complete beginner, make sure to look first at Editing. If you’re experienced, this page may answer some remaining questions; but for comprehensive information please see the recommendations made within various sections and also the links listed below under “Further reading”.

The content here 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 although what’s below may tax your patience, you’ll be able to apply it elsewhere too.

Some of this markup is inspired by XHTML; and there’s also a limited amount of actual XHTML and CSS 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 to which it’s a reply. For each level of indentation from the left, add one colon (“:”) at the very start of your comment.[1]

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

Headers (section titles)

Think of an article as having a hierarchy of organization. Any longer article benefits from subdivision by headers.

There should be no header at the very start of an article. (Don’t add the header “Introduction”, “Preamble”, or similar.) Write a short paragraph (perhaps as short as a single sentence) and then insert the first header.

As an example of this in action, we’ll look at the article “Pearlette”.

There follows a table of contents, which the software has generated automatically. For Pearlette, note within this table:

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===”. They’re not numbered: the numbering is generated automatically for the table of contents. (For more on tables of contents, see below.)

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.[3]

Page ingredients

Table of contents

When the number of headers (see above) within a page goes over three, this automatically triggers the generation of a table of contents. The table itself cannot be edited. Its generation should not normally be forced, moved or suppressed. However, this can be done, using one or other of two “magic words” (MediaWiki terminology), each enclosed in double underlines:

  • Adding “__TOC__” somewhere in a page forces generation of the table of contents at that point in the page.
  • Adding “__NOTOC__” anywhere in a page suppresses generation of the table of contents anywhere in the page.

Images

Camera illustrations are the life-blood of Camera-wiki.org. But any image (typically a photograph, but perhaps a scan or diagram) must be added to a page in a very specific way, and with due consideration for its copyright status. All this is explained within Adding images.

Lists

There are two kinds of list, depending on whether the items are unordered (not numbered) or ordered (numbered). They are remarkably easy to produce: they don’t require an explicit beginning or end, and instead merely consist of a simple, unbroken series of list items. Each list item starts on a new line with either of two characters, and should be typed on a single line (it should not include a line break).

An unordered list is typically displayed with bullet points. It’s made with an asterisk (“*”) at the start of each line.

*This
*That
*The other

produces

  • This
  • That
  • The other

An ordered list is typically displayed with Arabic numerals. It’s made with a hash mark (“#”) at the start of each line.

#This
#That
#The other

produces

  1. This
  2. That
  3. The other

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

#Prewar
#Postwar film
#*35mm and smaller
#*Larger than 35mm
#Digital

produces

  1. Prewar
  2. Postwar film
    • 35mm and smaller
    • Larger than 35mm
  3. Digital

Tables

Tables need to be explicitly opened and closed, and their contents must be written row by row. (Line breaks do matter.) Here’s a 3×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 neither looks like a conventional table nor is easy to understand as a table. But a simple change will work wonders. If we replace the initial “{|” in the table above with “{|class="wikitable"”, the result is:

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

Let’s take a slightly closer look at the markup for this. Here it is:

{|class="wikitable"
|-
! Header 1
! Header 2
|-
| row 1, cell 1
| row 1, cell 2
|-
| row 2, cell 1
| row 2, cell 2
|}

Here’s what this means. Each of the following necessarily starts on a new line.

  • {| class="wikitable" ⇒ the start of a table of the particular class (in the CSS sense) “wikitable”
  • |- ⇒ the start of a row
  • ! [text] ⇒ a header cell
  • | [text] ⇒ a (regular) cell
  • |} ⇒ the end of the table

Although the table must be closed, a row does not have to be.

One minor short cut is often used: starting a cell by doubling the pipe character (“|”) or exclamation mark rather than preceding the single character with a line break. (We’ll see this at work next, when we look at captions.)

A caption can be a useful addition to table. Here’s how to add it:

  • |+ [text] (on a new line immediately under the one that starts the table): the caption

Here then is another way to create the very same table as above, but with the addition of a caption:

{|class="wikitable"
|+ This is a caption
|-
! Header 1 !! Header 2
|-
| row 1, cell 1 || row 1, cell 2
|-
| row 2, cell 1 || row 2, cell 2
|}

which brings:

This is a caption
Header 1 Header 2
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2

If (only if!) you’re feeling adventurous (or are accustomed to CSS), let’s start to explore a few variations. (NB you do not have to know this stuff. If it mystifies or repels you, fine, you’re like most editors here: feel free to leave well alone and let another editor add it to your work if/when desirable.)

Table positioning

Is more control needed, perhaps for centring? Then let’s replace the initial “{|” in the first (poorly legible) table with “{|class="toccolours" border="1" style="clear:both; margin:1em auto; border-collapse:collapse;"[4]

The result is now:

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

Now let’s try tables to the left and right, around which text will be allowed to wrap.

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

First, “{|class="toccolours" border="1" style="background-color:#eeffee; float:left; margin:1em 1em 1em 0; border-collapse:collapse;"[4][5] will “float” a table to the left. The particular table here has a light green background thanks to “eeffee”: the first and the second “ee” mean a high level of red and blue respectively, while the “ff” in the middle means the maximum level of green.[6] Where, as here, four values are given for the margin, they’re set clockwise from the top; so “1em 1em 1em 0” means no margin on the left but a one-em[7] margin on each of the other three sides.

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

Secondly, “{|class="toccolours" border="1" style="background-color:#ffeeee; float:right; margin:1em 0 1em 1em; border-collapse:collapse;"[4] will “float” a table to the right. The particular table here has a light pink background thanks to “ffeeee”: the “ff” at the start means the maximum level of red, while the first and the second “ee” mean a high level of green and blue respectively.[6][5] The margins of “1em 0 1em 1em” mean no margin on the right but a one-em[7] margin on each of the other three sides.

Spanning columns and rows; formatting individual cells

Here, we’ll see how to construct a table such as that below (from the article Fujica Six).

model IA IB IC IAS ICS IBS
variant a b c
lens Fuji Rectar
aperture 4.5 3.5 4.5 3.5
shutter Lotus S.R. NKSZ S.R. NKS
max speed 200 500 200 500 200
flash terminal none 2-pin 1-pin 2-pin PC 2-pin
self-timer yes no yes no yes
release April 1948 August 1948 June 1949 August 1949 1949 1950
price in Japan ¥5,250 ¥6,200 [export] ¥5,250 [export] ¥6,200

Consider what’s at the top of it: from “model” and “variant” at the left across to “IBS” and “c” on the right. This consists of a grid formed by two rows and nine columns, within which a number of pairs of adjacent cells have been merged. Here’s how its construction might have started (but with “blankx” inserted to help show what is where):

model IA IB IC IAS ICS IBS blank1 blank2
variant blank3 blank4 blank5 blank6 blank7 a b c

(This small table, together with those that follow, is narrow because nothing is forcing it to be any wider than is necessary for the text that it contains.)

First, let’s have “IBS” expand across what are now “blank1” and “blank2”. In XHTML (and HTML) terms, we want the cell that contains “IBS” to span three columns. This requires adding the “colspan” attribute to this cell, and deleting those that now contain “blank1” and “blank2”. Deletion is straightforward. In MediaWiki markup, you add any attribute to a cell in front of the pipe (“|”) character and any text. And so:

model IA IB IC IAS ICS IBS
variant blank3 blank4 blank5 blank6 blank7 a b c

Now for the rest. We want each of “IA”, “IB”, “IC”, “IAS” and “ICS” to span two rows. The “rowspan” attribute works analogously to the “colspan” attribute (although it is a little harder to use as what needs to be deleted is not adjacent to it in the markup).

model IA IB IC IAS ICS IBS
variant a b c

All seems well (in a bunched-up kind of way). So now let’s add the next row.

model IA IB IC IAS ICS IBS
variant a b c
lens Fuji Rectar

The result is still too narrow for us for a full idea of what is going on here, but it’s sufficient to show that both “c” and “Fuji” are left-aligned whereas they’d look better centred.

Centring everything is easily done, by addition of “text-align:center;” for the table as a whole. The result:

model IA IB IC IAS ICS IBS
variant a b c
lens Fuji Rectar
aperture 4.5 3.5 4.5 3.5
shutter Lotus S.R. NKSZ S.R. NKS
max speed 200 500 200 500 200
flash terminal none 2-pin 1-pin 2-pin PC 2-pin
self-timer yes no yes no yes
release April 1948 August 1948 June 1949 August 1949 1949 1950
price in Japan ¥5,250 ¥6,200 [export] ¥5,250 [export] ¥6,200

Although the leftmost column looks strange, the table as a whole is a fairly good approximation to what we want. So we retain “text-align:center;” for the table as a whole, but add the CSS rule “text-align:left” for any cell whose text should be left-aligned. If there is a “style=” attribute for the cell, we add this rule to it, separating it from any other rule by a semicolon (“;”); if there is not, we add “style="text-align:left"” to the left of the pipe for the cell.

To demonstrate more tricks, we have to alter historical fact about this range of camera. We’ll add the suffix “f” (for “fictional”) to the name of each before we proceed, and make a few other changes that should prevent even the casual reader from taking the content of the table seriously.

The table above has cells that span columns and cells that span rows, but no cell that spans both. But it’s simply done: add bothcolspan” and “rowspan” attributes to the cell at the top left of the rectangle that is to be merged, and delete the other cells.

model IAf IBf ICf IASf ICSf IBSf
variant a b c
lens Rikkor Likkor
aperture 4.5 3.5 4.5 3.5
shutter Lotus S.R. NKSZ S.R. NKS
max speed 200 500 200 500 200
flash terminal none 2-pin 1-pin 2-pin PC 2-pin
self-timer yes no yes
release April 1928 August 1928 June 1929 August 1929 1929 1930
price in Japan ₩525 ₩620 [export] ₩525 [export] ₩620

For more details, see “Table” (Wikipedia).

Definitions

["the space [devoted to definitions would be] better used to mention the Camera-wiki Glossary"]

Definitions — presented discretely, perhaps in a list — are only rarely of use here within Camera-wiki.org, and they’re used rarely, if at all.[8] But if you do want them, here’s how to do them properly:

220 film
Similar to 120 film but effectively twice as long (and only usable with cameras designed specifically for it); allows 32 6×6 exposures; formally specified in ISO 732 (1991).

is achieved via

;220 film:Similar to 120 film but effectively twice as long (and only usable with cameras designed specifically for it); allows 32 6×6 exposures; formally specified in ISO 732 (1991).

Note (i) the semicolon (“;”) at the start (and necessarily at the very start of the line), and (ii) the colon (“:”) separating term and definition.[9]

Avoiding special effects

You may be wondering how it is that this page is able to show all the code. (For example, if code shows how to create a table, why doesn’t it create the table right there and then?)

The answer is the heavy use here of the “<nowiki>” tag. But this tag isn’t only useful in such minor and peripheral areas of Camera-wiki.org as explanations of markup; it’s also useful in regular articles.

As an example, suppose we want to use the definitions markup (above) to create a definition for “3:2” (the aspect ratio). As we’ve seen, the pattern is (on a new line): semicolon, term to be defined, colon, definition. And so:

;3:2:An ''aspect ratio'' (q.v.) in common use in photography [...]

However, this brings us:

3
2:An aspect ratio (q.v.) in common use in photography [...]

The problem is of course that the first colon is misinterpreted as having special significance. What we need to do is suppress this significance, using “<nowiki>...</nowiki>”:

;3<nowiki>:</nowiki>2:An ''aspect ratio'' (q.v.) in common use in photography [...]

results in

3:2
An aspect ratio (q.v.) in common use in photography [...]

Character formatting

The way that text appears within a paragraph, list item, etc, can be altered via either MediaWiki-specific use of apostrophes[10] or certain XHTML tags, sometimes with CSS.

First, the apostrophes.

Use two apostrophes in order to start italicizing and to end it: “''Asahi Camera''” brings “Asahi Camera”.

Use three apostrophes in order to start boldface and to end it: “The '''Bronica S2a''' was [...]” brings “The Bronica S2a was [...]”.

And yes, boldface can be added to italics and vice versa; as a simple example (turning both on and off at the same place): “The Japanese magazine '''''Asahi Camera''''' was [...]” brings “The Japanese magazine Asahi Camera was [...]”.

(Camera-wiki.org typically uses boldface at the very start of an article; it uses it only sparingly elsewhere. This page is of course unusual.)

Secondly, the XHTML tags (which are rarely needed). You mark the start of an area needing some change with “<XXX>” and you mark its end with “</XXX>” — though not “XXX” but instead one of “sup”, “sub” and “small”, as explained below:

For superscripted text: “marketed as the "330<sup>D</sup>" in Europe” brings “marketed as the "330D" in Europe”.

For subscripted text: “marketed as the "<sub>A</sub>41" in Japan” brings “marketed as the "A41" in Japan”.

For small text:[11]<small>[not verified]</small>” brings “[not verified]”.

For underlined text:[12]<span style="text-decoration:underline">XYZ</span>” brings “XYZ”.[13]

For struck out text:[14]<span style="text-decoration:line-through">XYZ</span>” brings “XYZ”.[13]

Editors familiar with CSS can also use other property:value pairs within <span style="[CSS rules]"> and </span>. (But with restraint, please!)

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 rarely want (such as pairs of single quotation marks)
  • the two inequality signs “<” and “>
  • (in certain unusual circumstances) double quotation marks “"

The inequality signs will seldom be useful in the context of cameras; but as Pentax has a camera called “*ist”, perhaps some company will use one or other of these within a trademark. If you do ever need them, type “&lt;” and “&gt;” respectively. (These are mnemonic; “lt” and “gt” stand for “less than” and “greater than” respectively.)

Trouble with double quotation marks arises only in vanishingly rare conditions; but if they ever are problematic, the workaround is “&quot;”.

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 do any of the following:

  • 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
  • insert them in whatever is the normal way for you

Some useful characters are listed below.

Arithmetical symbols

  • &times;” gives the multiplication symbol, in for example “6×9 cm”
  • &minus;” gives the minus sign, in for example “3 stops”
  • &plusmn;” gives the plus-or-minus sign, in for example “±2 EV”
  • &frac14;”, “&frac12;” and “&frac34;” give the fractions “¼”, “½”, and “¾
  • &sup2;” and “&sup3;” give “²” and “³” respectively
  • &micro;” gives the “micro” prefix, “µ[15]

Unit symbols

  • &deg;”, “&prime;”, “&Prime;” for “°” (degree), “” (minute), “” (second)
  • &euro;”, “&pound;”, “&yen;” for “” (euro), “£” (pound), “¥” (yen)

Letters for German, French, and Japanese

Letters with diacritics: acute, grave, circumflex, diaeresis/umlaut, macron
&aacute; á &agrave; à &acirc; â &auml; ä &#257; ā
&eacute; é &egrave; è &ecirc; ê &euml; ë &#275; ē
&iacute; í &igrave; ì &icirc; î &iuml; ï &#299; ī
&oacute; ó &ograve; ò &ocirc; ô &ouml; ö &#333; ō
&uacute; ú &ugrave; ù &ucirc; û &uuml; ü &#363; ū
&Aacute; Á &Agrave; À &Acirc; Â &Auml; Ä &#256; Ā
&Eacute; É &Egrave; È &Ecirc; Ê &Euml; Ë &#274; Ē
&Iacute; Í &Igrave; Ì &Icirc; Î &Iuml; Ï &#298; Ī
&Oacute; Ó &Ograve; Ò &Ocirc; Ô &Ouml; Ö &#332; Ō
&Uacute; Ú &Ugrave; Ù &Ucirc; Û &Uuml; Ü &#362; Ū

Camera-wiki.org spells Angénieux not “Angenieux” but “Angénieux”, it spells Voigtländer not “Voigtlander” but “Voigtländer”, and so on. Indeed, French, German, and (usually in Hepburn romanization) Japanese have contributed a lot of names, book titles and so forth to Camera-wiki-org. If your keyboard is set up to add accented and similar characters easily — perhaps it is already mapped for one of these languages, or you remember the needed keystroke combinations — then you can add them in the way that you’d do so elsewhere. Read on only if that doesn’t apply.

For vowel letters with diacritics, see the table to the right. Also useful for these languages are:

  • Ligatures: “&aelig;” for “æ”; “&AElig;” for “Æ”; “&oelig;” for “œ”; “&OElig;” for “Œ”; “&szlig;” for “ß[16]
  • Cedilla: “&ccedil;” for “ç”; “&Ccedil;” for “Ç

Of course names in languages other than English, French, German and Japanese should also be given precisely. (See for example “Saulutė”, an article on a Lithuanian light meter, the dotted final letter of whose name must be distinguished from the Lithuanian alternatives “e” and “ę”.) Other combinations with diacritics (as well as letters not used for any of these languages) can be found in:

all three of which are within “Alan Wood’s Unicode Resources”. (Their order — Latin‑1 Supplement → Latin Extended‑A → Latin Extended‑B — is broadly that of increasing exoticism as seen by the majority of people who only know English.)

Greek letters

The standard, unaccented Greek letters have easily remembered character entity references: between the “&” and the “;” is the name of the letter, spelled as is usual in English but with the first letter of this name lowercase or capital for a lowercase or capital Greek letter respectively.

For example, “&theta;” and “&Theta;” bring “θ” (lowercase theta) and “Θ” (capital theta) respectively.

Greek and Coptic” (in “Alan Wood’s Unicode Resources”), provides all the information needed.

Punctuation, line-break related symbols, etc.

  • &ndash;” and “&mdash;” give “” (en dash) and “” (em dash) respectively
  • &para;” and “&sect;” give “” and “§” respectively
  • &copy;” gives the copyright symbol “©[17]

&nbsp;” creates a non-breaking space, one that will not break over two lines; useful if (for example) you don’t want the “A” to be separated from the “Ikonta” in “Ikonta A”.

Don’t attempt to insert soft hyphens. For a non-breaking hyphen, use “&#8209;”.

For more characters, see:

both of which are within “Alan Wood’s Unicode resources”.

Page layout

Don’t try to force the content into a preconceived layout design of your own. However, 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 centred.

Floating

In this section, the discussion gets a little advanced. If this doesn’t interest you (or repels you), feel free to skip it: another editor who finds this work more palatable will be able to do it where desirable.

Above, we’ve seen how to “float” a narrow table to the left or right. Other “block-level elements” (as they’re called in XHTML and HTML) can be floated too; for Camera-wiki.org, this generally means the content of a “div” element.

Floating involves CSS. For a “div” element to float, its opening tag must contain “style="[rules separated by semicolons]"”, and one of these rules must be “float:left” or “float:right”. The former floats the element to the left; the latter floats it to the right; other material is allowed to wrap around it.

In order to avoid ugly scrapes against text, the floated element should normally have margins specified. this is done with another CSS rule, “margin:T R B L”, where T, R, B and L are respectively the top, right, bottom and left margins (i.e. clockwise from the top). A margin of zero need not have the unit specified; any non-zero margin needs a unit. Here, let’s use pixels. The abbreviation for them is “px”, and (like any unit in CSS) it is not preceded by a space.

Typically floated elements only benefit from a margin at the side to which there may be text, and below. The two examples below each have a five-pixel margin below and at one side:

<div style="float:left; margin:0 5px 5px 0">
[. . .]
</div>

<div style="float:right; margin:0 0 5px 5px">
[. . .]
</div>

Clearing

In this section, the discussion is slightly advanced. If this doesn’t interest you (or repels you), feel free to skip it: another editor who finds this work more palatable will be able to do it where desirable.

Simply, “clearing” gets under what’s “floated”; if nothing has been directed to float, there’s never a need to “clear”.

If something is floating to the right and there is space to its left, an element (paragraph, header, etc.), will start to its left. To prevent this from happening, you need to get the element to clear its left-hand side. You do this with inline CSS, and specifically the rule “clear:left”.

Inline CSS requires the “style” attribute, which in turn requires an XHTML tag. Partly because wiki text seldom requires these (for example, it’s rare for a paragraph in wiki text to be explicitly opened and closed[18]), and partly out of habit, wiki editors often use a “styled” line break for this: “<br style="clear:left" />”. To obtain this with fewer keystrokes instead type the substituted template{{subst:brl}}”.

Likewise, if something is floating to the left and there is space to its right, an element (paragraph, header, etc.), will start there. To prevent this from happening, you need to get the element to clear its right-hand side. You do this with the CSS rule “clear:left”. A common way to do this is with “<br style="clear:right" />”; you can get this by typing “{{subst:brr}}”.

Or you can prevent material from being on either side, by using the CSS rule “clear:both”. A common way to do this is with “<br style="clear:both" />”; you can get this by typing “{{subst:br}}”.

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, and such tiny distinctions as that between hyphen and en dash 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 this page but use another name for it, 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”.

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.[19]

When followed by nothing at all, the pipe character (“|”) performs either of two tricks:

  • It hides title endings in parentheses: “[[Semi Wester (postwar)|]]” for “Semi Wester”.
  • It hides certain (although not all) namespace prefixes: “[[Help:Adding images|]]” for “Adding images”.

It also does both of these: “[[Template:Japanese 6×6 TLR (A–L)|]]” for “Japanese 6×6 TLR”.

Linking to a point within a page

Link to a given header within another page via “[[Article_title#Header|Text]]”. (Find the right form of the header by examining the URL as shown in your browser after you have clicked 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 titled “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.

Anticipating link rot

If a page within Camera-wiki.org is later moved (renamed), 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 the header will no longer work (and instead will send 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, put 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.[20]

Footnoting

After either a factual assertion that would benefit from being sourced to an authority, or an opinion or quotation, add a source footnote. Also, peripheral or less important material that might try some readers’ patience can go into a footnote.

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 strongly recommended, as this position aids subsequent editing — add the footnote in full, but with a name.[21] 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" />”.

The actual content of the footnote is not moved within the editable text by any automatic process; only its position within the finished page is moved. Therefore if you wish to edit a footnote that is already in place, you have to do so by editing the section of the page from which the footnote is linked. For example, a footnote from here,[22] can be edited by editing this section (“Footnoting”), not the section below titled “Notes”.

When you’re editing any one section of an article from which there are footnotes, “Show preview” won’t give you a preview of these footnotes. There are two ways around this:

  • Take the option to edit the article as a whole, rather than the one section within it. (Of course you’re then free to limit your edits to this one section.)
  • Edit the section, temporarily adding “<references />” to the end of it. The preview function will now show the footnotes too. (If any of these repeats a footnote defined elsewhere, you’ll get an error message. Ignore this.) When all seems well, delete “<references />” and press the “Save page” button.

Common practice in Camera-wiki.org has been to lump together all footnotes, from dry page references to learned digressions, under the single title “Notes” (or occasionally “References”). They may however be separated. It may at first seem somewhat pretentious to have two sets of footnotes for a single web page, but doing this can help the reader: if a page has many dry source footnotes, the reader may not bother to look at them, and will therefore miss the occasional interesting footnote.

If it does seem a good idea to separate the two kinds of footnotes, then here is how to do this:

  • Create “source” notes as described above.
  • Create “content” notes (which should be few) as described above; but for each have “<ref group="XYZ">” rather than simple “<ref>”. “XYZ” here can be any one name that you wish (e.g. “content”). (This “group="XYZ"” may be combined with “name="ABC"”, and in either order.)
  • Have two section headers near the foot of the page, first “Notes” (for “content” notes), and then “References” (for “source” notes).
  • Place “<references />” under the header “References”.
  • Place “<references group="XYZ" />” under the header “Notes”.

For an example of a page in which notes are separated from references, see Ofuna Six.

(The “Reflist” macro, widely used within Wikipedia, does not exist in Camera-wiki.org.)

Categories

For more on categories, see Help:Categories.

Categorization adds ways in which articles can be found. In order to add a page to a category,[23] 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.

  1. 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”.
  2. 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 character: “[[Category:Minolta|*]]”.
  3. Consider the article “Ōki”. While it's obvious to us humans that the initial “Ō” is some kind of “O”, this is not so for the MediaWiki software, which will put the former somewhere after “Z”. Therefore its links to categories are exemplified by “[[Category:Japanese camera makers|Oki]]”, which lists it where it would be if the macron were not present.

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

Templates and transclusion

A template is a wiki page designed to be used as a module within other pages.

Templates are numerous and very varied; let’s start by introducing a simple one (one that’s short and has no variables). Insertion of “{{Dechert Canon}}” inserts “Template:Dechert Canon”:

Dechert, Peter. Canon Rangefinder Cameras 1933–68. Hove, East Sussex: Hove Foto Books, 1985. ISBN 0-906447-30-5.

There are two ways to insert a template: “{{Subst:Dechert Canon}}” (for substitution) and “{{Dechert Canon}}” (for transclusion); note how “Subst:” appears in the former.

With substitution, the content of the template is added to the article the first time the editor presses the “Save page” button. No subsequent change to the content of the template can have any effect.

Transclusion means dynamically including content from another location, content which later be independently edited. So with transclusion, the content of the template is added to the article only when the browser accesses the article. Thus what appears stays up to date with the template.

If the template is not expected to change, then substitution has the advantage of imposing a slightly smaller load on the webserver.

To understand how transcluding can help, let’s look at an example. Thanks to the Wayback Machine,[24] here is a February 2007 version of the article Mihama Six. At its top right is a template listing similar Japanese cameras. Pay attention to the list of folding 6×6 cameras, which has 35 items. Again via the Wayback Machine, here is a January 2009 version. The number of folding 6×6 cameras has almost doubled. (Just for “A” and “B”, it has added Angel Six, Balm Six, Baron, Beauty Six [1950] and Beauty Six [1953].) Editors here have always known that yet more such cameras might be discovered and written up, so they have made sure that the template has remained transcluded rather than substituted, happy that the addition of a camera article to the wiki will require its addition in just one place (the template) in order that mention of it is added every article containing that template.

In order to link to a template (for example, within a talk page, in order to discuss its use), put the entire name in square brackets: “[[Template:Dechert Canon]]” renders “Template:Dechert Canon”.

Creation of a template is beyond the scope of this page. Wikipedia has a number of pages that explain it well, but while reading these you should be aware that templates often themselves employ other templates, and that the explanations recommend the use of certain templates (such as the very humdrum “Tl”) that do not exist in Camera-wiki.org.

Transclusion is not limited to templates: pages in other namespaces (other kinds of pages) can be transcluded too. However, in Camera-wiki.org (unlike Wikipedia) it is very rare for the transclusion of any page other than a template to be needed or even desirable.

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 both for temporarily “commenting out” material that’s seriously flawed but that could later be fixed and for making certain kinds of comments for future editors — although most comments are better placed in the article’s talk page.)

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.

Space starting a line

The line you are reading now is a sample of

— it’s a sample of something that’s almost never wanted within Camera-wiki.org: monospaced lettering. It’s achieved simply thanks to a space at the start of the line. Though here it’s of course deliberate, for demonstration purposes, more often than not it’s accidental. If your (normally-intended) text looks like this, check that you haven’t preceded it with a space.

Notes

  1. This is a very dubious convention, as what it does is to insert XHTML whose meaning is specific to definitions, which of course are irrelevant. But it’s well entrenched.
  2. This is XHTML. Usually, the MediaWiki software effortlessly converts to this from HTML “<br>” or worse, but in certain situations will fail to do so.
  3. As editors often discover by accident, a level higher than any of these can be achieved via a single equals sign on each side. Do not use this.
  4. 4.0 4.1 4.2 The lack of a space before “em” within this isn’t careless; it’s deliberate and indeed necessary for CSS.
  5. 5.0 5.1 The property “background-color” must be so written. A hyphen, not a space; US spelling, not British. Camera-wiki.org pleads innocent: this is CSS, devised by W3C; if you don’t like it, please blame W3C.
  6. 6.0 6.1 The idea is “#RRGGBB”: a two-digit hexadecimal value for red, green and blue respectively. “#ffffff” is white; “#000000” is black.
  7. 7.0 7.1 The em is a typographic unit of length, in principle equivalent to the width of a lowercase letter “m”.
  8. They’re not even used within the Glossary.
  9. In various wikis, a line-starting semicolon is often used to create a quasi-header that will not appear in the table of contents. This is poor practice, as the line-starting semicolon triggers generation by the MediaWiki software of the header-irrelevant XHTML definition markup “<dl><dd>...</dd></dl>”. If you want such a quasi-header, simply use regular, treble-apostrophe bolding for it.
  10. These must be standard, straight-from-the-keyboard apostrophes: “  '  ”. By contrast, “typographic quotes” — opening- and closing-specific quotation marks “  ” and “  ” — won’t work for this.
  11. Only very rarely needed. Where it is appropriate (in certain kinds of image captions, etc.), the particular template usually automates it.
  12. Again, very rarely needed, other than perhaps for transcribing inscriptions. Hard to read, and easily confused with a link.
  13. 13.0 13.1 Other wikis recommend a simpler way of doing this; however, this involves mark-up that is “deprecated” (i.e. obsolete and disapproved by W3C).
  14. Again, very rarely needed, other than perhaps for quasi-deleting your own comment in a talk page after you have realized that it is mistaken. (Normally, old comments should not be deleted.)
  15. Despite being its origin and visually identical, the Greek letter “μ” is correctly separate in Unicode, and given by “&mu;”.
  16. This “ß” is the Eszett or scharfes S of German, suitable for transcribing German inscriptions and so forth. Usually it is better simply rendered as “ss” within an English-language context. Do not use it for lowercase Greek beta “β”, which is instead rendered by “&beta;”.
  17. Unicode does not provide a copyleft symbol like that within the “GNU FDL free doc license” graphic on this page.
  18. However, this is possible, and it can be used for this purpose. The markup for a regular paragraph is “<p> ... </p>”; and that for a paragraph that clears anything at its left is “<p style="clear:left"> ... </p>”.
  19. 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”.
  20. However, this seems buggy. Here in a footnote, “[[Wikipedia:Fujifilm|]]” brings [[Wikipedia:Fujifilm|]].
  21. The name should start with a simple letter (A–Z, a–z), and should only include letters, digits (0–9), underlines and/or hyphens.
  22. A footnote crying out to be edited and turned into something worthwhile.
  23. Or to categorize it, or to add the category to the page — these are widely used ways of expressing the same one idea.
  24. The reason why we point to the older examples at the Wayback Machine rather than here in Camera-wiki.org is related to the template: that display of an old version here will show it with any templates as these are now, and not necessarily as they were at the time.

See also