When Charles de Gaulle grumbled about the difficulty of governing a nation with 246 different cheeses, someone should have put him on a flight to India, to experience some real complexity - the kind where the entire culinary cosmos, not just one lump of dairy, changes every few train stations.

There is no such thing as Indian cuisine. Every region has its own distinct traditions. Brahmins in the south and some other regions will not tolerate onions or garlic in their dishes. For a north Indian, making a good gravy-based dish without onions and garlic is as impossible as trying to reconstitute an egg yolk once it has been broken.

Much of this regional cuisine has featured in cookbooks. The culinary traditions of the royal families have also been chronicled, with one writer, Salma Husain, even using museum archives to recreate dishes served to the magnificent Mughals.

But a new kind of Indian cookbook is becoming the flavour du jour; those that document the food eaten by particular castes or communities.

Recipes based on caste may strike a foreigner as strange, possibly regressive, but strict social stratification remains a reality in India, along with precise and unbending rules that have evolved over the millennia concerning the food that can be eaten by various groups.

Like the caste system itself, the food rules constitute an immense and informal codification whose only raison d'etre appears to be the classification of Indians into "higher" and "lower" categories, with infinite gradations up and down the food chain.

Recipes for the dishes eaten by a specific caste used to be transmitted seamlessly, due to several generations living together in extended families. Today, as young Indians leave home to study or for work, this oral tradition is weakening.

When young women marry and enter the home of their husband and in-laws, they are expected to cook the dishes in the family repertoire. If they haven't learnt to cook them under their mother's tutelage, the dal can hit the fan.

That is the situation in which Vijee Krishnan, co-author of Why Onions Cry: Peek into an Iyengar Kitchen with Nandini Sivakumar, found herself after marriage. She could not prepare the food eaten by her caste, the Iyengar Brahmins in Tamil Nadu, south India, because she had lived in Delhi for many years, away from her mother.

The problem was that her husband was also an Iyengar Brahmin and lined up behind him were a phalanx of matriarchs in starched cotton saris who wanted to see if the new bride could cut the mustard.

"Everyone assumed I could put out a traditional Iyengar spread of a dozen vegetables, rice, pickles and condiments. I knew how to cook Brahmin food but not the nuances of Iyengar Brahmin cuisine. I had to learn fast from my mother-in-law and her mother," says Krishnan.

The title of her recently published book is a nod to the fact that Iyengar Brahmins, passionately vegetarian, abhor onions and garlic. In their world view, influenced by traditional Ayurvedic beliefs, the root vegetables that you and I may think of as being humble, are viewed as foods that stimulate the baser passions, such as anger and lust. (And from this belief, it is only one logical skip to believe, as many Hindus do, that Indian Muslims, qua meat-eaters, are bloodthirsty and carnal - but let's not go there …)

I used to think Brahmin food would be bland until I tasted it; it is utterly delicious, presumably because some magical combination of spices compensates for the absence of onions and garlic.

The rituals that attend the preparation of Iyengar Brahmin food are elaborate. The person cooking cannot enter the kitchen without having bathed and put on fresh clothes.

"No processed foods are allowed. Only locally sourced vegetables are used for cooking, a rule that long predates the modern trend for local sourcing of ingredients," says Krishnan.

The Iyengar Brahmins shun leftovers. Nor do they eat sugar, preferring jaggery (concentrated date, cane juice or palm sap). No meal can begin without making an offering to the gods, by placing a smidgen of every dish that has been cooked on a platter as a mark of self-surrender and devotion.

"It's not just the bathing and the clothes. You also have to be in a suitably pure and peaceful frame of mind before cooking," says Mrinalini Mehra, a novelist who lives in New Delhi and a Saraswat Brahmin from Maharashtra. She has the classic grey-bluish eyes and honey-coloured skin of Saraswat Brahmin women, who are famed for their beauty.

Mehra was raised in this Apollonian ambience and grew to dislike it. She felt suffocated by these rituals and her parents' attitude towards food.

"You grow up learning you cannot relish your food or eat it as though you were enjoying it. That was regarded as crude. Everything we did had to be ultra-refined, so we ate as though we were doing penance, with no enjoyment," she says.

Mehra ran from this ethereal atmosphere into the arms of a man from Punjab, a community famous for its Dionysian love of excess, including that of food with big, bold, rustic flavours - but that is another story.

As so many of the recent high-caste vegetarian cookbooks will tell you, meat is repugnant to Saraswat and Iyengar Brahmins. A common assumption outside India is that all Hindus are vegetarians. Many Hindus are indeed vegetarian but many, including Brahmins, eat meat.

In fact, for the warrior castes, meat was an important part of their diet, vital in building the physical strength needed for battle. It is the belief of one high-ranking caste, the Kayastha, that vegetarianism is for rabbits.

A meal without at least one mutton dish is a disaster for Kayasthas. The cuisine of this caste has been documented by Preeta Mathur in The Courtly Cuisine: Kayastha Kitchens Through India. She explains how, by virtue of being the administrators and ministers under Mughal rule, this community's cuisine came to be influenced by the meat-loving emperors.

Their appetite was legendary. In Dining with the Maharajas, published by Roli Books, it is said that Mughal emperor Jahangir had a weakness for a dish that required 100 chickens, all of which had to have been fed a diet of saffron - the most expensive spice in the world - for at least a year.

Kayastha food, says Mathur, still retains this richness, relying on aromatic sauces and techniques learnt from the Mughals, including dungar. This method requires placing a couple of pieces of smouldering charcoal in a small metal bowl. Aromatic spices such as cloves are then added and a drop of ghee is poured over them. As the ghee sizzles and smokes, the bowl is quickly placed into a "well" created in the main ingredients of the dish. The whole thing is then covered with a lid, allowing the heated aromatics to impart a lovely smoky flavour to the dish.

Mathur learnt the cuisine from her mother but realised, when her daughter-in-law began calling her to ask for recipes, that no one was preserving the knowledge. She jumped at the suggestion by Priya Kapoor, editorial director at Roli Books, to make a collection of Kayastha recipes.

"One reason for this new genre of books is the desire to collect and record these recipes before they die out and to preserve this heritage," says Kapoor. "Brides are not taking these recipes into their new homes so these traditions are being lost. Also, these books simplify the cuisine to suit modern needs. No one has the time to spend hours cooking dal over a slow charcoal fire."

Hours? It used to take Mathur's mother three days to prepare a sumptuous spiced raan (leg of mutton): the first to pound the whole spices; the second to put the leg through not one but two marinations; and the third to cook the darned thing.

Feasts in rich Kayastha families often included a shabdeg (mutton with turnips) that would cook for two days in an oven constructed in a dug-up pit outside the house.

Both Mathur and Krishnan have simplified these elaborate recipes, originating from a time when an army of liveried servants could slave away, and adapted them to suit lifestyles in which the only sous-chef available to a couple is their microwave.

Other books in this genre, The Konkani Saraswat Cookbook, by Asha S. Philar, Kashmiri Cuisine Through the Ages, by Sarla Razdan, and My Bombay Kitchen, by Niloufer Ichaporia King, also try to simplify traditional dishes, each of which has a list of ingredients as long as a spatula.

For food writer Antoine Lewis, these new books are a glossier continuation of "community cookbooks", which go back several decades. These were collections of recipes privately published and circulated within a community - Anglo-Indians, Iyer Brahmins, Syrian Christians, Ismaili Muslims, Parsis, Jains, Saraswat Brahmins, the Chettinads and the Lingayats - and handed over as "bibles" to new brides.

Writing in the Hindustan Times newspaper, Lewis notes, however, one difference between the modern variety of caste and community cookery books and the earlier private publications: "Since the older ones were for a closed audience, they were initially written in the vernacular and only subsequently translated into English. The modern books are written for a national and international audience and are published in English."

To reach a wider audience, Krishnan has added non-south Indian ingredients, such as mozzarella, to some of her dishes.

IF THE HINDU CASTESYSTEM has been rigid throughout history, the dietary habits of each caste have been equally immutable. You are what you eat is a simple dictum except in India, where it means much more.

What you eat dictates who you marry, where you live, your job, your social status, whether you are "dirty" or "clean", whether you are entitled or deprived, and whether you can hold your head high or let it hang in shame, because the food you eat is a function of your caste.

Readers may be murmuring that I am overegging the pudding. It is not an exaggeration. If the caste rules around food are broken, they can trigger riots. If a Dalit (a so-called untouchable) walks into the kitchen of, say, a Tamil Brahmin, he or she will "pollute" it and the entire kitchen will have to be washed.

A high-caste person can only accept food or a drink from someone of a similar rank. If the food has been touched or cooked by someone of a lower caste, it must be rejected. When an upper-caste person gives food to someone of a lower caste, it is always dropped, rather than placed, in their hands, to avoid any contamination.

Between castes, the rules on food are fraught; imagine then, what happens when the diametrically opposed eating habits of Hindus and Muslims clash. Food is a political hot potato. For centuries, the time-honoured technique for sparking a Hindu-Muslim riot has been to throw a pig's head into a mosque or dump a dead cow outside a Hindu temple.

Even today, food habits are used as a tool of social exclusion. Rich, upper-caste Hindu landlords in Mumbai housing complexes use vegetarianism to keep out lower-caste tenants (and Muslims, too, of course) by specifying that flats can only be let to vegetarians.

Interestingly, the cookery books in this genre have only documented the cuisine of the upper castes. No one has published a book of Dalit recipes. Even books on regional cuisine, say, Bengali food, only feature high-caste recipes, never those of Bengali Dalits.

Indians, or at least the kind who buy cookbooks, have no interest in the food traditions of either Dalits or Indian tribes, traditional inhabitants who live in forests and other remote areas.

British celebrity chef Gordon Ramsay, when he visited India in 2010 for a television series, travelled to meet members of the Dhuruva tribe, in Chhattisgarh, to see how they make a red ant chutney (he liked it), but you're unlikely to ever catch an Indian food writer or chef showing an interest in the traditions of the poor and marginalised.

Most high-caste Hindus still quail at the idea of eating in a Dalit home. In the travelogue A Million Mutinies Now, V.S. Naipaul describes how he was offered a meal in the home of a famous Dalit poet, Namdeo Dhasal. Naipaul declined. His translator was so petrified that Dhasal might be offended that he ate huge amounts to compensate.

By virtue of their monstrous poverty and dehumanisation, Dalits do possess their own distinct culinary traditions. High-caste Hindus refrained from eating meat because they could afford a range of vegetables and dairy products. These were items Dalits could not afford, so they took their protein where they could find it, from the pigs they raised, in offal, and from cows, because beef was cheaper than mutton or chicken.

Having compelled them to eat these meats, the upper castes despised them for it. They proclaimed their superiority by never touching the food Dalits ate. Dalit columnist Chandra Bhan Prasad has written about the Dalit love of pork and beef dishes.

"They were such a welcome treat from the standard meal of a dry chapati, made of millet because only the upper castes could afford wheat and rice, and eaten with salt and chilli powder. The accompani-ment of an onion was a luxury. Once in a while, we also cooked small fish, small because the big fish had to be handed over to the upper castes," says Prasad.

"Brahmins have hegemonised everything, including food," says Dalit writer and activist Kancha Ilaiah. "When the Iyengar Brahmins produce a vegetarian cookbook, they are expressing pride in their traditions. But we are denied that right. We cannot celebrate our food; we cannot hold, say, a beef festival to celebrate our beef dishes."

Ilaiah is referring to a beef festival held two years ago by Dalit students at Osmania University, in Hyderabad. Upper-caste students for whom the cow is sacred, smashed tables and beat up the Dalits.

"We were not telling others to eat beef, we were just celebrating what we eat. Beef has traditionally been a part of the Dalit diet and part of our identity. Yet many states have banned beef-eating," says Hyderabad-based Dalit activist Bathran Ravichandran, who objects to the "vegetarian fascism" of the ruling upper castes.

The day Indian publishers start commissioning Dalit cookery books will mark a victory for the country's culinary inclusiveness. The day someone opens a Dalit restaurant that upper-caste Indians go to will signal the vanquishing of an ancient bigotry.