Put a large pan of salted water on to boil. Tip the raisins into a heatproof bowl and pour over enough boiling water to cover them. Leave to soak for 5 mins, then drain them.
Put a dry wok or deep frying pan on a medium heat and add the pine nuts. Toast for 2-3 mins, shaking the pan, till the pine nuts are golden. Tip onto a plate and set aside.
Peel and finely chop the onion. Put the frying pan back on a medium-low hat. Add 1 tbsp oil and the onions. Season with a pinch of salt and pepper. Gently cook for 10 mins till the onions are soft, golden and caramelised. Keep the heat fairly low so they cook slowly - this will get the best flavour from your onion.
While the onion cooks, trim the dry ends off the rainbow card stalks and finely slice the stalks. Shred the leaves and set them to one side. Halve the chilli. Scoop out the seeds and white pith for less heat, then finely chop it. Finely grate the zest from the lemon.
The water should be boiling by now, so add the pasta to the pan. Simmer for 8 mins till the pasta is cooked but still has some bite.
When the onion is golden, add the chard stalks, chilli and most of the lemon zest to the pan. Cook for another 4 mins to soften the chard stalks.
Stir the chard leaves into the frying pan and add the raisins and most of the pine nuts. Cook and stir for a couple of mins till the leaves start to wilt.
Drain the pasta and add to the frying pan. Toss to mix. Taste and add a pinch more salt and pepper if you think it needs it. Scoop the pasta into warm bowls and top with 1 tbsp ricotta each, the remaining lemon zest and pine nuts to serve. Serve with lemon wedges to squeeze over to taste.