The Wave server stores and manages content. Content is stored in a page cache, called a site. A Wave server contains exactly one site. A site holds a collection of pages. A page is composed of cards. Cards hold content and data buffers.
To reference a site from within a Wave script, import
site is a dictionary-like object.
To reference the current site from within a Wave app, use
To reference a page hosted at
To reference the current page in a Wave app, use
page is also a dictionary-like object. To reference a card named
There are two ways to add a card to a page.
The first way is to assign a new card to
The second way is to use
page.add(). This is useful when you want to add a card to a page and obtain a reference to the new card.
The following two forms are equivalent. The second form is more concise.
To delete a card named
foo from a page, use
Assigning a card to
page['foo'] replaces any previously assigned card named
foo. Therefore, the following two forms are equivalent. The second form is more concise, hence preferred.
To save a page from within a Wave script, use
To save the active page from within a Wave app, use
q.page.save() is an
async function, so you must
await while calling it.
You don't need to explicitly create a new page. A page is automatically created on save if it doesn't exist.
To delete the page hosted at
del site['/foo']. The following three forms are equivalent.
Deleting a page automatically drops all cards associated with that page. Conversely, to delete all cards from a page, simply delete the page.
To clear all cards in the active page from within a Wave app, use
To update other (non-app) pages from within an app, use