commit: 6fbfb5b0140b7ca93fb8add1a3d089db45471f06
parent 98ad74060bf6915cdf8b1f0d258e149eb2afa6c4
Author: microlith57 <microlith57@gmail.com>
Date: Thu, 12 Dec 2019 15:13:40 +1300
Merge 'hundredrabbits/master'
Signed-off-by: microlith57 <microlith57@gmail.com>
Diffstat:
16 files changed, 232 insertions(+), 209 deletions(-)
diff --git a/index.html b/index.html
@@ -19,10 +19,11 @@
<meta property="og:description" content="An illustrated food blog." />
<meta property="og:site_name" content="Grimgrains" />
- <script type="text/javascript" src="scripts/lib/util.js"></script>
+ <script type="text/javascript" src="scripts/helpers.js"></script>
<script type="text/javascript" src="scripts/lib/riven.js"></script>
<script type="text/javascript" src="scripts/graph.js"></script>
<script type="text/javascript" src="scripts/lib/runic.js"></script>
+ <script type="text/javascript" src="scripts/runic.library.js"></script>
<script type="text/javascript" src="scripts/nodes/query.js"></script>
<script type="text/javascript" src="scripts/nodes/router.js"></script>
@@ -50,8 +51,29 @@
</head>
<body>
<script>
+ const runic = new Runic(runicLibrary)
+
let RIVEN = new Riven();
graph()
+
+ // Find missing ingredients
+
+ const db = Ø('database').request()
+
+ for(const recipe of Object.values(db.recipes)){
+ if(!recipe.INGR){ console.warn('Missing ingredients for ', recipe.name); continue }
+ if(!recipe.INST){ console.warn('Missing instructions for ', recipe.name); continue }
+ if(!recipe.DESC){ console.warn('Missing description for ', recipe.name); continue }
+ if(!recipe.TIME){ console.warn('Missing time for ', recipe.name); continue }
+ if(!recipe.SERV){ console.warn('Missing serv for ', recipe.name); continue }
+ if(!recipe.TAGS){ console.warn('Missing tag for ', recipe.name); continue }
+ for(const part of Object.values(recipe.INGR)){
+ for(const name of Object.keys(part)){
+ if(!db.ingredients[name]){ console.warn(`Missing ingredient: ${name} for ${recipe.name}`) }
+ }
+ }
+ }
+
</script>
<noscript>
diff --git a/links/main.css b/links/main.css
@@ -36,6 +36,7 @@ h1,h2,h3,h4 { font-weight: normal; font-family: 'alte_haas_grotesk_bold'; margin
#view #core #content h1.name { float:left; font-size:32px; line-height: 40px }
#view #core #content h2.serving { float:right; font-size:32px; line-height: 40px }
#view #core #content h3 { text-transform: capitalize; font-size:24px; border-bottom:2px solid black; line-height: 45px }
+#view #core #content h4 { text-transform: capitalize; font-size:20px; line-height: 45px }
#view #core #content .jump { padding: 5px 0; text-transform: lowercase; font-size: initial; position: absolute; right: 0; }
#view #core #content .jump:before { content: '(jump to '; }
#view #core #content .jump::after { content: ')'; }
@@ -56,7 +57,7 @@ h1,h2,h3,h4 { font-weight: normal; font-family: 'alte_haas_grotesk_bold'; margin
#view #core #content columns ul li { padding-left:25px; position: relative; }
#view #core #content columns ul li:before { content:"●"; position: absolute; top:0px; left:0px; font-size:12px;}
#view #core #content columns ul li a { font-weight: bold }
-#view #core #content ul.bullet li { font-weight: bold;position: relative;padding-left:30px;line-height: 25px; }
+#view #core #content ul.bullet li { position: relative;padding-left:30px;line-height: 25px; }
#view #core #content ul.bullet li:before { content:"•"; position: absolute;left:15px; }
#view #core #content ul.bullet li a { text-decoration: underline; }
diff --git a/media/ingredients/persimmon.png b/media/ingredients/persimmon.png
Binary files differ.
diff --git a/media/ingredients/seaweed.png b/media/ingredients/seaweed.png
Binary files differ.
diff --git a/media/ingredients/turmeric.root.png b/media/ingredients/turmeric.root.png
Binary files differ.
diff --git a/media/ingredients/wasabi.root.png b/media/ingredients/wasabi.root.png
Binary files differ.
diff --git a/scripts/database/ingredients.ndtl b/scripts/database/ingredients.ndtl
@@ -159,14 +159,16 @@ Radish
~ ALGEA FUNGI
Arame
- BREF : Arame is a species of kelp, of the Brown Algae, and is very popular in Japanese cuisine. It is indigenous to the temperate Pacific Ocean waters around Japan.
+ PARENT : Seaweed
+ BREF : Arame is a species of kelp (brown algae), and is very popular in Japanese cuisine. It is indigenous to the temperate Pacific Ocean waters around Japan.
Seaweed
+ BREF : There are many kinds of edible seaweed, popular in East Asia. There are 3 main groups: Red algea, green algea and brown algea. Most edible seaweeds are marine algae whereas most freshwater algae are toxic. Seaweed contains high levels of {*iodine*} and {*calcium*}. It is possibly a source of {*vitamin B12*} (see {{ref|https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4042564/}}), but the amount is variable and therefore, not dependable.
Mushroom
BREF : Mushrooms are the fleshy fruiting body of a fungus. They grow above ground, soil or from a food source. UV ray-treated (due to both sunlight and articial UV light tech) mushrooms are a source of {*vitamin d2*}. Many mushrooms are poisonous, resembling certain edible species. Gathering mushrooms in the wild is risky for the inexperienced and should only be undertaken by persons knowledgeable in mushroom identification.
Wakame
PARENT : Seaweed
COLOR : #006633
- BREF : Wakame is an edible seaweed, subtly sweet with a strong flavour and texture. Wakame is a source of iodine, although isn't a dependable source because the amount in seaweed varies greatly.
+ BREF : Wakame, or {*Undaria pinnatifida*} is an edible seaweed, subtly sweet with a strong flavour and texture. It has a salty, savoury taste.
LONG
& Wakame is often served in soups, or in salads. Wakame is often sold dried (can be re-constituted in water) or salted.
Dried Hijiki
@@ -175,6 +177,7 @@ Dried Hijiki
& Consumption of only a small amount of hijiki seaweed could result in an intake of inorganic arsenic that exceeds the tolerable daily intake for this substance. Therefore, consumption of this type of seaweed is to be avoided. See also the {{Canadian Food Inspection Agency|http://www.inspection.gc.ca/food/information-for-consumers/fact-sheets-and-infographics/products-and-risks/chemical-hazards/inorganic-arsenic/eng/1332268146718/1332268231124}}.
Bull kelp powder
PARENT : Seaweed
+ BREF : Nereocystis a genus of brown kelp containing the species {*Nereocystis luetkeana*}. Some common names include edible kelp, bull kelp, bullwhip kelp, ribbon kelp, bladder wrack. Bull kelp powder is made from dried bull kelp, and is one of the tastiest seaweeds. It is used as a seasoning to create a briny taste.
Nori
PARENT : Seaweed
COLOR : #000000
@@ -189,7 +192,9 @@ Nori Sheets
Shiitake
PARENT : Mushroom
COLOR : #875A2C
- BREF : Shiitake is an edible mushroom, used as a base in vegan dashi, to flavor simmered and steamed dishes.
+ BREF : Shiitake, or {*Lentinula edodes*}, is an edible mushroom that grows in groups on the decaying wood of deciduous trees. When cooked, these mushrooms have a savory, earthy umami flavor.
+ LONG
+ & They are sold both fresh and dried, dried shiitakes can be reconstituted in water. Shiitake are used as a base in vegan dashi, to flavor simmered and steamed dishes. They are also used in soups, or sauteed with other vegetables. Rarely, consumption of raw or slightly cooked shiitake mushrooms may cause an allergic reaction called "shiitake dermatitis". They will keep 1-2 weeks when stored in a paper bag in the refrigerator.
Crimini
PARENT : Mushroom
COLOR : #875A2C
@@ -479,45 +484,89 @@ Papaya
LONG
& The ripe fruit can be consumed raw, and the unripe green fruit can be eaten cooked in salads or other meals. The seeds are edible, they can be washed and dried and used like {{black pepper}}.
Pomegranate
+ BREF : Pomegranates come from the {*Punica granatum*}, a fruit-bearing shrub (botanically a berry). Pomegranates can range in color from pink, white, yellow and purple, the most common being the red variety. It is estimated that there are some 500 different cultivars of Pomegranate grown world-wide.
+Pomegranate Seeds
+ PARENT : Pomegranate
+ BREF : The inside of the pomegranate fruit is filled with seeds, technically called {*arils*}. Pomegranate arils are a source of {*vitamin C*}.
+ LONG
+ & {*How to extract the arils*}: Score it with a knife to break it open. The seeds are separated from the peel and internal white pulp membranes. Separating the seeds is easier in a bowl of water because the seeds sink and the inedible pulp floats. The seeds may simply be eaten raw as a snack or added into salads, relishes, garnishes or {{desserts|#Chili pomegranate brownies}}.
Pomegranate Juice
+ PARENT : Pomegranate
+ BREF : Pomegranate juice is extracted from the arils (seeds) of the fruit of the pomegranate.
+ LONG
+ & The juice is very flavorful on its own, it can be sweet or sour, but most fruits are moderate in taste. The juice can be reduced down into pomegranate molasses or fermented into pomegranate vinegar.
Mango
-Lime
+ BREF : Mangoes are stone fruits produced by many species of tropical trees of the genus {*Mangifera*}. They vary in size, taste, shape and color (pale yellow, gold and orange). Mangoes are generally sweet, and are a good source of {*vitamin C*} and {*vitamin A*}.
+ LONG
+ & Unripe mangoes can be made into pickles, or used in chutneys, side dishes or eaten with salt & chili. Ripe mangoes can be eaten raw, baked into cakes, made into preserves, pureed etc. The skin of unripe mango has the potential to cause contact dermatitis of the lips, gums, or tongue in susceptible people. Mangoes that are still firm will continue to ripen if stored at room temperature. Once fully ripe, they can be stored in the refrigerator for about 5 days.
Hachiya Persimmon
+ PARENT : Persimmon
+ BREF : Hachiya persimmons are acorn-shaped, it must be completely ripened before consumption. When fully ripe, it develops a sweet flavor.
+ LONG
+ & The pulp of the hachiya persimmon is used to make sherbets, puddings, cakes, jams and purees. When the fruit is fully ripe, the skin turns a deep orange color. Another indicator of ripeness is that the fruit becomes soft like a water balloon. The consumption of unripened persimmons can cause {{phytobezoars|http://www.persimmonpudding.com/bezoars.html}} to form in the body.
Persimmon
+ BREF : The persimmon (or {*kaki*}) is the fruit of many species of trees in the genus {*Diospyros*}. Colors range from light yellow-orange to dark red-orange. They very in size and shape, some varieties can be spherical, acorn or pumpkin-shaped. Persimmons are sweet in taste, and are a good source of {*vitamin C*} and {*vitamin A*}. Some varieties are edible in the crisp, firm state (like an apple) but it has its best flavor when allowed to rest and soften slightly after harvest. Some varieties, like {{hachiya persimmon}}, should not be eaten when unripe.
Dates
- BREF : Date palms have been around for at least 50 million years!
+ BREF : Dates are the fruit of the date palm (or Phoenix dactylifera) of the {*Phoenix*} genus, which contains 19 species of wild date palms. There are 3 classifications of dates: dry, semi-dry and soft. Date fruits range from bright red to bright yellow in color, and are very sweet with a sugar content of about 80% when dried. Dates are a source of {*iron*} and {*protein*}.
+ LONG
+ & Dry dates are often pitted and stuffed with a variety of fillings, like nuts, candied orange, tahini etc.
Deglet Noor Dates
PARENT : Dates
+ BREF : Deglet noor dates are medium-sized with a narrow elongated shape. They have a semi-dry texture, and have less sugar than Medjool dates and offer a complex sweetness.
+ LONG
+ & Deglet noor dates lend well to baking, due to their moderate sweetness and firmness. They are the preferred variety for the production of date syrup and date sugar.
Date caramel
PARENT : Dates
- BREF : Date caramel is used to make {{salted caramel carob chip cookies}}, and has a recipe there.
-Pamplemousse
-Rhubarb
+ BREF : A type of plant-based 'caramel' made from {{dates}}.
Apricot Jam
-Starfruit
-Mixed fruits
+ BREF : Apricot jam is made from the pureed flesh of the apricot fruit. It's easy to prepare, requiring only fresh apricots, {{sugar}} and {{lemon juice}}. Apricots are a moderate source of {*vitamin A*} and {*vitamin C*}.
Coconut
-Plums
-Pineapple
+ BREF : Coconuts stem from the coconut tree, or {*Cocos nucifera*}. Coconuts are known for their versatility of uses, ranging from food to cosmetics. The water in young coconuts is very high in electrolytes. They are a good source of {*protein*}, {*iron*} and {*zinc*}.
+ LONG
+ & They are ideal for making deserts, and are used in a variety of dishes like {{ice cream|#hop ice cream}}, beverages, frostings on cakes, smoothies, curry sauces etc. Whole coconuts will keep at room temperature for two weeks. For longer storage, refrigerate.
~ SPICES
Ao nori
+ PARENT : Seaweed
+ BREF : Aonori {*青海苔*}, or green laver, is a type of edible green seaweed which includes species from the genus {*Monostroma*} and {*Ulva*}. It is referred to as aosa {*アオサ*} in some parts of Japan. The color of the aonori is intense, beautiful green. It has a distinctive fragrant green flavor. This type of seaweed is rich in {*calcium*} and is a moderate source of {*iodine*}.
+ LONG
+ & Aonori is sold dried, and is used in soups and tempura. It is also sprinkled atop a variety of Japanese dishes like yakisoba and {{okonomiyaki|#okonomiyaki}}.
Kanten powder
- BREF : A seaweed-based gelling agent derived from tengusa, a specific type of red seaweed. Kanten confections don't dissolve at room temperature, unlike gelatin.
-Turmeric
- BREF : Turmeric is sometimes used as a fabric dye, namely for Buddhist Monks' robes.
+ PARENT : Seaweed
+ BREF : Kanten is a seaweed-based gelling agent derived from tengusa {*テングサ*}, a specific type of red seaweed. It is semi-translucent, and firm when it solidifies. Kanten is 80% fiber, and has no odor or taste.
+ LONG
+ & It is used to make Japanese confectionery, and unlike gelatin kanten-based confections don't dissolve at room temperature. Kanten is often confused with agar agar. Both are seaweed-based, but they come from different algea. Kanten can be swapped 1:1 with agar agar in a recipe, although the resulting texture will not be the same. Kanten produces a firmer texture than agar.
+Turmeric Root
+ BREF : Turmeric, or {*Cucurma longa*}, belongs to the {{ginger root}} family. The rhizomes can be used fresh, boiled in water and dried. It's used as a coloring and flavoring agent, and has a bitter black pepper-like taste and earthy mustard-like aroma. Fresh Turmeric's gentle carrot/ginger-like flavor lends itself well to both sweet and savory applications.
Ground Turmeric
+ PARENT : Turmeric root
+ BREF : Ground turmeric is made from the rhizomes of the turmeric plant, after harvest it is boiled, then dried and ground into a powder.
Cinnamon
COLOR : #875A2C
- BREF : Cinnamon and {{garlic}} and be used to preserve fried foods.
+ BREF : Cinnamon is an aromatic spice from the inner bark of many species of tree from the genus {*Cinnamomum*}. It's a flavouring additive used in both sweet and savoury dishes. It's sold in the form of quills or powdered. Cinnamon is a rich source of {*calcium*} and {*iron*}.
+ LONGmailto:info@specialtyproduce.com
+ & Only a tiny sliver of the inner bark is used. The outer, woody portion is discarded, leaving metre-long cinnamon strips that curl into rolls (referred to as "quills") on drying. The processed bark is dried, and cut into 5-10 cm lengths for sale. There are many varieties of cinnamon, with {*Cinnamomum cassia*} being the most common commercial type. Cassia has a strong, spicy flavor and handles baking conditions well.
Rosemary
+ BREF : Rosemary, or {*Salvia rosmarinus*}, is a fragrant evergreen herb with needle-like leaves and white, pink, purple of blue flowers. It's leaves are used to flavor a variety of foods. It's a source of {*vitamin A*} and {*calcium*}.
+ LONG
+ & Rosemary is very potent, and should be used sparingly. A good technique to remove the leaves, is to hold the stem at the top and to run your fingers along the stem backwards. To keep cuttings of rosemary fresh, wrap in a damp towel. Dried rosemary keeps up to 6 months if stored in an airtight container.
Basil
+ BREF : Basil, or {*Ocimum basilicum*} is an aromatic plant, with a wide range of fragrances (depending on the variety). The leaves may taste like anise, with a strong smell. The most common type is sweet basil, but there is also thai basil, lemon basil and holy basil.
+ LONG
+ & In cooking, add it at the last moment, as cooking quickly destroys the flavor. Fresh basil can be used whole, chopped, made into a paste or dried. Basil will keep if dry and refrigerated, but should be used up within a week. When soaked in water, the seeds of several basil varieties become gelatinous.
Dried Basil
- BREF : When soaked in water, the seeds of some basil varieties become gelatinous. They are in turn used in drinks and desserts.
-Wasabi
+ BREF : Dried basil loses most of its flavor, and what little flavor remains tastes very different from fresh basil.
+Wasabi Root
+ BREF : Wasabi, or {*Wasabia japonica*}, is part of the family {*Brassicaea*} which includes horseradish and mustard. It is primarily cultivated for its rhizome, which has a fiery, mustard-like flavor and pungent fragrance.
+ LONG
+ & Wasabi is difficult to grow, which makes it expensive to buy. Wasabi is sold as a rhizome or as a dried powder. Fresh wasabi is served with a grater and served to the table right away, because it loses flavor very quickly once it's made into a paste. Fresh Wasabi root will keep, wrapped and refrigerated, for up to two weeks.
Wasabi Powder
-
+ PARENT : Wasabi Root
+ BREF : Wasabi powder is made from the dried, grated flesh of the wasabi root. It has a light lime coloring and sharp, hot taste and aroma. Most of the wasabi powder that is sold internationally is not 100% wasabi, but a mixture of mustard, horseradish and color additives (due to the high cost of the root).
+ LONG
+ & Wasabi powder has a long shelf life, it will retain its taste if kept in a cool and dry place.
+ & {*How to make wasabi paste:*} To make wasabi paste, mix 1:1 quantity of wasabi powder and water, mix well. The texture should be a bit dry. Cover wasabi and allow to sit for 15 min to allow the enzymes to work, doing this helps bring out the full flavors of the wasabi.
Sichuan peppercorns
BREF : Sichuan peppercorns are a numbing pepper, and are not to be confused with {{black peppeercorns}}.
Coriander
@@ -820,6 +869,7 @@ Porto
~ OILS
Coconut oil
+ PARENT : Coconut
COLOR : #EFEFEF
BREF : Coconut oil is an edible oil extracted from the meat of mature coconuts. It has a high-fat content, which makes it resistant to rancidification, lasting up to 6 months without spoiling.
LONG
@@ -850,6 +900,7 @@ Fresh dill
~ MISC
Coconut milk
+ PARENT : Coconut
BREF : Coconut milk is extracted from the grated pulp of mature coconuts. The rich taste of the milk is due to its high oil content. This high-fat milk is a perfect base for {{ice cream|hop ice cream}}.
LONG
& There are many varieties, differentiated on fat content: coconut cream (up to 50% fat), coconut milk (20% fat) and coconut skim milk (least fat). The terminology is not always described like this in products sold in western countries. Traditionally, coconut milk is made from grating the white inner flesh of mature coconuts and mixing the shredded pulp with a bit of hot water to suspend the fat in the pulp. The grating process was often done by hand.
diff --git a/scripts/database/pages.ndtl b/scripts/database/pages.ndtl
@@ -3,7 +3,7 @@ ABOUT
BREF : We started {*Grimgrains*} to teach ourselves how to cook. This blog, which now doubles as a travel diary, helps measure our progress, while giving us another creative output. We cook and travel, and adapt to the local produce whenever possible. All of the recipes we make are plant-based, and tree-nut free.
LONG
& We are {{Rekka Bellum|http://kokorobot.ca/}}, an illustrator, and {{Devine Lu Linvega|http://xxiivv.com}}, an artist/musician, living on a small sailboat somewhere on the shores of the Pacific Ocean. Hundredrabbits is the name of our {{floating studio|http://100r.co}}, we make {{games|https://100r.co/pages/games.html}}, {{tools|https://100r.co/pages/tools.html}} and delicious recipes as we travel.
- & This website showcases our favourite creations, along with hand-drawn illustrations for {{each ingredient|ingredients-list}}. You can contact us on our twitter {{@grimgrains|http://twitter.com/grimgrains}} or via <a rel="me" href="https://merveilles.town/@rek">Mastodon</a>
+ & This website showcases our favourite creations, along with hand-drawn illustrations for {{each ingredient|home}}. You can contact us on our twitter {{@grimgrains|http://twitter.com/grimgrains}} or via <a rel="me" href="https://merveilles.town/@rek">Mastodon</a>
* Copyright policy
& You may adapt our recipes, but a link back or mention would be nice :).
& The assets of grimgrains.com, unless stated otherwise, are {{©hundredrabbits|http://100r.co/}}. Photographs, drawings or text should not be used, published, reprinted or modified without our permission. The source code of the website is under the {{MIT License|https://github.com/hundredrabbits/Grimgrains/blob/master/LICENSE}}.
@@ -49,10 +49,9 @@ NUTRITION
- Eat at least {*3 servings of fruits*} per day.
- Eat at least {*1 serving of seeds*} per day.
* Protein
- > <hr class='stroke' />
% pages/protein.jpg
& Proteins are necessary for the growth and repair of muscles, bones, hormones, digestive enzymes and to absorb nutrients. They are composed of {*20 amino acids*}, 11 of which our bodies can synthesize. The other 9 must come from the food that we eat, they are called the "essential amino acids".
- * Sources
+ + Sources
& Consume 3-4 servings of:
- 1/2 cup of dried lentils or beans
- 1/2 cup tofu or tempeh
@@ -63,10 +62,9 @@ NUTRITION
& Legumes are the best source of {*lysine*}, one of the essential amino acids. Quinoa and amaranth are two grains that are rich in lysine, although not as much as legumes.
& {{Read more|https://veganhealth.org/protein-part-1/}} about proteins.
* Iron
- > <hr class='stroke' />
% pages/iron.jpg
& Iron is necessary for red blood cells and to form hemoglobins which helps circulate oxygen around the body. We lose some of this mineral everyday from the skin and intestines, menstruating women will lose a lot of it.
- * Sources
+ + Sources
- Beans
- Soy (high in iron and not affected by phytic acid)
- Nuts
@@ -83,9 +81,8 @@ NUTRITION
& Other iron inhibitors include: turmeric and coriander, or calcium rich foods.
& {{Read more|https://veganhealth.org/iron/}} about iron.
* Calcium
- > <hr class='stroke' />
% pages/calcium.jpg
- * Sources
+ + Sources
& Consume at least 3 1/2 to 4 cups a day of:
- Calcium-set tofu
- Cooked Chinese cabbage
@@ -98,12 +95,11 @@ NUTRITION
& The amount of calcium in plant foods is somewhat dependent on the amount of calcium in the soil. The World Health Organization recommends 1,000mg of calcium per day, and 1,200mg if over 50, but what is most important is how much is truly absorbed. Most people absorb 25-30% of calcium. Absorption varies depending on food sources, so {*it's important to consume sources of well-absorbed calcium*}, like {*calcium-set tofu*}, {*kale*}, {*turnip greens*}, {*mustard greens*} and {*broccoli*}. Beans, nuts and seeds have moderate amounts of calcium and a slow absorption rate, soaking nuts and seeds aids in absorption. Fortified plant milk generally contains calcium with an absorption rate of 25%, similar to calcium-set tofu, although it is important to shake it before using it as the calcium tends to set at the bottom.
& {{Oxalate molecules|https://veganhealth.org/oxalate/}}, found in certain plant foods (such as spinach, beets, beet greens, sweet potatoes, peanuts, rhubarb, and swiss chard), can prevent the absorption of calcium. Oxalates plays a part in calcium-oxalate kidney stones. Consuming calcium and high-oxalate foods is fine and necessary for good health, but it's important to drink plenty of fluids. Doing this helps oxalate and calcium “bind” to one another in the stomach and intestines before reaching the kidneys, making it less likely for kidney stones to form. Boiling high-oxalate greens before consumption and discarding the cooking water also helps.
& {{Read more|https://veganhealth.org/calcium/}} about calcium.
- * Vitamin D
- > <hr class='stroke' />
+ * Vitamin D
% pages/vitamind.jpg
& Vitamin D can help prevent osteoporosis by increasing calcium absorption in the body.
& We make plenty of vitamin D when our skin is exposed to sunlight, but because of smog, cloud coverage and sunscreen, we may be producing less than our body requires. Light-skinned people require 10-15 minutes in the sun, while dark-skinned people might need {{two hours|https://veganhealth.org/vitamin-d-part-2-the-research/#dark}}. In winter, it is important to get a dietary source of this nutrient, especially for people with darker skin.
- * Sources
+ + Sources
- The sun
- Fortified plant milk
- Fortified foods
@@ -115,10 +111,9 @@ NUTRITION
& D2 is vegan, made from exposing fungi to UV Rays, while D3 comes from fish oil or sheep's wool. Vitamin D2 is not as effective as vitamin D3 if taken weekly, it must be consumed daily.
& {{Read more|https://veganhealth.org/vitamin-d/}} about vitamin D.
* Vitamin B-12
- > <hr class='stroke' />
% pages/vitaminb12.jpg
& Vitamin b-12 is needed for the production of DNA and for maintaining nerve cells. Levels need to be over 400 pg/ml — or 4 to 6 mcg per day — for good health. This vitamin does not occur naturally in any plant.
- * Sources
+ + Sources
- Fortified plant milks
- Fortified foods
- Nutritional yeast
@@ -127,10 +122,9 @@ NUTRITION
& Absorption of vitamin b-12 is tricky, because small amounts attach to receptors that become quickly saturated by just 1-2 mcg of B12 and will stay like this for several hours. This is what you get from a single meal of fortified foods. Ingesting a large dose of B12 from a supplement, you can absorb the excess that can't latch onto receptors, but that is a very small amount. It is easier to meet needs from many small servings of B12 to be eaten throughout the day, but if you rely on daily single-dose supplements you need to have a lot more since absorption rates are very low.
& {{Read more|https://veganhealth.org/vitamin-b12/}} about vitamin B12.
* Iodine
- > <hr class='stroke' />
% pages/iodine.jpg
& Iodine is necessary for healthy thyroid function which regulates our metabolism.
- * Sources
+ + Sources
- Some fortified plant milks (few are fortified with it)
- Iodized salt, 1/4 tsp/day
- Seaweed
@@ -138,10 +132,9 @@ NUTRITION
& Note that the amount of iodine in seaweed and other sea vegetables is variable, it is the same for sea salt and other natural salts. {*The only reliable sources are iodized salt or a supplement*}.
& {{Read more|https://veganhealth.org/iodine/}} about iodine.
* Omega-3
- > <hr class='stroke' />
% pages/omega3.jpg
& Omega3's are needed for optimal cognition, and helps reduce blood clotting (which protects against heart attacks).
- * Sources
+ + Sources
- Chia seeds, 1 tsp | 713mg
- Flax seeds, 1 tsp, ground | 570mg
- Soybeans, cooked, 1/2 cup | 500mg
@@ -156,10 +149,9 @@ NUTRITION
& Adult males require 1,600 mg/day while females require 1,100 mg/day of ALA. The numbers vary for {{babies, infants and pregnant women|https://veganhealth.org/daily-needs/#Omega-3-Fats}}. To be safe, it is recommended to take 200-300 mg of DHA per day.
& {{Read more|https://veganhealth.org/omega-3s-part-2/}} about omega-3's.
* Vitamin A
- > <hr class='stroke' />
% pages/vitamina.jpg
& Vitamin A is important for growth and developments in young children, and for red blood cell formation.
- * Sources
+ + Sources
& Consume 2 or more per day.
- Butternut squash
- Pumpkin
@@ -172,10 +164,9 @@ NUTRITION
& The body can convert 50 carotenoids into vitamin A, the most common being {*beta-carotene*}. Eating vegetables high in carotenoids (carrots, pumpkin etc) with some fat increased the absorption and synthesis of Vitamin A.
& {{Read more|https://veganhealth.org/vitamin-a/}} about vitamin A.
* Zinc
- > <hr class='stroke' />
% pages/zinc.jpg
& Zinc is important for immunity.
- * Sources
+ + Sources
- Chickpeas, 1/3 cup (cooked)
- Peanuts, 1/4 cup (raw)
- Oatmeal, 1 cup (cooked)
@@ -184,13 +175,11 @@ NUTRITION
& Adult males (19-50yrs) require 11mg/day, while adult females (19-50yrs) require 40mg/day. {{These amounts vary|https://veganhealth.org/daily-needs/#zinc}} for newborns, infants, teens, pregnant/breastfeeding women and older adults.
& {{Phytates|https://www.nap.edu/read/10026/chapter/14#480}}, found in some plant foods, reduce zinc absorption. This is why it's important to increase our intake of zinc by at least 50%. Consuming protein — like legumes, leavened bread, fermented soy foods (miso or tempeh) and nuts – increases zinc absorption.
& {{Read more|https://veganhealth.org/zinc/}} about zinc.
- > <hr class='stroke' />
* Nutrition References
& {{The vegan RD|https://www.theveganrd.com/}}
& {{Vegan Health|https://veganhealth.org/}}
& {{Nutrition Facts|https://nutritionfacts.org/}}
& {{Open Food Facts|https://world.openfoodfacts.org/}}
- > <hr class='stroke' />
& Information last updated on 15/11/19
& See a mistake? {{Make a pull request|https://github.com/hundredrabbits/Grimgrains}} on Github. Or contact us on {{twitter|https://twitter.com/grimgrains}} or {{mastodon|https://merveilles.town/@rek}}.
diff --git a/scripts/database/recipes.ndtl b/scripts/database/recipes.ndtl
@@ -1,6 +1,6 @@
DATABASE.recipes = `
-Tzaziki
+TZAZIKI
DATE : 2019-12-06
TAGS
sauce
@@ -11,7 +11,6 @@ Tzaziki
& {*Substitutions*}
& It is possible to use {{sunflower seeds}}, cashews and {{tofu}} to replace the hemp seeds. In this recipe, I used half hemp and half soy, because hemp — while being nutritious — is not cheap. Using just {{shelled hemp seeds}} — wallet permitting — is very possible, although you may have to add more water.
& If using cashews or sunflower seeds, you should pre-soak them for a few hours prior to blending (discard the soaking water and rinse them well). If using only tofu, you may not require extra water in the recipe.
-
INST
Preparation
- Blend {_1/2 cup_} of {{shelled hemp seeds }} with {_225g_} of {{soft tofu}}, {_3 cloves_} of {{garlic}}, {_1/4 cup_} of {{water}} and the juice of {_1_} {{lemon}}.
@@ -19,7 +18,6 @@ Tzaziki
- Cut {_1_} cucumber into small cubes.
- Add {{fresh dill}}, {{fresh mint}}, the cubed {{persian cucumbers}} and {_1 pinch_} of {{salt}} to the rest of the ingredients and mix well.
- Garnish with some {{fresh mint}} and {{fresh dill}} leaves.
-
INGR
Main
Shelled hemp seeds : 1/2 cup
@@ -32,7 +30,7 @@ Tzaziki
Persian cucumbers : 2
Salt : pinch
-Spicy stirfry chickpeas
+SPICY STIRFRY CHICKPEAS
DATE : 2019-06-25
TAGS
dinner
@@ -45,7 +43,6 @@ Spicy stirfry chickpeas
& Another plus is that dry chickpeas keep a long, long time. If you keep them in air-tight containers they will last even longer, because moisture and oxygen is the enemy of all beans. Oxygen makes the bean oils rancid overtime. You can store them for 5+ yrs if you add oxygen absorbers (packet consisting of powdered iron oxide) to the containers. I like to buy them in bulk and cook them as needed. An advantage of buying them dry is that it is cheap, and they taste better (honest). Read about {{storing dry beans|https://extension.usu.edu/foodstorage/howdoi/dry_beans}}.
& {*Recommendations*}
& Adding a {{bay leaf}}, a bit of {{onion}} or a clove or two of {{garlic}} to the cooking water add a subtle seasoning to the {{chickpeas}} and boost flavor.
-
INST
Marinade overnight
- Cook {_3/4 cup_} of dried {{chickpeas}} (see {{instructions|#chickpeas}}), or use 1 can (15oz).
@@ -58,7 +55,6 @@ Spicy stirfry chickpeas
- Add {_1 tbsp_} of vegetable oil, then warm pan to high heat. When oil is hot, add {_~1-2 tbsp_} of {{chili pepper flakes}} and {_1 tsp_} of {{sichuan peppercorns}}. Stir-fry until they're crisp and that the mixture is spicy and fragrant. Careful not to burn the spices, remove from heat for a bit if overheating.
- Add the {{chickpeas}}, {{tofu}}, {{carrot}} and {{red cabbage}} and fry over high heat, stirring constantly. {#After a minute#}, add the {{ginger root}}, {{garlic}} and {{scallions}} and stir-fry for {#a few more minutes#}.
- Stir the sauce, and add it to the pan while stirring and tossing. When the sauce starts to thicken, remove from heat and serve.
-
INGR
Main
Chickpeas : 1.5 cups, cooked
@@ -88,7 +84,7 @@ Spicy stirfry chickpeas
Sesame oil : 1 tsp
Arrowroot starch : 1 tbsp
-Scrambled chickpeas
+SCRAMBLED CHICKPEAS
DATE : 2019-06-25
TAGS
sidedish
@@ -103,7 +99,6 @@ Scrambled chickpeas
& {*Recommendations*}
& I like to eat scrambled chickpeas with a side of sliced avocado, topped with a drizzle of sambal oelek or {{sriracha}}. Sometimes when I make meal salads, I add scrambled chickpeas for bulk. Another meal I enjoy with this recipe is a sort of ovenless deconstructed {{pate chinois}} (quebec-style sheperd's pie), I eat it with mashed potatoes, corn and sambal oelek. You can also make this with cooked chickpeas by smashing them with a fork and mixing them up with nutritional yeast, salt and other flavourings.
% recipes/scrambled.chickpeas.3.jpg
-
INST
Scrambled chickpeas
- In a bowl, mix {_1/2 cup_} of {{chickpea flour}}, {_1/4 cup_} of {{nutritional yeast}}, {_1 tbsp_} of {{tahini}} and a {_pinch_} of {{salt}}.
@@ -112,7 +107,6 @@ Scrambled chickpeas
- When the edges start to cook, flip it and start to break it apart with the side of the spatula.
- Let it cook {#for a minute#}, then continue to break it apart further. You'll need to do this repeatedly, until the mixture is broken up into smaller bits and until it has become dry and crisp for {#8-10 minutes or so#}. When cooking, it's important to stir often, and to constantly break it up into smaller bits so all sides can can cook.
- NOTE: I like to use a spatula and a fork to break it up, and also to brush some of the batter off the spatula (it is very wet in the beginning and is a bit sticky). Serve into salads, or as a side for other dishes.
-
INGR
Main
Chickpea flour : 1/2 cup
@@ -136,7 +130,6 @@ CHEESE
& {*Flavors*}
& For a pepper jack cheese flavor, add {{garlic}}, {{onion powder}} and {{chili pepper flakes}}. You can also add {{black pepper}}, for a bit of spice, or {{pimento olives}}!
% recipes/cheese.2.jpg
-
INST
CHEESE
- In a bowl, mix {_1/4 cup_} of {{soy milk}}, {_4 tbsp_} of {{nutritional yeast}}, {_2 tbsp_} of {{tahini}}, {_1 tsp_} of {{apple cider vinegar}} and {_1 tsp_} of {{red miso}}.
@@ -144,7 +137,6 @@ CHEESE
- When content starts to boil, lower to a simmer and add the bowl of mixed ingredients into it. Stir, for {#a minute or two#} and then pour contents of pan into two small bowls. The reason I use two instead of one, is because the cheese will harden quicker.
- Let mixture rest for {#1 hour or so, 2 is better#} (especially if it's hot where you are).
- Flip bowls upside down, scoop out cheese and enjoy! This cheese can be grated onto pizza too!
-
INGR
Main
Soy milk : 1 cup
@@ -168,7 +160,6 @@ SWEET AND SOUR LENTILS
& It's a versatile recipe, so if I don't have any carrots or daikon I'll sometimes put brocoli or fresh green peas instead. For a heartier meal, adding sweet potatoes is also delicious. Sometimes, if I'm out of peanut butter I'll use tahini instead, the flavour is very similar and doesn't change much in the recipe (also nice for those with peanut allergies). This recipe only works with whole lentils, because there's still a bite to them, halved lentils will soften too much and the resulting texture won't be as pleasant.
& Enjoy this humble, but delicious recipe.
% recipes/sweet.and.sour.lentils.2.jpg
-
INST
SAUCE
- Mix all liquid ingredients together in a bowl, add {_1 tbsp_} of {{peanut butter}} and stir until dissolved.
@@ -181,7 +172,6 @@ SWEET AND SOUR LENTILS
- Let mixture simmer for an additional {#10-20 minutes#}, add extra water as needed.
- If lentils are tender, they are ready. Strain lentils and return to pot with {_1/4 tsp_} of {{salt}}.
- Pour sauce onto lentils, mix well. Serve into two bowls with some {{chives}}. Eat wrapped in salad or cabbage leaves, or with {{crackers}}.
-
INGR
Main
Brown lentils : 1/2 cup
@@ -215,7 +205,6 @@ COFFEE JELLY
& {*Quick soy pudding*}
& Also, I sometimes make a quick 'soy pudding' by heating some soy milk in a pan with some arrowroot starch. The mixture will thicken, it becomes pudding-like and is delicious over coffee jelly.
% recipes/coffee.jelly.2.jpg
-
INST
BASIC
- Brew a pot of {{coffee}}.
@@ -224,7 +213,6 @@ COFFEE JELLY
- Pour the mixture into two small bowls, or cups. Let stand for {#30 minutes and up to 1 hour#}. It doesn't need to be refrigerated to solidify, but you can do that if you prefer it cold.
TOPPINGS
- You can eat as is, or you can add the cubes in another recipe like a coconut or soy milk pudding. It can also be used as a garnish for other desserts.
-
INGR
Main
Coffee : 350 ml
@@ -434,7 +422,6 @@ NO KNEAD BREAD
- Once the oven is at temperature, carefully take out the dutch oven with oven mitts — careful, it's hot! Place your bread into the dutch oven. At this point, you can add some seeds overtop of the bread. In this recipe, I used {{sesame seeds}}, but {{poppy seeds}} or {{oats}} would also be good. Cover with lid and place back inside oven.
- Bake for {#30 minutes#}.
- After {#30 minutes#}, take the lid off, and let it cook uncovered for {#another 7 minutes#}.
-
INGR
Main
All purpose flour : 2 cups
@@ -1816,7 +1803,7 @@ ARAME SOBA
Tempeh : 60g or 1/4 of 240g
Sichuan peppercorns : To taste
-Homemade Veganaise
+HOMEMADE VEGANAISE
DATE : 2019-12-06
TAGS
sauce
@@ -1832,7 +1819,6 @@ Homemade Veganaise
INST
Preparation
- Blend {_1 cup_} of {{soft tofu}}, {_3 tbsp_} of olive oil, {_2 tbsp_} {{apple cider vinegar}}, {_3 tbsp_} {{dijon mustard}} and {_1/4 tsp_} {{salt}}.
-
INGR
Preparation
Soft tofu : 250g
@@ -1842,7 +1828,6 @@ Homemade Veganaise
Dijon mustard : 3 tbsp
Salt : 1/4 tsp
-
CHICKPEA SALAD SANDWICH
DATE : 2016-01-18
TAGS
diff --git a/scripts/helpers.js b/scripts/helpers.js
@@ -0,0 +1,39 @@
+String.prototype.capitalize = function () {
+ return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase()
+}
+
+String.prototype.to_url = function () {
+ return this.toLowerCase().replace(/ /g, '+').replace(/[^0-9a-z\+]/gi, '').trim()
+}
+
+String.prototype.to_path = function () {
+ return this.toLowerCase().replace(/ /g, '.').replace(/[^0-9a-z\.]/gi, '').trim()
+}
+
+String.prototype.to_markup = function () {
+ html = this
+ html = html.replace(/{_/g, '<i>').replace(/_}/g, '</i>')
+ html = html.replace(/{\*/g, '<b>').replace(/\*}/g, '</b>')
+ html = html.replace(/{\#/g, "<code class='inline'>").replace(/\#}/g, '</code>')
+
+ const parts = html.split('{{')
+ for (id in parts) {
+ const part = parts[id]
+ if (part.indexOf('}}') == -1) { continue }
+ const content = part.split('}}')[0]
+ if (content.substr(0, 1) == '$') { html = html.replace(`{{${content}}}`, Ø('operation').request(content.replace('$', ''))); continue }
+ // if(content.substr(0,1) == "%"){ html = html.replace(`{{${content}}}`, this.media(content)); continue; }
+ const target = content.indexOf('|') > -1 ? content.split('|')[1] : content
+ const name = content.indexOf('|') > -1 ? content.split('|')[0] : content
+ const external = (target.indexOf('https:') > -1 || target.indexOf('http:') > -1 || target.indexOf('dat:') > -1)
+ html = html.replace(`{{${content}}}`, external ? `<a href='${target}' class='external' target='_blank'>${name}</a>` : `<a class='local' href="#${target.to_url()}" onclick="Ø('query').bang('${target}')">${name}</a>`)
+ }
+ return html
+}
+
+function Š (target) {
+ const elem = document.getElementById('jump-' + target)
+ if (!elem) { console.error('Undefined jump target', target); return }
+ elem.scrollIntoView()
+ elem.focus()
+}
diff --git a/scripts/lib/runic.js b/scripts/lib/runic.js
@@ -1,143 +1,32 @@
-function Runic (raw) {
- this.raw = raw
+'use strict'
- this.runes = {
- '&': { glyph: '&', tag: 'p', class: '' },
- '~': { glyph: '~', tag: 'ul', sub: 'li', class: 'parent', stash: true },
- '-': { glyph: '-', tag: 'ul', sub: 'li', class: '', stash: true },
- '!': { glyph: '!', tag: 'table', sub: 'tr', wrap: 'th', class: 'outline', stash: true },
- '|': { glyph: '|', tag: 'table', sub: 'tr', wrap: 'td', class: 'outline', stash: true },
- '•': { glyph: '•', tag: 'ul', sub: 'li', class: 'bullet', stash: true },
- '#': { glyph: '#', tag: 'code', sub: 'ln', class: '', stash: true },
- '%': { glyph: '%' },
- '?': { glyph: '?', tag: 'note', class: '' },
- ':': { glyph: ':', tag: 'info', class: '' },
- '*': { glyph: '*', tag: 'h2', class: '' },
- '=': { glyph: '=', tag: 'h3', class: '' },
- '+': { glyph: '+', tag: 'hs', class: '' },
- '>': { glyph: '>', tag: '', class: '' },
- $: { glyph: '>', tag: '', class: '' }
+function Runic (lib = {}) {
+ function filter (line) {
+ const pass = lib[line.substr(0, 1)] && line.substr(1, 1) === ' '
+ if (pass !== true) { console.warn('Runic', 'Error near: ', line) }
+ return pass
}
- this.stash = {
- rune: '',
- all: [],
- add: function (rune, item) {
- this.rune = this.copy(rune)
- this.all.push({ rune: rune, item: item })
- },
- pop: function () {
- const copy = this.copy(this.all)
- this.all = []
- return copy
- },
- is_pop: function (rune) {
- return this.all.length > 0 && rune.tag != this.rune.tag
- },
- length: function () {
- return this.all.length
- },
- copy: function (data) {
- return JSON.parse(JSON.stringify(data))
- }
+ function stash (acc, line) {
+ const rune = line.substr(0, 1)
+ const prev = acc[acc.length - 1] ? acc[acc.length - 1] : [{ rune: rune, arr: [] }]
+ if (prev.rune === rune) { prev.arr.push(line.substr(2)) } else { acc.push({ rune: rune, arr: [line.substr(2)] }) }
+ return acc
}
- this.media = function (val) {
- const service = val.split(' ')[0]
- const id = val.split(' ')[1]
-
- if (service == 'itchio') {
- return `<iframe frameborder="0" src="https://itch.io/embed/${id}?link_color=000000" width="600" height="167"></iframe>`
- }
- if (service == 'bandcamp') {
- return `<iframe style="border: 0; width: 600px; height: 274px;" src="https://bandcamp.com/EmbeddedPlayer/album=${id}/size=large/bgcol=ffffff/linkcol=333333/artwork=small/transparent=true/" seamless></iframe>`
- }
- return `<img src='media/${val}'/>`
- }
-
- this.parse = function (raw = this.raw) {
- if (!raw) { return '' }
-
- let html = ''
- const lines = !Array.isArray(raw) ? raw.split('\n') : raw
-
- for (id in lines) {
- const char = lines[id].substr(0, 1).trim().toString()
- const rune = this.runes[char]
- const trail = lines[id].substr(1, 1)
- if (char == '$') { html += '<p>' + Ø('operation').request(lines[id].substr(2)).to_markup() + '</p>'; continue }
- if (char == '%') { html += this.media(lines[id].substr(2)); continue }
- const line = lines[id].substr(2).to_markup()
- if (!line || line.trim() == '') { continue }
- if (!rune) { console.log(`Unknown rune:${char} : ${line}`) }
- if (trail != ' ') { console.warn('Runic', 'Non-rune[' + trail + '] at:' + id + '(' + line + ')'); continue }
-
- if (this.stash.is_pop(rune)) { html += this.render_stash() }
- if (rune.stash === true) { this.stash.add(rune, line); continue }
- html += this.render(line, rune)
- }
- if (this.stash.length() > 0) { html += this.render_stash() }
- return html
- }
-
- this.render_stash = function () {
- const rune = this.stash.rune
- const stash = this.stash.pop()
-
- let html = ''
- for (id in stash) {
- const rune = stash[id].rune
- const line = stash[id].item
- html += rune.wrap ? `<${rune.sub}><${rune.wrap}>${line.replace(/\|/g, `</${rune.wrap}><${rune.wrap}>`).trim()}</${rune.wrap}></${rune.sub}>` : `<${rune.sub}>${line}</${rune.sub}>`
- }
- return `<${rune.tag} class='${rune.class}'>${html}</${rune.tag}>`
- }
-
- this.render = function (line = '', rune = null) {
- if (rune && rune.tag == 'img') { return `<img src='media/${line}'/>` }
- if (rune && rune.tag == 'table') { return 'HEY' }
-
- return rune ? (rune.tag ? '<' + rune.tag + " class='" + rune.class + "'>" + line + '</' + rune.tag + '>' : line) : ''
+ function wrap (html, tag, cl) {
+ return tag ? `<${tag} ${cl ? 'class="' + cl + '"' : ''}>${html}</${tag}>` : html
}
- this.html = function () {
- return this.parse(raw)
- }
-
- this.toString = function () {
- return this.html()
- }
-}
-
-String.prototype.capitalize = function () {
- return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase()
-}
-
-String.prototype.to_url = function () {
- return this.toLowerCase().replace(/ /g, '+').replace(/[^0-9a-z\+]/gi, '').trim()
-}
-
-String.prototype.to_path = function () {
- return this.toLowerCase().replace(/ /g, '.').replace(/[^0-9a-z\.]/gi, '').trim()
-}
-
-String.prototype.to_markup = function () {
- html = this
- html = html.replace(/{_/g, '<i>').replace(/_}/g, '</i>')
- html = html.replace(/{\*/g, '<b>').replace(/\*}/g, '</b>')
- html = html.replace(/{\#/g, "<code class='inline'>").replace(/\#}/g, '</code>')
-
- const parts = html.split('{{')
- for (id in parts) {
- const part = parts[id]
- if (part.indexOf('}}') == -1) { continue }
- const content = part.split('}}')[0]
- if (content.substr(0, 1) == '$') { html = html.replace(`{{${content}}}`, Ø('operation').request(content.replace('$', ''))); continue }
- // if(content.substr(0,1) == "%"){ html = html.replace(`{{${content}}}`, this.media(content)); continue; }
- const target = content.indexOf('|') > -1 ? content.split('|')[1] : content
- const name = content.indexOf('|') > -1 ? content.split('|')[0] : content
- const external = (target.indexOf('https:') > -1 || target.indexOf('http:') > -1 || target.indexOf('dat:') > -1)
- html = html.replace(`{{${content}}}`, external ? `<a href='${target}' class='external' target='_blank'>${name}</a>` : `<a class='local' href="#${target.to_url()}" onclick="Ø('query').bang('${target}')">${name}</a>`)
+ this.run = (input = [], host = null) => {
+ return input.filter(filter).reduce(stash, []).reduce((acc, stash) => {
+ const rune = lib[stash.rune]
+ const html = stash.arr.reduce((acc, val, id) => {
+ const inner = rune.fn ? rune.fn(stash.arr[id], host) : stash.arr[id]
+ const outer = rune.tag ? wrap(inner, rune.tag, rune.class) : inner
+ return `${acc}${outer}`
+ }, '')
+ return `${acc}${wrap(html, rune.wrapper, rune.wrapperClass)}`
+ }, '')
}
- return html
}
diff --git a/scripts/lib/util.js b/scripts/lib/util.js
@@ -1,6 +0,0 @@
-function Š (target) {
- const elem = document.getElementById('jump-' + target)
- if (!elem) { console.error('Undefined jump target', target); return }
- elem.scrollIntoView()
- elem.focus()
-}
diff --git a/scripts/runic.library.js b/scripts/runic.library.js
@@ -0,0 +1,53 @@
+'use strict'
+
+const runicLibrary = {
+ '>': { },
+ '*': { tag: 'h3' },
+ '+': { tag: 'h4' },
+ '?': {
+ tag: 'div',
+ class: 'notice',
+ fn: (html, host) => {
+ return html.to_markup(host)
+ }
+ },
+ '-': {
+ tag: 'li',
+ wrapper: 'ul',
+ wrapperClass: 'bullet',
+ fn: (html, host) => {
+ return html.to_markup(host)
+ }
+ },
+ '#': {
+ tag: 'li',
+ wrapper: 'code',
+ fn: (html, host) => {
+ return html.to_markup(host)
+ }
+ },
+ '&': {
+ tag: 'p',
+ fn: (html, host) => {
+ return html.to_markup(host)
+ }
+ },
+ ';': {
+ fn: (html, host) => {
+ console.log(html)
+ return ''
+ }
+ },
+ '%': {
+ fn: (html, host) => {
+ const parts = html.split(' ')
+ const service = parts[0]
+ const id = parts[1]
+ if (service === 'itchio') { return `<iframe frameborder="0" src="https://itch.io/embed/${id}?link_color=000000" width="600" height="167"></iframe>` }
+ if (service === 'bandcamp') { return `<iframe style="border: 0; width: 600px; height: 274px;" src="https://bandcamp.com/EmbeddedPlayer/album=${id}/size=large/bgcol=ffffff/linkcol=333333/artwork=small/transparent=true/" seamless></iframe>` }
+ if (service === 'youtube') { return `<iframe width="100%" height="380" src="https://www.youtube.com/embed/${id}?rel=0" style="max-width:700px" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>` }
+ if (service === 'custom') { return `<iframe src='${id}' style='width:100%;height:350px;'></iframe>` }
+ return `<img src='media/${service}' loading='lazy' class='${id}'/>`
+ }
+ }
+}
diff --git a/scripts/templates/ingredient.js b/scripts/templates/ingredient.js
@@ -27,7 +27,7 @@ function IngredientTemplate (id, rect) {
html += `<h1>${name.capitalize()}</h1>`
html += `<ul class='ingredients' style='float:right'>${print_ingredient(name)}</ul>`
html += ingredient.BREF ? `<p class='bref'>${ingredient.BREF.to_markup()}</p>` : ''
- html += ingredient.LONG ? `${new Runic(ingredient.LONG)}` : ''
+ html += ingredient.LONG ? `${runic.run(ingredient.LONG)}` : ''
if (ingredient.PARENT) {
const parent_ingr = all_ingredients[ingredient.PARENT.toUpperCase()]
@@ -35,11 +35,11 @@ function IngredientTemplate (id, rect) {
html += `<p>${parent_ingr.BREF.to_markup()}</p>`
}
if (parent_ingr && parent_ingr.LONG) {
- html += `${new Runic(parent_ingr.LONG)}`
+ html += `${runic.run(parent_ingr.LONG)}`
}
}
- html += ingredient.WARN ? `<section id='warn'>${new Runic(ingredient.WARN)}</section>` : ''
+ html += ingredient.WARN ? `<section id='warn'>${runic.run(ingredient.WARN)}</section>` : ''
const parents = ingredient && ingredient.PARENT ? ingredient.PARENT.split(',') : []
const children = find_child_ingredients(name, all_ingredients)
diff --git a/scripts/templates/page.js b/scripts/templates/page.js
@@ -22,7 +22,7 @@ function PageTemplate (id, rect) {
title: `GrimGrains — ${q.name.capitalize()}`,
view: {
core: {
- content: `<h1>${q.name.capitalize()}</h1><p>${page.BREF.to_markup()}</p><div class='page'>${new Runic(page.LONG).toString()}</div>`
+ content: `<h1>${q.name.capitalize()}</h1><p>${page.BREF.to_markup()}</p><div class='page'>${runic.run(page.LONG).toString()}</div>`
}
}
}
diff --git a/scripts/templates/recipe.js b/scripts/templates/recipe.js
@@ -36,7 +36,7 @@ function RecipeTemplate (id, rect) {
<img class='photo' src='media/recipes/${q.name.to_path()}.jpg'/>
- <columns>${new Runic(recipe.DESC)}</columns>
+ <columns>${runic.run(recipe.DESC)}</columns>
${make_ingredients(recipe.INGR)}
${make_warnings(recipe, q.tables.ingredients)}
${make_instructions(recipe)}`
@@ -53,7 +53,7 @@ function RecipeTemplate (id, rect) {
for (const cat in recipe.INST) {
html += `<h3>Step ${count}: ${cat.capitalize()}</h3>`
const category = recipe.INST[cat].map(convertTemperatures)
- html += new Runic(category).toString()
+ html += runic.run(category).toString()
count += 1
}
@@ -69,7 +69,7 @@ function RecipeTemplate (id, rect) {
const warn = all_ingredients[id].WARN
html += `
<section id='warn'>
- ${new Runic(warn)}
+ ${runic.run(warn)}
</section>
`
}