add html output format. new problem comes out, when should it generate the output html?