DAISY—Structure Guidelines: Elements, Block Elements, Information Object Computer Code

DAISY—Structure Guidelines: Elements, Block Elements, Information Object Computer Code

Information Object

Computer Code

Definition

Computer code is the rendering of a computer programming language.

Markup

Computer code, which may be displayed in a print book in a monospaced font such as Courier bold, is marked with the <code> tag. This tag can be used in either block or inline settings. See also Information Object: Keyboard Input and Information Object: Sample.

Syntax

<code>…</code>

Example

<p>This is an example of drawing and rotating a square using the "o" key.</p>

<code>

case "o":

glBegin(GL_QUAD_STRIP)

for(i=0;i&lt;=12; i++) {

angle = 3.14159 / 6.0 * i;

glVertex2f(0.4 * cos(angle), 0.4 * sin(angle));

glVertex2f(0.5 * cos(angle), 0.5 * sin(angle));

}

glEnd();

break;

</code>

Tags: DAISY