[doc] fix code example generation

fix #466