forked from Anduin2017/HowToCook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d90e46
commit 774420e
Showing
18 changed files
with
98 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// 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 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()}!`); | ||
return; | ||
} | ||
if (secondTitles.length != 4) { | ||
console.error(`File ${filePath} is invalid! It doesn't has 4 second titles!`); | ||
return; | ||
} | ||
if (secondTitles[0].trim() != "## 必备原料和工具") { | ||
console.error(`File ${filePath} is invalid! The first title is NOT 必备原料和工具! It was ${secondTitles[0]}!`); | ||
return; | ||
} | ||
if (secondTitles[1].trim() != "## 计算") { | ||
console.error(`File ${filePath} is invalid! The second title is NOT 计算!`); | ||
return; | ||
} | ||
if (secondTitles[2].trim() != "## 操作") { | ||
console.error(`File ${filePath} is invalid! The thrid title is NOT 操作!`); | ||
return; | ||
} | ||
if (secondTitles[3].trim() != "## 附加内容") { | ||
console.error(`File ${filePath} is invalid! The fourth title is NOT 附加内容!`); | ||
return; | ||
} | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# 红烧鲤鱼的做法 | ||
|
||
## 必备原料与工具 | ||
## 必备原料和工具 | ||
|
||
- 大葱、姜、大蒜、干辣椒 | ||
- 油、盐、生抽、老抽、陈醋、蚝油、料酒、白糖 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
![红烧肉成品](./001.jpg) | ||
|
||
## 必备原料与工具 | ||
## 必备原料和工具 | ||
|
||
- 注:如果有可能,请尽量把刀磨的锋利一些。 | ||
- 主料:`大肉`、`鸡蛋`(可选)、`豆皮`(可选) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# 烙饼的做法 | ||
|
||
## 必备原料与工具 | ||
## 必备原料和工具 | ||
|
||
* 油 | ||
* 面粉 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
# 煮锅蒸米饭的做法 | ||
|
||
## 必备的原料和工具 | ||
## 必备原料和工具 | ||
|
||
- 北方大米 | ||
- 水 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# 上汤娃娃菜的做法 (素菜|减肥餐) | ||
# 上汤娃娃菜的做法 | ||
|
||
上汤娃娃菜的做法 (素菜|减肥餐) | ||
|
||
## 必备原料和工具 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# 红烧茄子的做法 | ||
|
||
## 原料与工具 | ||
## 必备原料和工具 | ||
|
||
- 大蒜 | ||
- 大葱 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
# 虎皮青椒的做法 | ||
|
||
## 必备的原料和工具 | ||
## 必备原料和工具 | ||
|
||
青椒若干,大蒜 2 瓣,香醋 15ml,白糖 15g,生抽 5ml,油 15ml,盐少许。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# 西红柿鸡蛋的做法 | ||
# 西红柿炒鸡蛋的做法 | ||
|
||
西红柿炒蛋是中国家常几乎最常见的一道菜肴。它的原材料易于搜集,制作步骤也较为简单,所以非常适合新厨师上手,是很多人学习做菜时做的第一道菜。 | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters