Text this: Controlled compression, amplification and frequency up-conversion of optical pulses by media with time-dependent refractive index