-
Notifications
You must be signed in to change notification settings - Fork 0
Basic usage
8ball is a simple scripting language written in Java and ANTLR designed to generate MSPA-esque webpages.
8ball's language structures consist of statements and blocks.
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")
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 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