make doc output to sdout or in a designated file