Goblin REPL
Because Sheriff is written in the Goblin programming language (it was made to host the Goblin documentation), it comes with an embeddable Goblin REPL you can use in any page. A REPL (Read-Eval-Print Loop) is an interactive computer programming environment that takes single user inputs, executes them, and immediately returns the result.
You get it for free because Sheriff uses the Goblin REPL glam (a packaged module).
What is a REPL
A REPL (say it, “REP-UL”) is an interactive way to talk to your computer in a given programming language. To make this work, the computer does four things:
- Read the user input (your commands).
- Evaluate your code (to work out what you mean).
- Print any results (so you can see the computer’s response).
- Loop back to step 1 (to continue the conversation).
Embedding the REPL
You can add a Goblin REPL into any page of content, right out of the box. All you have to do is use the Goblin REPL token.
Try it in the REPL: {{{GOBLIN_REPL::EMBED}}}
Try it in the REPL: {{{GOBLIN_REPL::EMBED}}}
While most of the tokens Sheriff provides are for layout slots, this is a special token you can use right inside your content. The code above produces the following output:
Try it in the REPL:
Try typing :say("Welcome to the Horde!") and pressing run!