Skip to content

"Adding Functionality": Chapbook (v1.0.0)#

Summary#

Chapbook allows for creation of custom inserts and modifiers.

The example below adds an insert that displays a 😀 emoji.

Example#

Download Example

Twee Code#

:: StoryTitle
Adding Functionality

:: UserScript[script]
engine.extend('1.0.0', () => {
    config.template.inserts = [{
        match: /^smiley face$/i,
        render: () => '😀'
    }, ...config.template.inserts];
});

:: Start
Hello there {smiley face}

Download Twee Code