Table of Contents
Usage#
Basic Usage#
You can embed an Orc program like this:
[{orc -- your program here ... }]
Note the empty line before your program: it is mandatory!
Parameters#
You can refine the way the program is rendered using parameters. Parameters are placed after the opening [{orc tag and look like paramName='value'. The following parameters are available:
- runnable: if runnable='false', program is not runnable.
- editable: if editable='true', program is editable.
- height: a CSS height (e.g. height='100px'). If this is not given, the box will be just big enough to contain the existing program text.
- spoiler: if present, this text will appear instead of the program. The user can click it to reveal the program. E.g. spoiler='(click for solution)'.
For example, to create an editable, fixed-height embedded program to be editable, use this syntax:
[{orc editable='true' height='300px' -- your program here ... }]
Hidden code#
You can hide parts of your program by putting the text {- EXAMPLE -} on the lines before and after the visible part of the program. This is useful to include a prelude or postlude which is necessary to make the program run correctly but otherwise irrelevant. For example:
[{orc -- unimportant definition def add(a,b) = a + b {- EXAMPLE -} add(3,4) {- EXAMPLE -} ; "We just added 3 and 4" }]