An onion tart appetizer so good it could ruin your appetite for the main course. (Edward Schneider for The Washington Post)

Then I went to the farmers market and saw a heap of cultivated hen of the woods mushrooms, which are a favorite of ours. As I said a while ago, they’re tender but not watery, a great combination for oven-cooking. And their fragrance is as woodsy as all get-out.

Having already cooked lots of sliced onions (I sometimes keep a container of cooked onions in the fridge, which saves time at the start of so many dishes, including braises and sauces) and having made a batch of pastry, I remained committed to the original plan of a tart. I simply needed to accommodate those beautiful mushrooms. There were various ways to do this. Perhaps the most obvious was to give them a quick saute, then combine them with the onions before spooning them into the tart shell. Or I could have gone a more quichelike route, with an oniony, mushroomy custard filling.

But thinking about how nicely hen of the woods roast, retaining their tenderness and gaining crisp edges, I realized all I really needed to do to show them off was to add a mushroom topping to the onions before baking.

The day before, while all those onions were slowly, slowly sweating in butter until very soft and sweet, I had made a basic pastry dough using 8 ounces of flour, a generous 5 ounces of chilled unsalted butter (cut into pieces), salt and cold water.

I set the oven to 400 degrees, rolled out the pastry and laid it into an 11-inch fluted tart pan (one inch deep, with a removable bottom). I lined the unfilled tart with aluminum foil and put it into the freezer to chill until the oven was hot. (This may be a superstition, but I have a notion that freezing the pastry prevents it from slipping down the sides of the pan when baking.)

When I was ready to bake, I filled the foil-lined tart shell with pie weights (dried beans in my case) and baked it for a little more than 10 minutes. I then removed the foil and weights, lowered the temperature to about 360 and baked the empty shell for another eight or nine minutes, until a pale crust had formed on its surface as a moisture barrier. While the shell baked, I added slivered sage leaves and two tablespoons of cream to a generous two cups of cooked onions. I cut the core from a hen of the woods (which was a plump ovoid shape, about 8 inches in length), then pulled the “florets” apart — the anatomy always reminds me of cauliflower. In a bowl, I seasoned the mushrooms with salt and pepper and drizzled them with good olive oil.

I removed the partly baked tart shell from the oven and filled it with the onions, spread in an even layer. I topped this with the mushroom “florets” and gently pressed them into the onions — not to submerge them so much as anchor them. The tart baked for around 40 minutes, filling the house with extraordinarily appetizing mushroom aromas. I unmolded it and left it to cool until just warmer than tepid.

The mushrooms did their job perfectly: The edges were brown and crisp. They were tender. They were intensely flavorful. And they mated perfectly with the onions.

We were six people around the table. This was a first course preceding a substantial main dish, so I initially served only half of the 11-inch tart. But even with a braised brisket in the offing, and even though guests are sometimes coy about their desires, everybody wanted a second helping. And not a crumb remained for a midnight snack.