Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Anduin2017 authored Mar 13, 2022
2 parents c9d1dc0 + d164a0a commit cecf184
Show file tree
Hide file tree
Showing 37 changed files with 260 additions and 117 deletions.
116 changes: 53 additions & 63 deletions .github/manual_lint.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,53 @@
// fetch all .md files.
// Check it's content.
// Console.LogError for errors.


const glob = require("glob");
const fs = require("fs");
var path = require('path');

var errors = 0;

var getDirectories = function (src, callback) {
glob(src + '../../dishes/**/*.md', callback);
};

getDirectories(__dirname, function (err, res) {
res.forEach(filePath => {
// console.log("Linting file: " + filePath + " ...");

fs.readFile(filePath, 'utf8' , (err, data) => {
data = data.replace('\r\n', '\n');
data = data.replace('\r', '\n');

dataLines = data.split('\n');
var filename = path.parse(filePath).base.replace(".md","");

titles = dataLines.filter(t => t.startsWith('#'));
secondTitles = titles
.filter(t => t.startsWith('## '));

if (titles[0].trim() != "# " + filename + "的做法") {
console.error(`File ${filePath} is invalid! It's title should be: ${"# " + filename + "的做法"}! It was ${titles[0].trim()}!`);
errors++;
return;
}
if (secondTitles.length != 4) {
console.error(`File ${filePath} is invalid! It doesn't has 4 second titles!`);
errors++;
return;
}
if (secondTitles[0].trim() != "## 必备原料和工具") {
console.error(`File ${filePath} is invalid! The first title is NOT 必备原料和工具! It was ${secondTitles[0]}!`);
errors++;
}
if (secondTitles[1].trim() != "## 计算") {
console.error(`File ${filePath} is invalid! The second title is NOT 计算!`);
errors++;
}
if (secondTitles[2].trim() != "## 操作") {
console.error(`File ${filePath} is invalid! The thrid title is NOT 操作!`);
errors++;
}
if (secondTitles[3].trim() != "## 附加内容") {
console.error(`File ${filePath} is invalid! The fourth title is NOT 附加内容!`);
errors++;
}
});
});
});

if (errors > 0) {
throw `Found ${errors} errors! Please fix!`;
}
const util = require("util");
const glob = util.promisify(require('glob'));
const fs = require("fs").promises;
const path = require('path');


async function main() {
var errors = [];
var directories = await glob(__dirname + '../../dishes/**/*.md');

for (var filePath of directories) {
var data = await fs.readFile(filePath, 'utf8');

dataLines = data.split('\n').map(t => t.trim());
var filename = path.parse(filePath).base.replace(".md","");

titles = dataLines.filter(t => t.startsWith('#'));
secondTitles = titles
.filter(t => t.startsWith('## '));

if (titles[0].trim() != "# " + filename + "的做法") {
errors.push(`File ${filePath} is invalid! It's title should be: ${"# " + filename + "的做法"}! It was ${titles[0].trim()}!`);
continue;
}
if (secondTitles.length != 4) {
errors.push(`File ${filePath} is invalid! It doesn't has 4 second titles!`);
continue;
}
if (secondTitles[0].trim() != "## 必备原料和工具") {
errors.push(`File ${filePath} is invalid! The first title is NOT 必备原料和工具! It was ${secondTitles[0]}!`);
}
if (secondTitles[1].trim() != "## 计算") {
errors.push(`File ${filePath} is invalid! The second title is NOT 计算!`);
}
if (secondTitles[2].trim() != "## 操作") {
errors.push(`File ${filePath} is invalid! The thrid title is NOT 操作!`);
}
if (secondTitles[3].trim() != "## 附加内容") {
errors.push(`File ${filePath} is invalid! The fourth title is NOT 附加内容!`);
}
}

if (errors.length > 0) {
for (var error of errors) {
console.error(error + "\n");
}

var message = `Found ${errors.length} errors! Please fix!`;
throw new Error(message);
}
}

main();
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ npm install

tput setaf 2; echo "Running textlint..."; tput sgr0
./node_modules/.bin/textlint . --fix

tput setaf 2; echo "Manual rule linting..."; tput sgr0
node .github/manual_lint.js
2 changes: 1 addition & 1 deletion dishes/breakfast/吐司果酱.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 吐司+果酱的做法
# 吐司果酱的做法

饱腹感的懒人快速营养早餐,2min 搞定

Expand Down
4 changes: 2 additions & 2 deletions dishes/breakfast/微波炉蛋糕.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 微波炉"叮"蛋糕的做法
# 微波炉蛋糕的做法

不必慌张, 你有十分充足的时间来准备, 可以根据心情加料, 大约需要 2min
微波炉"叮"蛋糕,大约需要 2min 就能搞定!

## 必备原料和工具

Expand Down
2 changes: 2 additions & 0 deletions dishes/breakfast/水煮玉米.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
- 水煮开之后转至小火,加盖继续煮 15-20 分钟,玉米煮久点没事。
- 煮熟后沥干水分,冷却后食用。

## 附加内容

如果您遵循本指南的制作流程而发现有问题或可以改进的流程,请提出 Issue 或 Pull request 。
9 changes: 9 additions & 0 deletions dishes/breakfast/美式炒蛋.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@

## 必备原料和工具

- 鸡蛋
- 全脂牛奶/奶油
- 黄油
-

## 计算

每份:

- 鸡蛋 3 个
- 全脂牛奶/奶油 10g
- 黄油 5 克
Expand Down
2 changes: 1 addition & 1 deletion dishes/breakfast/蒸花卷.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 蒸花卷
# 蒸花卷的做法

蒸花卷是一道简单易做的菜。能补充碳水化合物,膳食纤维。一般初学者只需要半小时即可完成。作为快手早餐,学会做之后,再也不会早上饿肚子了。

Expand Down
10 changes: 10 additions & 0 deletions dishes/breakfast/鸡蛋三明治.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

## 必备原料和工具

- 鸡蛋
- 吐司
- 培根
- 黄油
- 蛋黄酱
-
- 黑胡椒

## 计算

- 鸡蛋 1 个
- 吐司 2 片
- 培根 2 片
Expand Down
27 changes: 22 additions & 5 deletions dishes/condiment/油泼辣子/油泼辣子.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,37 @@
![image](./口水鸡+油泼辣子.jpg)
![image](./油泼辣子.jpg)

## 制作耗时

- 10 分钟
制作耗时 10 分钟

## 必备原料和工具

- 蒜头
- 干辣椒面
-
- 熟白芝麻
- 小米椒
- 花生油(可用菜籽油替换)
- 家庭小陶瓷碗
- 家庭小铁勺
- 五香粉 (可选)
- 草寇(可选)
- 小葱 (可选)
- 八角
- 花椒
- 香叶
- 白芷
- 姜片(可选)
-
- 白醋

## 计算

- 蒜头 1 个
- 干辣椒面 100 克
- 盐 5 克
- 熟白芝麻 15 克
- 小米椒 1 个
- 花生油 150 毫升 (可用菜籽油替换)
- 家庭小陶瓷碗 1 个
- 家庭小铁勺 1 个
- 五香粉 10 克(可选)
- 草寇 1 个(可选)
- 小葱 3-5 根(可选)
Expand Down
6 changes: 5 additions & 1 deletion dishes/condiment/糖色.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- 绵白糖:可以不加水
- 炒糖色过程火不要太大!!!电磁炉温度不够,火候过了发苦,不够发甜

## 计量
## 计算

- ``:100ml
- `开水`:500ml
Expand All @@ -27,3 +27,7 @@
- 需要在此时快速进行下一步操作(无论哪种操作都一定要提前准备好并快速!否则火候过大糖色发苦),根据菜品派别以及个人口味作出选择
- 操作 1:可以直接加 400ml 开水降温
- 操作 2:也可以加入葱姜蒜花椒等调味品进行翻炒

## 附加内容

如果您遵循本指南的制作流程而发现有问题或可以改进的流程,请提出 Issue 或 Pull request 。
2 changes: 1 addition & 1 deletion dishes/condiment/草莓酱/草莓酱.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 草莓的做法
# 草莓酱的做法

可以买那种一筐一筐卖的小草莓,主要是便宜。做成酱抹在面包上非常好吃。

Expand Down
2 changes: 1 addition & 1 deletion dishes/condiment/蒜香酱油.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 蒜香豉油的做法
# 蒜香酱油的做法

## 必备原料和工具

Expand Down
16 changes: 13 additions & 3 deletions dishes/dessert/提拉米苏/提拉米苏.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@

## 必备原料和工具

- 马斯卡彭芝士
- 手指饼干
- 放凉浓缩咖啡
- 无菌鸡蛋
- 白砂糖
- 可可粉
- 朗姆酒(不喜欢酒的朋友可省略,可按照自己口味调节)
- 一个装成品的容器(我用的是玻璃乐扣)
- 打蛋器(手劲儿大的朋友也可以锻炼臂力)

## 计算

- 马斯卡彭芝士 450g
- 手指饼干 1 包
- 放凉浓缩咖啡 350ml
- 无菌鸡蛋 4 个
- 白砂糖 50g
- 可可粉
- 可可粉 10g
- 朗姆酒(不喜欢酒的朋友可省略,可按照自己口味调节)
- 一个装成品的容器(我用的是玻璃乐扣)
- 打蛋器(手劲儿大的朋友也可以锻炼臂力)

## 操作

Expand Down
20 changes: 16 additions & 4 deletions dishes/dessert/烤蛋挞/烤蛋挞.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@

该配方为整包蛋挞皮所需量 填充后可直接冷冻保存

- 蛋挞皮 品牌不限
- 鸡蛋
- 牛奶
- 淡奶油
- 白砂糖
- 烤箱 大小不限
- 克数称
- 搅拌器 包含且不限于筷子 打蛋器等工具
- 筛网 网孔约为 1 毫米

## 计算

每份:

该配方为整包蛋挞皮所需量 填充后可直接冷冻保存

- 蛋挞皮 品牌不限 整包蛋挞皮约为 30 只
- 鸡蛋 8 个 普通鸡蛋即可
- 牛奶 200 毫升 普通袋装牛奶即可
- 淡奶油 450 毫升 烘焙店或超市即有售
- 白砂糖 80 克 普通砂糖即可 细砂糖更优 易于融化
- 烤箱 大小不限
- 克数称
- 搅拌器 包含且不限于筷子 打蛋器等工具
- 筛网 网孔约为 1 毫米

## 操作

Expand Down
20 changes: 16 additions & 4 deletions dishes/dessert/芋泥雪媚娘/芋泥雪媚娘.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,22 @@

## 必备原料和工具

- 荔浦芋头(电商平台购买即可,实惠新鲜) 200g
- 荔浦芋头(电商平台购买即可,实惠新鲜)
- 紫薯粉
- 牛奶
- 糯米粉
- 玉米淀粉
- 黄油
- 淡奶油
- 白砂糖
- 料理搅拌机(电动打蛋器也可以)
- 筛网
- 保鲜膜
- 白砂糖

## 计算

- 荔浦芋头 200g
- 紫薯粉 3g
- 牛奶 165g
- 糯米粉 a 50g
Expand All @@ -15,9 +30,6 @@
- 黄油 30g
- 淡奶油(推荐安佳) 145g
- 白砂糖 26g
- 料理搅拌机(电动打蛋器也可以)
- 筛网 网孔约为 1 毫米
- 保鲜膜

## 操作

Expand Down
2 changes: 1 addition & 1 deletion dishes/drink/酸梅汤(半成品加工).md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 酸梅汁的做法
# 酸梅汤(半成品加工)的做法

## 必备原料和工具

Expand Down
2 changes: 1 addition & 1 deletion dishes/meat_dish/回锅肉.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- 生抽酱油
- 味精

### 计算
## 计算

- 五花肉的用量为 0.5 斤/男人 0.3 斤/女人 (正宗回锅肉使用二刀肉[俗称:臀尖]制作,肉质坚实,肥瘦合适)
- 小葱 2 棵
Expand Down
15 changes: 14 additions & 1 deletion dishes/meat_dish/姜炒鸡/姜炒鸡.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@

姜炒鸡是一道湖南口味菜,下饭五颗星,食材平平无奇又十分容易烹制,包你一学就会。

## 必备原料和计算
## 必备原料和工具

-
- 生姜
- 啤酒
- 生抽
- 老抽
-
- 小米椒
- 美人辣
- 泡椒
- 大蒜

## 计算

- 鸡 = 半只(土鸡最好,预计 650g)
- 食用油 = 50ml(茶油最好,没有就用菜籽油)
Expand Down
2 changes: 1 addition & 1 deletion dishes/meat_dish/宫保鸡丁/宫保鸡丁.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- 植物油
- 芝麻油

## 可选原料
### 可选原料

- 油泼辣子
- 莴笋
Expand Down
Loading

0 comments on commit cecf184

Please sign in to comment.