Gentleman and Lang published a very interesting paper in 2004 that presented a software framework for authoring integrated dynamic documents which are reproducible. The basic idea presented in their paper is to think of a document as a compendium that consists of text, data, code and auxilliary libraries that can then be transformed into arbitrary output views in different formats.
They define a compendium as
as both a container for the different elements that make up the document and its computations (i.e. text, code, data, . . .), and as a means for distributing, managing and updating the collection.