Elements


Standard elements are included out-of-the-box in the Wordscript distribution.

Elements are scopes with a tag. For example [[@ ]] is an attribute element and [[section]] is a section element.

Metadata

Attribute

tag: @

content: style blocks, elements, single-line comments

Sets attributes for the surrounding or internal scope.

See Attributes for details.

Lookup

tag: $

content: keys to lookup (space separated)

Retrieves attributes and system properties for the current scope. Keys can have a namespace

The current date and time is [[$ system.datetime ]]

Organization, Structure, and Scope

Section

tag: section

value: id content: properties

Location

tag: location

value: areas and inherited areas

content: properties

Import

tag: import

Import parsed Wordscript fragments

Include

tag: include

Include Wordscript content verbatim

Embedded Content

Text (Dialogue)

tag:

value: mixed

content: mixed

Any text outside of other elements, in the global scope, is considered to be a text element.

Within an attribute element, dialogue text must placed be inside a text element.

Whitespace

tag: _

content: only whitespace characters

All whitespace content will be preserved. Whitespace includes the first space following the tagname.

[[_]] no space
[[_ ]] one space
[[_  ]] two spaces
[[_\\n]] new line
[[_
]] new line

The whitespace element contributes whitespace in addition to the normalized whitespace outside the element.

Hello [[_ ]] World = Hello   World (3 spaces)
Hello[[_ ]]World = Hello World (1 space)

Source Code

tag: 3 backticks

value: [language] [unparsed text]

content: none

The source code element requires a named closing element. This allows writing unescaped Wordscript.

[[```
This is [[b Wordscript]] [[u source code ]]
 ```]]

HTML

tag: html

Specify content as HTML

Markdown

tag: md

Specify content as Markdown

Expression

Bold

tag: b

value: [text to format]

content: b,i,u,strong,em

bold text / strong and pronounced speech

Strong

tag: strong

value: [text to format]

content: b,i,u,strong,em

bold text / strong and pronounced speech

Italic

tag: i

value: [text to format]

content: b,i,u,strong,em

italic text / emphasized speech

Emphasize

tag: em

value: [text to format]

content: b,i,u,strong,em

italic text / emphasized speech

Underlined

tag: u

value: [text to format]

content: b,i,u,strong,em

underlined text

Itemizing

Bullets and Lists

tag: *

content: bullet item text

The bullet tag specifies a list of items. The system will add commas and conjunctions as needed.

Keyword

tag: kw

content: text

Specifies a keyword

Media Targeting

Print Only

tag: print-only

Audio Only

tag: audio-only

Video Only

tag: video-only

Code Only

tag: code-only

Ignore

tag: - | ignore

value: any

content: any

Ignores all elements and dialogue

Comment

tag: #

value: [unparsed text]

content: any

Comments are not rendered as media. They can be used as internal messages.

Media Control

Pause

tag: pause

value: [duration in milliseconds]

content: none

Wait for the indicated period of time

Play

tag: play

Play specified media

Stop

tag: stop

Stop playing specified media

Interaction

Prompt

tag: prompt

Wait Until

tag: wait-until

Navigation

Anchor

tag: a

value: [url] [label]

content: none

A link to a resource

Target

tag: target

content: The identifier of the target

content: none

A linkable point in the dialogue.

Goto

tag: goto