caltable plugin by Justus Stull
A plugin that calculates how many calories you have eaten from a table.
Last updated on 2008-08-08. Provides Syntax.
Compatible with DokuWiki tested with dokuwiki-2008-05-05.
VERSION 1.1
| Download | caltable.tar.gz |
|---|
This plugin is useful to anyone who wants an easy way to keep track of the calories they eat. It uses a format similar to table, but the math is all done by the plugin. You have the option to put in a serving size multiplier. The output is a table with totals and percentages of what you have eaten.
<caltable>data</caltable>data is replaced by a description of the foods you want to track
|Food|Serving|Calories|Fat Grams|Carbohydrate Grams|Protein Grams|
if serving is 1, you can replace it with a double bar like this
|Food||Calories|Fat Grams|Carbohydrate Grams|Protein Grams|
This is the input of the caltable plugin:
<caltable> |5 egg whites||82|2.5|0|17| |1 egg||70|5|1|6| |1tbsp margarine||45|5|0|0| |Potato Roll||130|1.5|25|6| |Batch of 12 pancakes||1200|42.5|169|38| |Bisquick 2 Cups ||960|30|156|18| |2 Eggs||140|10|2|12| |1 Cup Milk||100|2.5|12|8| |Jelly 1 TBSP||50|0|13|0| |Jiff Peanut Butter 1 TBSP||95|8|7|7| |Natures Own 100% Wheat||50|1|10|4| |Chicken 6 oz||165|1.5|0|39| </caltable>
This is the output generated by the plugin:
| Food | Serving | Calories | Fat | Carb | Pro |
|---|---|---|---|---|---|
| 5 egg whites | 82 | 2.5 | 0 | 17 | |
| 1 egg | 70 | 5 | 1 | 6 | |
| 1tbsp margarine | 45 | 5 | 0 | 0 | |
| Potato Roll | 130 | 1.5 | 25 | 6 | |
| Batch of 12 pancakes | 1200 | 42.5 | 169 | 38 | |
| Bisquick 2 Cups | 960 | 30 | 156 | 18 | |
| 2 Eggs | 140 | 10 | 2 | 12 | |
| 1 Cup Milk | 100 | 2.5 | 12 | 8 | |
| Jelly 1 TBSP | 50 | 0 | 13 | 0 | |
| Jiff Peanut Butter 1 TBSP | 95 | 8 | 7 | 7 | |
| Natures Own 100% Wheat | 50 | 1 | 10 | 4 | |
| Chicken 6 oz | 165 | 1.5 | 0 | 39 | |
| Totals | 3185.5 | 109.5 | 395 | 155 | |
| Percentages | 31% | 50% | 19% | ||
| Version | Changes |
|---|---|
| 1.0 | Original Version |
| 1.1 | Changed the lexer syntax, this will break all old syntax used Added check to not allow blank rows to be rendered |
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported