emoji in recipe

main
Mel 3 years ago
parent c15350eb33
commit 425ad27e18

@ -81,6 +81,6 @@
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 0.31417237776158075,
"scale": 0.31039964305995404,
"close": true
}

@ -9,8 +9,8 @@
"state": {
"type": "markdown",
"state": {
"file": "03.03 Recipes/Tomato Salad.md",
"mode": "preview"
"file": "00.01 Admin/Templates/layout$qrecipe.md",
"mode": "source"
}
}
}
@ -35,7 +35,7 @@
"state": {
"type": "search",
"state": {
"query": "tag:#Investment",
"query": "Comf",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
@ -64,7 +64,7 @@
}
}
],
"currentTab": 3
"currentTab": 0
},
"right": {
"id": "901f0677c871de02",
@ -76,7 +76,7 @@
"state": {
"type": "backlink",
"state": {
"file": "03.03 Recipes/Tomato Salad.md",
"file": "00.01 Admin/Templates/layout$qrecipe.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -115,15 +115,15 @@
},
"active": "c1cbd199334b4022",
"lastOpenFiles": [
"03.03 Recipes/Tomato Salad.md",
"03.03 Recipes/@Side dishes.md",
"03.03 Recipes/Salade Nicoise.md",
"03.03 Recipes/Yellow Beef Meetball Curry.md",
"03.03 Recipes/Thai Pork Rice Bowl.md",
"03.03 Recipes/Thai Pork Salad.md",
"03.03 Recipes/Teriyaki Sesame Chicken.md",
"03.03 Recipes/Beet n Goat Cheese Salad.md",
"03.03 Recipes/TexMex Beef Tacos.md",
"03.03 Recipes/@Main dishes.md"
"00.01 Admin/Templates/Untitled.md",
"00.01 Admin/Templates/layout$qproduct.md",
"03.03 Recipes/@@Recipes.md",
"00.01 Admin/Templates/layout$qplace.md",
"03.03 Recipes/@Desserts.md",
"03.03 Recipes/Aromatic Beef Pilaf.md",
"01.01 Life Orga/Finances.md",
"01.01 Life Orga/Lifestyle.md",
"03.03 Recipes/Mushroom Fricassée.md",
"03.03 Recipes/@Side dishes.md"
]
}

@ -0,0 +1,3 @@
```dataviewjs
dv.view("00.01 Admin/dv-views/query_recipe", {course: , dateadded: , category: , cuisine: , ingredient: , theme: , isfavourite: , rating: , cookingtime: , viewtype: "extended"})
```

@ -7,24 +7,24 @@ class globalFunc {
if (moment(iarg2).isValid()) {iarg2 = arg2.toString()}
if (!Array.isArray(iarg2) && !Array.isArray(iarg1)) {
var resultdc = iarg1.search(new RegExp(iarg2, "i")) > -1
var resultdc = this.compareData(iarg1, iarg2)
} else if (!Array.isArray(iarg1)) {
let tempresult = false
for (let i = 0; i < iarg2.length; i++) {
tempresult = tempresult || iarg1.search(new RegExp(iarg2[i], "i")) > -1
tempresult = tempresult || this.compareData(iarg1, iarg2[i]) > -1
}
var resultdc = tempresult
} else if (!Array.isArray(iarg2)) {
let tempresult = false
for (let i = 0; i < iarg1.length; i++) {
tempresult = tempresult || iarg1[i].search(new RegExp(iarg2, "i")) > -1
tempresult = tempresult || this.compareData(iarg1[i], iarg2)
}
var resultdc = tempresult
} else {
let tempresult = false
for (let i = 0; i < arg2.length; i++) {
for (let j = 0; j < arg1.length; j++) {
tempresult = tempresult || iarg1[j].search(new RegExp(iarg2[i], "i")) > -1
tempresult = tempresult || this.compareData(iarg1[j], iarg2[i])
}
}
@ -34,6 +34,56 @@ class globalFunc {
return resultdc
}
compareData(arg1, arg2) {
let tempresult = false;
if (arg2.length > 1 && this.hasOperator(arg2)) {
switch(this.getOperator(arg2)) {
case '<':
tempresult = (parseFloat(arg1) < parseFloat(arg2.replace(this.getOperator(arg2), "")))
break;
case '<=':
tempresult = (parseFloat(arg1) <= parseFloat(arg2.replace(this.getOperator(arg2), "")))
break;
case '>':
tempresult = (parseFloat(arg1) > parseFloat(arg2.replace(this.getOperator(arg2), "")))
break;
case '>=':
tempresult = (parseFloat(arg1) >= parseFloat(arg2.replace(this.getOperator(arg2), "")))
break;
case '!':
if (isNaN(arg2.replace("!", ""))) {
tempresult = !(arg1.search(new RegExp(arg2, "i")) > -1)
} else {tempresult = (parseFloat(arg1) != parseFloat(arg2.replace(this.getOperator(arg2), "")))}
break;
}
} else {tempresult = (arg1.search(new RegExp(arg2, "i")) > -1)}
return tempresult
}
hasOperator(arg1) {
let tempresult = false;
switch(arg1.charAt(0)) {
case '<':
case '>':
case '!':
tempresult = true
break;
}
return tempresult
}
getOperator(arg1) {
let tempresult = arg1.charAt(0);
if (this.hasOperator(arg1.charAt(1))) {
tempresult = tempresult + arg1.charAt(1)
}
return tempresult
}
BuildList(arg1, construct) {
let ilength = arg1.length
@ -108,19 +158,18 @@ class globalFunc {
getTable(dv, DocType, darray, iarray, tabletype) {
// let tablet = (darray.contains('tabletype')) ? iarray[0] : 0;
let page = dv.pages()
.filter(p => p && this.topLevelFilter(p, DocType, 0))
.where(p => p && this.IsInSearch(p, DocType, darray, iarray))
if (page.length === 0) {
if (typeof page == 'undefined' || typeof page == 'null' || page.length === 0) {
return this.EmptyQueryMessage()
}
dv.table(this.GetTableHeaders(DocType, tabletype), page
dv.table(this.GetTableHeaders(DocType, tabletype), page
.sort(p => p.file.name, `asc`)
.map(p => this.GetTableMap(DocType, tabletype,p)));
}
EmptyQueryMessage() {
@ -197,7 +246,14 @@ class globalFunc {
case 'Recipe':
TempData = ["Name", "Category", "Cuisine", "Cooking time", "Rating (1-5)"]
switch(TableT) {
case 0:
TempData = ["Name", "Category", "Cuisine", "Cooking time", "Rating (1-5)"]
break;
case 'extended':
TempData = ["Name", "Course", "Category", "Cuisine", "Cooking time", "Rating (1-5)", "Favourite"]
break;
}
break;
@ -239,7 +295,7 @@ class globalFunc {
case 'Brunch':
case 'Hotel':
case 'Bar':
TempData = [p.file.link, this.GetPoint(p, DataT, "subtype"), this.GetPoint(p, DataT, "style"), this.GetPoint(p, DataT, "phone"), this.GetPoint(p, DataT, "email"), this.GetPoint(p, DataT, "website")]
TempData = [p.file.link, this.GetPoint(p, DataT, "subtype"), this.toEmoji(this.GetPoint(p, DataT, "style")), this.GetPoint(p, DataT, "phone"), this.GetPoint(p, DataT, "email"), this.GetPoint(p, DataT, "website")]
break;
case 'Sport':
TempData = [p.file.link, this.GetPoint(p, DataT, "phone"), this.GetPoint(p, DataT, "email"), this.GetPoint(p, DataT, "website")]
@ -275,7 +331,14 @@ class globalFunc {
case 'Recipe':
TempData = [p.file.link, this.GetPoint(p, DataT, "category"), this.GetPoint(p, DataT, "collection"), this.GetPoint(p, DataT, "cooking") + " min", this.GetPoint(p, DataT, "rating")]
switch(TableT) {
default:
TempData = [p.file.link, this.GetPoint(p, DataT, "category"), this.toEmoji(this.GetPoint(p, DataT, "collection")), this.GetPoint(p, DataT, "cooking") + " min", this.GetPoint(p, DataT, "rating")]
break;
case 'extended':
TempData = [p.file.link, this.GetPoint(p, DataT, "course"), this.GetPoint(p, DataT, "category"), this.toEmoji(this.GetPoint(p, DataT, "collection")), this.GetPoint(p, DataT, "cooking") + " min", this.GetPoint(p, DataT, "rating"), this.toEmoji(Boolean(this.GetPoint(p, DataT, "isfavourite")))]
break;
}
break;
@ -285,6 +348,102 @@ class globalFunc {
}
toEmoji(label) {
let tempresult = ""
if (Array.isArray(label)) {
for (let i = 0; i < label.length; i++) {
if (tempresult == '') {
tempresult = this.getEmoji(label[i]);
} else {tempresult = tempresult + " / " + this.getEmoji(label[i]);}
}
} else {tempresult = this.getEmoji(label)}
return tempresult
}
getEmoji(label) {
let tempresult = ""
switch(label) {
case 'French':
tempresult = "🇫🇷"
break;
case 'Italian':
tempresult = "🇮🇹"
break;
case 'British':
tempresult = "🇬🇧"
break;
case 'American':
case 'US':
tempresult = "🇺🇸"
break;
case 'Indian':
tempresult = "🇮🇳"
break;
case 'Mexican':
tempresult = "🇲🇽"
break;
case 'Asian':
case 'Asian Fusion':
tempresult = "⛩"
break;
case 'Modern':
tempresult = "💠"
break;
case 'Peruvian':
tempresult = "🇵🇪"
break;
case 'Spanish':
tempresult = "🇪🇸"
break;
case 'Greek':
tempresult = "🇬🇷"
break;
case 'Japanese':
tempresult = "🇯🇵"
break;
case 'Argentine':
tempresult = "🇦🇷"
break;
case 'Chinese':
tempresult = "🇨🇳"
break;
case 'Taiwanese':
tempresult = "🇹🇼"
break;
case 'Egg':
tempresult = "🥚"
break;
case 'Middle Eastern':
tempresult = "☪️"
break;
case 'European':
tempresult = "🇪🇺"
break;
case 'North African':
case 'North African Fusion':
tempresult = "🇲🇦"
break;
case 'Pub':
tempresult = "🍺"
break;
case true:
tempresult = "✅"
break;
case false:
tempresult = "❌"
break;
case 'Fish':
tempresult = "🐠"
break;
default:
tempresult = cuisine
}
return tempresult
}
GetpProp(pobj, DocType, dPoint) {
let result = null
@ -390,6 +549,9 @@ class globalFunc {
case 'rating':
result = this.GetPoint(pobj, DocType, "rating")
break;
case 'cookingtime':
result = this.GetPoint(pobj, DocType, "cooking")
break;
}
return result
}

@ -1,7 +1,8 @@
const {globalFunc} = customJS
const DataType = 'Recipe'
let {course, category, cuisine, ingredient, dateadded, theme, isfavourite, rating} = input;
const iArray = [course, category, cuisine, ingredient, dateadded, theme, isfavourite, rating];
const dArray = ["course", "category", "cuisine", "ingredient", "dateadded", "theme", "isfavourite", "rating"];
let {viewtype, course, category, cuisine, ingredient, dateadded, theme, isfavourite, rating, cookingtime} = input;
const iArray = [course, category, cuisine, ingredient, dateadded, theme, isfavourite, rating, cookingtime];
const dArray = ["course", "category", "cuisine", "ingredient", "dateadded", "theme", "isfavourite", "rating", "cookingtime"];
let tempview = Boolean(viewtype) ? `${viewtype}` : 0
return globalFunc.getTable(dv, DataType, dArray, iArray, 0)
return globalFunc.getTable(dv, DataType, dArray, iArray, tempview)

@ -1,6 +1,6 @@
---
Tag: ["Business"]
Tag: ["Business", "Cadre"]
Date: 2021-10-05
DocType: "Place"
Hierarchy: "NonRoot"
@ -9,7 +9,7 @@ location:
Place:
Type: Bar
SubType: AfterWork
Style: Location
Style: British
Location: City
Country: UK
Status: Occasional

@ -9,7 +9,7 @@ location:
Place:
Type: ["Hotel", "Bar"]
SubType: Rooftop
Style: Chilled
Style: British
Location: Soho
Country: UK
Status: Occasional

@ -8,8 +8,8 @@ TimeStamp:
location:
Place:
Type: Bar
SubType: Pub
Style: "By the Thames"
SubType: Traditional
Style: Pub
Location: City
Country: UK
Status: Occasional

@ -9,7 +9,7 @@ location:
Place:
Type: ["Hotel", "Restaurant", "Bar"]
SubType: Chicago
Style: Hipster
Style: British
Location: Shoreditch
Country: UK
Status: Occasional

@ -1,6 +1,6 @@
---
Tag: ["MembersClub"]
Tag: ["MembersClub", "Cadre"]
Date: 2021-10-05
DocType: "Place"
Hierarchy: "NonRoot"
@ -9,7 +9,7 @@ location:
Place:
Type: ["Hotel", "Restaurant", "Bar"]
SubType: Rooftop
Style: Location
Style: British
Location: City
Country: UK
Status: Tested

@ -9,7 +9,7 @@ location:
Place:
Type: ["Hotel", "Bar"]
SubType: "New York"
Style: "Laid Back"
Style: US
Location: StPancras
Country: UK
Status: Tested

@ -3,10 +3,11 @@
QueryCourse:
QueryCategory: ""
QueryCuisine: ""
QueryIngredient: pepper
QueryIngredient: "!coriander"
QueryTheme: ""
QueryFavourite:
QueryRating:
QueryRating: ""
QueryCookingTime: "<20"
Alias: ["Recipes"]
Tag: ["Lifestyle", "Food", "Cooking"]
Date: 2021-10-20
@ -76,14 +77,14 @@ id EditMetaData
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/print_data", {toprint: [dv.current().QueryCourse, dv.current().QueryCategory, dv.current().QueryCuisine, dv.current().QueryIngredient, dv.current().QueryTheme, dv.current().QueryFavourite, dv.current().QueryRating,
dv.view("00.01 Admin/dv-views/print_data", {toprint: [dv.current().QueryCourse, dv.current().QueryCategory, dv.current().QueryCuisine, dv.current().QueryIngredient, dv.current().QueryTheme, dv.current().QueryFavourite, dv.current().QueryRating, dv.current().QueryCookingTime,
dv.current().QueryAddedDate]})
```
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/query_recipe", {course: dv.current().QueryCourse, dateadded: dv.current().QueryAddedDate, category: dv.current().QueryCategory, cuisine: dv.current().QueryCuisine, ingredient: dv.current().QueryIngredient, theme: dv.current().QueryTheme, isfavourite: dv.current().QueryFavourite, rating: dv.current().QueryRating})
dv.view("00.01 Admin/dv-views/query_recipe", {course: dv.current().QueryCourse, dateadded: dv.current().QueryAddedDate, category: dv.current().QueryCategory, cuisine: dv.current().QueryCuisine, ingredient: dv.current().QueryIngredient, theme: dv.current().QueryTheme, isfavourite: dv.current().QueryFavourite, rating: dv.current().QueryRating, cookingtime: dv.current().QueryCookingTime, viewtype: "extended"})
```
&emsp;

@ -1,7 +1,7 @@
---
Alias: ["Snacks"]
Tag: ["Sweet", "Savoury", "Comfort food"]
Tag: ["Sweet", "Savoury", "ComfortFood"]
Date: 2021-10-21
DocType: "Personal"
Hierarchy: "Root2"
@ -67,7 +67,7 @@ dv.view("00.01 Admin/dv-views/query_recipe", {course: "Snack", category: ["Cooki
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/query_recipe", {course: "Snack", category: ["Cookie", "Pancacke"]})
dv.view("00.01 Admin/dv-views/query_recipe", {course: "Snack", category: ["Dip"]})
```
&emsp;
&emsp;

@ -10,7 +10,7 @@ location: [51.514678599999996, -0.18378583926867909]
CollapseMetaTable: Yes
Meta:
IsFavourite: False
Rating: 4
Rating: 3
Recipe:
Courses: "Side Dish"
Categories: Vegetable

@ -10,7 +10,7 @@ location: [51.514678599999996, -0.18378583926867909]
CollapseMetaTable: Yes
Meta:
IsFavourite: False
Rating: 4
Rating: 3
Recipe:
Courses: "Side Dish"
Categories: "Salad"

@ -9,7 +9,7 @@ Hierarchy: "NonRoot"
location: [51.514678599999996, -0.18378583926867909]
CollapseMetaTable: Yes
Meta:
IsFavourite: False
IsFavourite: True
Rating: 4
Recipe:
Courses: "Main Dish"

@ -9,7 +9,7 @@ Hierarchy: "NonRoot"
location: [51.514678599999996, -0.18378583926867909]
CollapseMetaTable: Yes
Meta:
IsFavourite: False
IsFavourite: True
Rating: 4
Recipe:
Courses: "Main Dish"

@ -0,0 +1,135 @@
---
ServingSize: 4
cssclass: recipeTable
Tag: ["Earthy", "Wine"]
Date: 2021-09-21
DocType: "Recipe"
Hierarchy: "NonRoot"
location: [51.514678599999996, -0.18378583926867909]
CollapseMetaTable: Yes
Meta:
IsFavourite: True
Rating: 5
Recipe:
Courses: "Side Dish"
Categories: Vegetable
Collections: French
Source: https://www.bbc.co.uk/food/recipes/fricasseeofwildmushr_93489
PreparationTime:
CookingTime: 30
OServingSize: 4
Ingredients:
- 400 grams wild mushrooms (pied de mouton, girolle, chanterelle and trompette de la mort)
- 30 grams unsalted butter
- 0.25 whole onion, peeled, chopped
- 1 clove(s) garlic, peeled, puréed
- 100 ml dry white wine
- 4 pinches sea salt
- 4 pinches freshly ground black pepper
- 10 grams fresh flatleaf parsley leaves, roughly chopped
- 1 sprig fresh tarragon, leaves only, finely chopped
- 2 sprigs fresh chervil, finely chopped
- 1 tbsp lemon juice
---
Parent:: [[@@Recipes|Recipes]]
---
&emsp;
```button
name Edit Recipe parameters
type command
action MetaEdit: Run MetaEdit
id EditMetaData
```
^button-MushroomFricasseeEdit
```button
name Save
type command
action Save current file
id Save
```
^button-MushroomFricasseeNSave
&emsp;
# Mushroom Fricassée
&emsp;
```toc
style: number
```
&emsp;
---
&emsp;
### Practical Informations
| |
|-|-
**Courses**: | `$=dv.current().Recipe.Courses`
**Categories**: | `$=dv.current().Recipe.Categories`
**Collections**: | `$=dv.current().Recipe.Collections`
**Serving size**: | `$=dv.current().ServingSize`
**Cooking time**: | `$=dv.current().Recipe.CookingTime` min
&emsp;
---
&emsp;
### Ingredients
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/query_ingredient", {ingredients: dv.current().Ingredients, originalportioncount: dv.current().Recipe.OServingSize})
```
&emsp;
---
&emsp;
### Instructions
&emsp;
1. Lightly brush the mushrooms to get rid of any remaining dirt or mud. Briefly wash the mushrooms in a large bowl of fresh water (for no more than 10-15 seconds) then lift them out and place onto a clean tea towel. Gently pat dry, then cut off the base of the stalks and discard.
&emsp;
2. Heat the butter in a pan over a medium heat until foaming, then add the shallots and garlic and fry for 30 seconds.
&emsp;
3. Increase the heat to high, then add the pied de mouton mushrooms and cook for one minute.
&emsp;
4. Add the white wine and cook for one minute, or until the liquid has reduced slightly, then add the girolles.
&emsp;
5. Cook for a further minute before adding the trompette de la mort, herbs and lemon juice. Stir well.
&emsp;
6. Add a splash of water if the mixture is becoming too dry, then season, to taste, with salt and freshly ground black pepper.
&emsp;
&emsp;

@ -2,7 +2,7 @@
ServingSize: 2
cssclass: recipeTable
Tag: ["Easy", "Comfort food"]
Tag: ["Easy", "ComfortFood"]
Date: 2021-09-21
DocType: "Recipe"
Hierarchy: "NonRoot"

@ -9,7 +9,7 @@ Hierarchy: "NonRoot"
location: [51.514678599999996, -0.18378583926867909]
CollapseMetaTable: Yes
Meta:
IsFavourite: False
IsFavourite: True
Rating: 4
Recipe:
Courses: "Side Dish"

@ -58,7 +58,8 @@ All tasks and to-dos Crypto-related.
&emsp;
- [ ] [[Crypto Tasks#internet alerts|monitor Crypto news and publications]] 🔁 every week on Friday 📅 2021-10-22
- [ ] [[Crypto Tasks#internet alerts|monitor Crypto news and publications]] 🔁 every week on Friday 📅 2021-10-29
- [x] [[Crypto Tasks#internet alerts|monitor Crypto news and publications]] 🔁 every week on Friday 📅 2021-10-22 ✅ 2021-10-22
- [x] [[Crypto Tasks#internet alerts|monitor Crypto news and publications]] 🔁 every week on Friday 📅 2021-10-15 ✅ 2021-10-15
- [x] [[Crypto Tasks#internet alerts|monitor Crypto news and publications]] 🔁 every week on Friday 📅 2021-10-08 ✅ 2021-10-08
- [x] [[Crypto Tasks#internet alerts|monitor Crypto news and publications]] 🔁 every week on Friday 📅 2021-10-01 ✅ 2021-10-01

@ -58,7 +58,8 @@ Note summarising all tasks and to-dos for Listed Equity investments.
&emsp;
- [ ] [[Equity Tasks#internet alerts|monitor Equity news and publications]] 🔁 every week on Friday 📅 2021-10-22
- [ ] [[Equity Tasks#internet alerts|monitor Equity news and publications]] 🔁 every week on Friday 📅 2021-10-29
- [x] [[Equity Tasks#internet alerts|monitor Equity news and publications]] 🔁 every week on Friday 📅 2021-10-22 ✅ 2021-10-22
- [x] [[Equity Tasks#internet alerts|monitor Equity news and publications]] 🔁 every week on Friday 📅 2021-10-15 ✅ 2021-10-15
- [x] [[Equity Tasks#internet alerts|monitor Equity news and publications]] 🔁 every week on Friday 📅 2021-10-08 ✅ 2021-10-08
- [x] [[Equity Tasks#internet alerts|monitor Equity news and publications]] 🔁 every week on Friday 📅 2021-10-01 ✅ 2021-10-01

@ -58,7 +58,8 @@ Tasks and to-dos for VC investments.
&emsp;
- [ ] [[VC Tasks#internet alerts|monitor VC news and publications]] 🔁 every week on Friday 📅 2021-10-22
- [ ] [[VC Tasks#internet alerts|monitor VC news and publications]] 🔁 every week on Friday 📅 2021-10-29
- [x] [[VC Tasks#internet alerts|monitor VC news and publications]] 🔁 every week on Friday 📅 2021-10-22 ✅ 2021-10-22
- [x] [[VC Tasks#internet alerts|monitor VC news and publications]] 🔁 every week on Friday 📅 2021-10-15 ✅ 2021-10-15
- [x] [[VC Tasks#internet alerts|monitor VC news and publications]] 🔁 every week on Friday 📅 2021-10-08 ✅ 2021-10-08
- [x] [[VC Tasks#internet alerts|monitor VC news and publications]] 🔁 every week on Friday 📅 2021-10-01 ✅ 2021-10-01

Loading…
Cancel
Save