Move doc generation code to external repositories

These are local for now, but will soon be published on npm.