[#2] Write generated HTMLs into the temporary directory and remove them after flushing.