NojoTalk Markup Language

[ Home ]

NTML files are the Nojotalk equivalent of HTML files. Every Nojotalk project includes at least one NTML file, and all NTML files of a given project are located in the project's root directory or its subdirectories. In general, an NTML file consists of either an object or an array. An array consists of a list of zero or more values, separated by white space and enclosed in parentheses. The open parenthesis is followed by the keyword list. In the case of a concatenation array, the open parenthesis is followed by a plus sign (+) instead of a keyword, and all array elements are strings concatenated together.

An object consists of a list of zero or more pairs, separated by white space and enclosed in parentheses. The open parenthesis is followed by the keyword pairs. Each pair is enclosed in parentheses and consists of a string literal followed by a value. A value can be one of the following: an object, an array, a string literal, a number, or a constant keyword. An object having a "tag" pair equal to "script" can also have a "text" pair with a value consisting of a Nojotalk block (zero or more statements), which is always enclosed in parentheses. The value of a "type" pair is often a widget type. Examples of widget types include "button" and "checkbox". If the value of a "tag" pair is a string literal beginning with a forward slash, then that object serves to terminate the matching object without the forward slash (which lacks a "text" pair).

A constant keyword is one of the following: true, false, null. A string literal is delimited with single or double quotes, and uses the backslash as its escape character. Multi-line string literals are delimited with 2 double quotes ("") at both ends. Numbers can be integers or floating point. Floating point numbers may be in scientific notation. All tokens except parentheses must be separated by white space.

A top-level NTML file consists of an object containing 2 pairs: "head" and "body". The value associated with each pair is an array. One of the values in the "head" array might be an object with a "tag" pair equal to "title" and a "text" pair equal to a string literal consisting of the title of its NTML file. Another possible value in the "head" array might be a reference to a Nojotalk file. All user-defined functionality is written in the Nojotalk built-in scripting language. Here is a sample top-level NTML file:

(pairs
  ("head" (list
     (pairs
       ("tag" "title")
       ("text" "Sample NTML file")
     )
  ))
  ("body" (list
    (pairs
      ("tag" "h1")
      ("text" "Sample NTML file")
    )
    (pairs
      ("tag" "p")
      ("text" "Here is the body text.")
    )
  ))
)
[ Back to Top ]