generate referenced root documents

support for generating referenced root documents just like partials.

fixes #31