#lang scribble/doc @(require scribble/manual) @title{Annotated Code Boxes} @(author+email "Jordan Johnson" "jmj@fellowhuman.com") This package implements annotated code chunks in DrScheme. It allows you to write an expression, annotate it, and hide the code so that your expression is visually represented by a box containing only the annotation. @section{Creating Annotated Code} Installing this package adds two items to the DrScheme menu system, allowing you to insert annotated-code boxes and annotate selected code. @subsection{Inserting Annotated Code Boxes} On the @bold{Insert} menu, this package adds an item @bold{Insert Annotated Code Box}, which inserts a box at the current cursor position. @subsection{Annotating Existing Code} On the @bold{Scheme} menu, this package adds an item @bold{Annotate this Code}, which behaves as follows: @itemize{ @item{If text is currently selected (highlighted) in the active editor, the selected text will be replaced by an annotated-code box containing the text in its upper editor (the code editor).} @item{Otherwise, if the cursor is inside an S-expression, the enclosing S-expression will be replaced by an annotated-code box containing the expression in its code editor.} } @section{Manipulating Annotated Code} Once created, an annotated-code box behaves somewhat similarly to a comment box. It will be evaluated as an expression in the context of the surrounding code, and the Tab and Shift-Tab keystrokes allow movement between the two fields. At the left side of each annotated-code box the word "expr" appears. If the last edit inside the box left one or more complete expressions in the box's code editor, "expr" will be blue; if not, it will be red. Right-clicking this "expr" produces a menu that allows hiding and showing the code editor, and converting the annotated-code box to plain Scheme source text (with or without including the annotation as a Scheme comment).