Text this: Optical and electronic properties of defective semiconductors from first principles calculations