Skip to content
This repository has been archived by the owner on Sep 7, 2019. It is now read-only.

Basic usage

Daniell Stuhlmeier edited this page Mar 30, 2017 · 1 revision

8ball...

in a nutshell:

8ball is a simple scripting language written in Java and ANTLR designed to generate MSPA-esque webpages.

in action:

8ball's language structures consist of statements and blocks.

Statements

Here's what a statement looks like:

name parameters properties

The text statement is the simplest kind. It looks like this:

text "Hello World!"

Statements can also have properties. A property consists of a name followed by a value, separated by a colon.

Example:

name: "Foo"

A property set is denoted by a set of parentheses containing comma-separated properties.

Example:

(name: "Foo", width: 300)

Let's see all of these in action:

image "test.png" (width: 500, alt: "Missing image")

Block statements:

A block statement comes after a "normal" statement. It begins with a colon (:) and ends with (end). Block statements contain other normal statements - an example is the log block, which contains log statements:

log "Pesterlog" (colors: default):
    AG: "Hello, world!" <-- this is a log statement
end

The most important block statement is probably page. This defines an HTML page.

The page block

The page block accepts one property, namely title, which will be the page title. page can also be followed by an identifier to give it a unique name, which will also be used for the generated HTML file. If no identifier is specified, the page will be named page[index]. The identifier can not be the word "page" followed by a number.

page start (title: "My first page"):
    text "Hello!"
    ...
end
Clone this wiki locally