A method generates a document by: inserting one or more placeholders in
the document; binding each placeholder to a content source; and compiling
the placeholders into code to generate content for the document based on
the content source. The method then executes the code to generate the
content and presenting the content of the document if in a presentation
mode or restores the placeholder if in an edit mode.