Monitoring the thermodynamically-controlled formation of diimide-based resin-attached rotaxanes by gel-phase HR MAS 1H NMR spectroscopy.