only show doc output when we are successful
simplify the doc code