On this page:
atom?
annotation?
end-annotation
write-file

1.11 Manipulating Simple HTML Documents: "docs.rkt"

 (require htdp/docs)

The teachpack provides three functions for creating simple “HTML” documents:

Annotation An Annotation is a symbol that starts with “<” and ends in “>”. An end annotation is one that starts with “</”.

procedure

(atom? x)  boolean?

  x : any/c
Determines whether or not a value is a number, a symbol, or a string.

procedure

(annotation? x)  boolean?

  x : any/c
Determines whether or not a symbol is a document annotation.

procedure

(end-annotation x)  Annotation

  x : Annotation
Consumes an annotation and produces a matching ending annotation.

procedure

(write-file l)  true

  l : (list-of atom)
Consumes a list of symbols and annotations and prints them out as a "file".

Sample session: set teachpack to "docs.rkt" and click Run:
> (annotation? 0)
false
> (annotation? '<bold>)
true
> (end-annotation 0)
end-annotation: not an annotation: 0
> (write-file (list 'a 'b))
a b