mirror of
https://github.com/Anduin2017/HowToCook.git
synced 2026-01-12 15:14:58 +08:00
Compare commits
3 Commits
cddd3962e2
...
656b420a06
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
656b420a06 | ||
|
|
1ec2a5a398 | ||
|
|
9b774c4f16 |
28
.github/manual_lint.js
vendored
28
.github/manual_lint.js
vendored
@@ -96,6 +96,34 @@ async function main() {
|
|||||||
errors.push(`文件 ${filePath} 不符合仓库的规范!它的大标题应该是: ${"# " + filename + "的做法"}! 而它现在是 ${titles[0].trim()}!`);
|
errors.push(`文件 ${filePath} 不符合仓库的规范!它的大标题应该是: ${"# " + filename + "的做法"}! 而它现在是 ${titles[0].trim()}!`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查烹饪难度
|
||||||
|
const mainTitleIndex = dataLines.indexOf(titles[0].trim());
|
||||||
|
const firstSecondTitleIndex = dataLines.indexOf(secondTitles[0].trim());
|
||||||
|
|
||||||
|
if (mainTitleIndex >= 0 && firstSecondTitleIndex >= 0) {
|
||||||
|
// 检查大标题和第一个二级标题之间是否有预估烹饪难度
|
||||||
|
let hasDifficulty = false;
|
||||||
|
const difficultyPattern = /^预估烹饪难度:★{1,5}$/;
|
||||||
|
|
||||||
|
for (let i = mainTitleIndex + 1; i < firstSecondTitleIndex; i++) {
|
||||||
|
if (difficultyPattern.test(dataLines[i])) {
|
||||||
|
hasDifficulty = true;
|
||||||
|
// 检查星星数量是否在1-5之间
|
||||||
|
const starCount = (dataLines[i].match(/★/g) || []).length;
|
||||||
|
if (starCount < 1 || starCount > 5) {
|
||||||
|
errors.push(`文件 ${filePath} 不符合仓库的规范!烹饪难度的星星数量必须在1-5颗之间!`);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasDifficulty) {
|
||||||
|
errors.push(`文件 ${filePath} 不符合仓库的规范!在大标题和第一个二级标题之间必须包含"预估烹饪难度:★★"格式的难度评级,星星数量必须在1-5颗之间!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (secondTitles.length != 4) {
|
if (secondTitles.length != 4) {
|
||||||
errors.push(`文件 ${filePath} 不符合仓库的规范!它并不是四个标题的格式。请从示例菜模板中创建菜谱!请不要破坏模板的格式!`);
|
errors.push(`文件 ${filePath} 不符合仓库的规范!它并不是四个标题的格式。请从示例菜模板中创建菜谱!请不要破坏模板的格式!`);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
4
.github/templates/readme_template.md
vendored
4
.github/templates/readme_template.md
vendored
@@ -45,3 +45,7 @@ docker run -d -p 5000:5000 ghcr.io/anduin2017/how-to-cook:latest
|
|||||||
如果你已经做了许多上面的菜,对于厨艺已经入门,并且想学习更加高深的烹饪技巧,请继续阅读下面的内容:
|
如果你已经做了许多上面的菜,对于厨艺已经入门,并且想学习更加高深的烹饪技巧,请继续阅读下面的内容:
|
||||||
|
|
||||||
{{after}}
|
{{after}}
|
||||||
|
|
||||||
|
## 衍生作品推荐
|
||||||
|
|
||||||
|
- [HowToCook-mcp 让 AI 助手变身私人大厨,为你的一日三餐出谋划策](https://github.com/worryzyy/HowToCook-mcp)
|
||||||
|
|||||||
@@ -399,3 +399,7 @@ docker run -d -p 5000:5000 ghcr.io/anduin2017/how-to-cook:latest
|
|||||||
- [辅料技巧](tips/advanced/辅料技巧.md)
|
- [辅料技巧](tips/advanced/辅料技巧.md)
|
||||||
- [高级专业术语](tips/advanced/高级专业术语.md)
|
- [高级专业术语](tips/advanced/高级专业术语.md)
|
||||||
- [油温判断技巧](tips/advanced/油温判断技巧.md)
|
- [油温判断技巧](tips/advanced/油温判断技巧.md)
|
||||||
|
|
||||||
|
## 衍生作品推荐
|
||||||
|
|
||||||
|
- [HowToCook-mcp 让 AI 助手变身私人大厨,为你的一日三餐出谋划策](https://github.com/worryzyy/HowToCook-mcp)
|
||||||
|
|||||||
Reference in New Issue
Block a user