Melt the butter in a large pot over a medium heat. Add the onions, honey and rosemary and sauté, stirring frequently, for about 10 minutes, until the onions become tender and start to colour. Season with salt and pepper, remove the onions from the heat and add the balsamic vinegar.
Cut squares into the puff pastry and place each sheet on a baking tray. Top with red onion confit, leaving 2cm of dough uncovered around the edges of the pastry. Top each square with one or two anchovies and a few pine nuts and bake in the oven for 15 to 25 minutes, until the pastry has puffed up, turned golden and crisped.
Remove from the oven, drizzle a little olive oil over each tart and scatter with fresh thyme leaves. Serve warm or at room temperature.