Templated folding of intrinsically disordered proteins