fix(doc-gen): correctly transform index files

Closes #3021