Page data
A page may carry data: facts about itself, written at the very top of the page between two lines that say #DATA#. The wiki reads some of it; the rest is yours to keep.
#DATA#
{
"tags": ["Person"],
"info": [
["name", "Alex"],
["surname", "Smith"],
["known for", "the bridge", "the mill"]
]
}
#DATA#
The data is JSON, and it must be valid JSON: no comments, and no comma after the last item of an object or a list. A page whose data cannot be read keeps its text, and the wiki says what is wrong rather than guessing.
The data block is a page edit like any other. It is committed, it has history, and two people changing different parts of it are merged rather than overwritten. The first line of the page must be exactly #DATA#, and the block ends at the next line that is exactly #DATA#; a page that mentions the marker further down keeps it as ordinary text.
The #DATA# button in the editor's Markup toolbar puts an empty block at the top of the page, with both fields present and empty, and leaves the cursor inside "info". Press it again and it takes you to that list rather than adding a second block.
Tags
"tags": ["Person", "Place"]
A list of the tags the page carries. See Tags.
Info box
"info-title": "Alex Smith",
"info": [
["name", "Alex"],
["surname", "Smith"],
["known for", "the bridge"]
]
An info table drawn as an infobox at the right of the page, with the text running beside it: a label and its value, one row per list. On a narrow screen, where there is no room for two columns, the box goes above the text instead. This is the wiki's one fixed shape for data, and it is simple on purpose.
-
It is a list of rows, not one object, because the order of rows is part of what the table says. The first row is read first, and JSON objects have no order to keep.
-
Each row is a list: the key first, then one or more values.
["name", "Alex"]is one row. The key is always the first item, which is how a row reads like the table row it becomes. -
More than one value after the key gives a row with several lines:
["known for", "the bridge", "the mill"]. -
A value is a string. A number, a true/false, a nested object or a nested list is an error. Write
"1900", not1900. -
A row with a key and nothing after it is an error, and so is a key that appears twice, because neither can be drawn as one row.
If any row is wrong, the table is not drawn and the page says which row to fix. Half a table would be a page that quietly lost a fact.
A value is Mojomarkup, written the same way as the rest of the page: a link, an italic word, a colour object. It is rendered as a line of text, not as a document, so a link works and a construction that would draw a block does not — a value of
<= some pagestays the text it is rather than transcluding the page into the box.The picture
"info-image": "portrait | 300 { Alexander in 1920 }"
An optional picture at the top of the box, above the title. The value is one entry of an image gallery: a page name or an absolute URL, then optionally
| sizeand{ caption }, exactly as you would write it insideimg { }. A page that is a picture shows the picture; a URL is fetched from wherever it points.The same entry rather than a smaller syntax of its own, because the wiki already has one answer to what an image target is, and a second answer would drift from it. Everything a gallery can do here, the box can do.
One picture, not several: the box is a narrow column beside the text, and a gallery in it would either overflow or push the text off the page.
The caption is also the picture's alt text, so a reader who cannot see the picture is told what you wrote. A picture with no caption has no alt text and is skipped by such a reader: write a caption if the picture says something.
A page name stays in the wiki; a URL does not. A picture uploaded to the wiki is committed with the page and keeps the page whole when it is restored from history. A URL is somebody else's server, which may be gone next year, and it tells that server who is reading. Both work; prefer the upload.
A picture that cannot be read is reported above the box and the rest of the box is still drawn. A page that does not exist is reported the way a gallery reports it.
The title
"info-title": "Alex Smith"
An optional heading for the box, shown above the first row. It is plain text, not Mojomarkup: it names the box rather than saying anything in it, and it is what a screen reader announces for the box as a whole.
Leave it out and the box is headed by the page's own name — the last segment of it, spelled the way the page's title spells it, so a page
alex_smithis headed "Alex Smith" and so ispeople/alex_smith. The rows describe that page, so its name is usually the heading you want, and writing it again would be a second copy that goes stale when the page is renamed. Write one when the name is not what the box is about: a page carrying several people's boxes, or one whose name is a shorthand.Transclusion
An info table belongs to the page it is written on. When another page transcludes this one with
<=, the text comes across and the info table does not: the facts describe this page, not the one showing it.The type
"type": "person"
What the page is: one name, or none. It is drawn in the box under the page's name, and it is what distinguishes a page from the pages it is merely about. See Types.
It is one string. A list here is an error rather than a page with several types, because a page is one thing.
Other fields
A data block may hold anything else you like. The wiki does not read them, and editing a page's tags or its type leaves them exactly as they were. One day they may mean something; today they are yours.
-