Skip to content

Instantly share code, notes, and snippets.

@Zokhoi
Last active October 26, 2022 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zokhoi/06dbc890a4f2fab3eadcd7d2ed0d8698 to your computer and use it in GitHub Desktop.
Save Zokhoi/06dbc890a4f2fab3eadcd7d2ed0d8698 to your computer and use it in GitHub Desktop.
FTML Format Specifications (draft)

FTML Format Specification v1.0 draft

Foundation Text Markup Language

(Alternatively, ftml: the markup language)

This document contains the specification of FTML, a file format created to store source code of pages on Wikidot that contains the essential information to recreate the page.

1. Encodings and Meta

The requirements for encodings and meta of the file format are:

  • The file may use any of CRLF or LF end of line schemes.
  • The file should use the UTF-8 encoding scheme.
  • The file may use any of .ftml, .wd, .wj, .wikidot or .wikijump as the file extension. The recommended file extension is .ftml.

2. Front Matter

The format designates an optional Front Matter section at the beginning of the file to provide information about the metadata of the page, such as

  • Wikidot site
  • page name
  • title
  • tags
  • parent page
  • revision number

etc.

It is highly recommended to use the YAML Front Matter format in the Front Matter section.

If the Front Matter section is included, the section can contain any information deemed useful. However, some keys that are commonly used are:

Key Type Description
site string The Wikidot site that the page is in. It can be the entire URL of the site, including the URI scheme; or only the namespace of the site within Wikidot. If a Wikidot site can be accessed at https://example.com and https://example-wiki.wikidot.com, the value to this key can be https://example.com, https://example-wiki.wikidot.com or example-wiki.
page string The kebab-case path portion of which the page exist on the Wikidot site. If a page can be accessed at https://example-wiki.wikidot.com/example-page, the value to this key is example-page.
title string The page title. This is distinct from page ("page name"), which is the URL path to access the page.
tags string or string[] The page tags. This can be a space-separated list of tags, or an array that contains the individual tags.
parent string The parent page name of which the page is a child. If https://example-wiki.wikidot.com/child-page is a child page of https://example-wiki.wikidot.com/parent-page, the value to this key in the file that represents https://example-wiki.wikidot.com/child-page should be parent-page.
revision integer The incremental revision number, starting from 0 at page creation.

3. Page Source

The format designates the Page Source section as the entire portion after the optional Front Matter section. This section contains the source code of the page in a custom markup language used by Wikidot, which we deem the "wikitext".

The wikitext is a modified and simplified version of HTML. A reference implementation of a wikitext parser can be found here, which is available under the terms of GNU Affero General Public License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment