Improve the gendocs script