fix(doc-gen): correctly transform index files

@matsko I think this is a fix but have not written tests