The meal plan example may be able to go even forward, because I think ledger-cli can also track your calories and macro-nutrients, apart from the ingredients themselves. I meant to do a calorie counting system in ledger-cli for some time, but did not quite get to it.
I am not really sure if ledger-cli has any capacity to create compound units, so that if you say log that you have eaten one potato in ledger-cli, you would also have to manually log the calories and macro-nutrients of that potato unless you had kept a template for that potato's nutritional profile you could copy paste somewhere right? I suppose you might be able to make a "potato" ledger file with its associated nutrient profiles and just load it from a code block every time you eat one. Idk.