Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Quick Guide

Justin Pombrio edited this page Aug 27, 2013 · 8 revisions

Escapes out of plain text have one of the formats:

@(e1 e2 ...)      // Notice the parens. This calls out to arbitrary racket code.

@id{              // There cannot be a space before the '{' !
  ...
}

@id[e1 e2 ...]{      // Some functions take extra arguments wrapped in square brackets.
  ...
}

Look through the examples to see how various tags are used, but here is an ad-hoc list:

Each .jrny file must begin with at least the following,

@(require ct-scribble/ct-lib)
@journey{some-unique-name}
@title{The Assignment Title}

The title will be displayed at the top of the page. The journey name will be used as a database key; it will never be seen, and simply has to be unique.

Scribble has many general purpose markup functions. See (http://docs.racket-lang.org/scribble/)

@tt{text} @italic{text} @bold{text} @section{section header}
@itemlist[
   @item{some text}
   ...
]

Display Pyret code in-line:

@inline-example{pyret-code}

Displays a block of Pyret code on its own line (use 'inert for code that can be run, or 'no-run for code that has no run button):

@code-example['inert]{
   pyret-code
   ...
}

Not sure what this is:

@justcode{
  some code?
}

The big editor with code in it is produced by a call to @code-assignment. It is called like this:

@code-assignment["4556ddd2-fef8-11e2-8e32-222222222222" 2]{
  @name{Quicksort}
  ...
}

The first argument in the square bracket is a unique id for database use. It must be in base-64. The second number is the number of reviews each student will be given. Several functions may be called from within a @code-assignment. The @name will show up in error messages, and in the future will be shown at the top of the editor.

Here are some special functions that may appear only in an @code-assignment:

@instructions{
  some inline instructions.
}
@library-part["list-defn"]{
  some pyret code
}
@fun-part["append"]{
  @header{append(list1 :: List, list2 :: List) -> List}
}

@library-code makes static, editable code. @fun-part makes an editable function with the type signature given in @header. The bracketed argument to fun-part should be a short, human-readable name. It is shown in the submit button, e.g. "submit append".

Clone this wiki locally