The Fifth World

Parse

This endpoint returns the result from parsing a given string.

Request

Body Parameters
Query Parameters Value
str The string to parse.
path Sometimes, which page does the parsing will affect the outcome. For example, the {{Children}} template looks for the children of the current page by default. This string provides the path to use in these cases.

Examples

Example Request
POST /v1/parse HTTP/1.1 Host: api.thefifthworld.com str=[[Animism]]

Response

The endpoint should always respond with a 200 HTTP status and a JSON object. The object has four properties: orig (the original string you provided to parse), html (how the API will parse that string), links (an array of link objects that the parser found in the string), and tags (the tags that the parser identified in the string).

JSON Object
Property Value Type Value
orig string The original string that you passed to the endpoint.
html string The HTML that the API parses from that string.
tags object The tags parsed from the string, given as key/value pairs, meaning that each tag name becomes a property of the tags object, with its value set to the value of that tag. For example, [[Tag:Example]] would provide a tags object of { Tag: 'Example' }
links Link[] An array of link objects derived from the parsed string.
Link Object
Property Value Type Value
text string The text used in the link.
title string The title of the linked page. This will equal text if the page does not yet exist, or if the string did not specify any other text for the link.
id number|null The unique ID number of the linked page. This will equal null if the page does not exist yet.
path string The unique path of the linked page.
isNew boolean A boolean that equals true if the page does not yet exist.

Example

Example Response
{ "orig": "[[Animism]]", "html": "<p><a href=\"animism\">Animism</a></p>\n", "tags": {}, "links": [ { "text": "Animism", "title": "Animism", "id": 130, "path": "/animism", "isNew": false } ] }