Skip to main content Svelte Highlight v7.21.1

Yarn Spinner language preview

1. A basic node with choices

header, node delimiters, options, and commands
horizon-dark
title: Start
tags:
---
Guard: Halt! Who goes there? #line:abc123
-> Explain yourself
    <<jump Explain>>
-> Attack
    <<set $fought to true>>
    <<if visited("Fight")>>
        You've fought before.
    <<endif>>
===

title: Explain
---
Traveler: I mean no harm, {$player_name}.
[wave]Just passing through.[/wave]
===
atom-one-dark
title: Start
tags:
---
Guard: Halt! Who goes there? #line:abc123
-> Explain yourself
    <<jump Explain>>
-> Attack
    <<set $fought to true>>
    <<if visited("Fight")>>
        You've fought before.
    <<endif>>
===

title: Explain
---
Traveler: I mean no harm, {$player_name}.
[wave]Just passing through.[/wave]
===
github-dark
title: Start
tags:
---
Guard: Halt! Who goes there? #line:abc123
-> Explain yourself
    <<jump Explain>>
-> Attack
    <<set $fought to true>>
    <<if visited("Fight")>>
        You've fought before.
    <<endif>>
===

title: Explain
---
Traveler: I mean no harm, {$player_name}.
[wave]Just passing through.[/wave]
===
dracula
title: Start
tags:
---
Guard: Halt! Who goes there? #line:abc123
-> Explain yourself
    <<jump Explain>>
-> Attack
    <<set $fought to true>>
    <<if visited("Fight")>>
        You've fought before.
    <<endif>>
===

title: Explain
---
Traveler: I mean no harm, {$player_name}.
[wave]Just passing through.[/wave]
===
nord
title: Start
tags:
---
Guard: Halt! Who goes there? #line:abc123
-> Explain yourself
    <<jump Explain>>
-> Attack
    <<set $fought to true>>
    <<if visited("Fight")>>
        You've fought before.
    <<endif>>
===

title: Explain
---
Traveler: I mean no harm, {$player_name}.
[wave]Just passing through.[/wave]
===
github
title: Start
tags:
---
Guard: Halt! Who goes there? #line:abc123
-> Explain yourself
    <<jump Explain>>
-> Attack
    <<set $fought to true>>
    <<if visited("Fight")>>
        You've fought before.
    <<endif>>
===

title: Explain
---
Traveler: I mean no harm, {$player_name}.
[wave]Just passing through.[/wave]
===

2. Variables and declarations

<<declare>>, function calls, and inline expressions
horizon-dark
title: Setup
---
<<declare $gold = 0 as number>>
<<declare $has_met_wizard = false as bool>>

You have {$gold} gold pieces.
<<if $gold > 10>>
    That's quite a lot!
<<endif>>

Random roll: {dice(6)}
===
atom-one-dark
title: Setup
---
<<declare $gold = 0 as number>>
<<declare $has_met_wizard = false as bool>>

You have {$gold} gold pieces.
<<if $gold > 10>>
    That's quite a lot!
<<endif>>

Random roll: {dice(6)}
===
github-dark
title: Setup
---
<<declare $gold = 0 as number>>
<<declare $has_met_wizard = false as bool>>

You have {$gold} gold pieces.
<<if $gold > 10>>
    That's quite a lot!
<<endif>>

Random roll: {dice(6)}
===
dracula
title: Setup
---
<<declare $gold = 0 as number>>
<<declare $has_met_wizard = false as bool>>

You have {$gold} gold pieces.
<<if $gold > 10>>
    That's quite a lot!
<<endif>>

Random roll: {dice(6)}
===
nord
title: Setup
---
<<declare $gold = 0 as number>>
<<declare $has_met_wizard = false as bool>>

You have {$gold} gold pieces.
<<if $gold > 10>>
    That's quite a lot!
<<endif>>

Random roll: {dice(6)}
===
github
title: Setup
---
<<declare $gold = 0 as number>>
<<declare $has_met_wizard = false as bool>>

You have {$gold} gold pieces.
<<if $gold > 10>>
    That's quite a lot!
<<endif>>

Random roll: {dice(6)}
===

3. Markup and hashtags

character lines, markup tags, and line hashtags
horizon-dark
title: Market
---
Merchant: [wave]Welcome, friend![/wave] #line:m001
Merchant: [nomarkup]Prices are non-negotiable.[/nomarkup] #lastline
-> Buy an apple
    <<call give_item("apple")>>
===
atom-one-dark
title: Market
---
Merchant: [wave]Welcome, friend![/wave] #line:m001
Merchant: [nomarkup]Prices are non-negotiable.[/nomarkup] #lastline
-> Buy an apple
    <<call give_item("apple")>>
===
github-dark
title: Market
---
Merchant: [wave]Welcome, friend![/wave] #line:m001
Merchant: [nomarkup]Prices are non-negotiable.[/nomarkup] #lastline
-> Buy an apple
    <<call give_item("apple")>>
===
dracula
title: Market
---
Merchant: [wave]Welcome, friend![/wave] #line:m001
Merchant: [nomarkup]Prices are non-negotiable.[/nomarkup] #lastline
-> Buy an apple
    <<call give_item("apple")>>
===
nord
title: Market
---
Merchant: [wave]Welcome, friend![/wave] #line:m001
Merchant: [nomarkup]Prices are non-negotiable.[/nomarkup] #lastline
-> Buy an apple
    <<call give_item("apple")>>
===
github
title: Market
---
Merchant: [wave]Welcome, friend![/wave] #line:m001
Merchant: [nomarkup]Prices are non-negotiable.[/nomarkup] #lastline
-> Buy an apple
    <<call give_item("apple")>>
===