A man is in custody charged with terrorism offences after police found a disturbing diary allegedly detailing plans for a terrorist attack.