Order doc parameters and outputs based on template ordering