The man who authorities say tried to carry out a mass shooting in Yellowstone National Park last year spewed racist views months before his attempted attack, prosecutors said in court documents.