add genhtml function.