Merge branch 'master' into master

This commit is contained in:
Anduin Xue 2022-03-07 08:54:37 +00:00 committed by GitHub
commit 36ff5fcb34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 227 additions and 125 deletions

View File

@ -1,4 +1,5 @@
const { readdir, writeFile, stat } = require('fs/promises');
const fs = require('fs').promises;
const README_PATH = './README.md';
@ -59,124 +60,6 @@ const categories = {
},
};
let README_TEMPLATE = `# 程序员做饭指南
[![build](https://github.com/Anduin2017/HowToCook/actions/workflows/build.yml/badge.svg)](https://github.com/Anduin2017/HowToCook/actions/workflows/build.yml)
[![License](https://img.shields.io/github/license/Anduin2017/HowToCook)](./LICENSE)
[![GitHub contributors](https://img.shields.io/github/contributors/Anduin2017/HowToCook)](https://github.com/Anduin2017/HowToCook/graphs/contributors)
[![npm](https://img.shields.io/npm/v/how-to-cook)](https://www.npmjs.com/package/how-to-cook)
最近在家隔离出不了门只能宅在家做饭了作为程序员我偶尔在网上找找菜谱和做法但是这些菜谱往往写法千奇百怪经常中间莫名出来一些材料对于习惯了形式语言的程序员来说极其不友好
所以我计划自己搜寻菜谱和并结合实际做菜的经验准备用更清晰精准的描述来整理常见菜的做法以方便程序员在家做饭
同样我希望它是一个由社区驱动和维护的开源项目使更多人能够一起做一个有趣的仓库所以非常欢迎大家贡献它~
## 如何贡献
针对发现的问题直接修改并提交 Pull request 即可
在写新菜谱时请复制并修改已有的菜谱模板: [示例菜](https://github.com/Anduin2017/HowToCook/blob/master/dishes/template/%E7%A4%BA%E4%BE%8B%E8%8F%9C/%E7%A4%BA%E4%BE%8B%E8%8F%9C.md?plain=1)。
## 做菜之前
{{before}}
## 菜谱
### 家常菜
{{main}}
## 进阶知识学习
如果你已经做了许多上面的菜对于厨艺已经入门并且想学习更加高深的烹饪技巧请继续阅读下面的内容
{{after}}`;
let MKDOCS_TEMPLATE = `site_name: How To Cook
# Repository
repo_name: Anduin2017/HowToCook
repo_url: https://github.com/Anduin2017/HowToCook
edit_uri: ""
use_directory_urls: true
docs_dir: .
theme:
name: material
language: zh
features:
- content.code.annotate
# - content.tabs.link
# - header.autohide
#- navigation.expand
#- navigation.indexes
- navigation.instant
- navigation.sections
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow
# # - toc.integrate
search_index_only: true
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material//weather-sunny
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-night
name: Switch to light mode
icon:
admonition:
note: octicons/tag-16
abstract: octicons/checklist-16
info: octicons/info-16
tip: octicons/squirrel-16
success: octicons/check-16
question: octicons/question-16
warning: octicons/alert-16
failure: octicons/x-circle-16
danger: octicons/zap-16
bug: octicons/bug-16
example: octicons/beaker-16
quote: octicons/quote-16
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences
- abbr
- pymdownx.snippets
- def_list
- pymdownx.tasklist:
custom_checkbox: true
- attr_list
plugins:
- same-dir
- search
- minify:
minify_html: true
nav:
- README.md
- 做菜之前:
{{before}}
- 菜谱:
- 按种类: # 只有两层section以上才能出现navigation expansion https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-sections
{{main}}
- 进阶知识学习:
{{after}}
- CONTRIBUTING.md
`;
async function main() {
try {
let README_BEFORE = (README_MAIN = README_AFTER = '');
@ -211,16 +94,22 @@ async function main() {
MKDOCS_MAIN += categoryMkdocsTemplate(category.title, category.mkdocs);
}
const MKDOCS_TEMPLATE = await fs.readFile("./.github/templates/mkdocs_template.yml", "utf-8");
const README_TEMPLATE = await fs.readFile("./.github/templates/readme_template.md", "utf-8");
await writeFile(
README_PATH,
README_TEMPLATE.replace('{{before}}', README_BEFORE)
.replace('{{main}}', README_MAIN)
.replace('{{after}}', README_AFTER),
README_TEMPLATE
.replace('{{before}}', README_BEFORE.trim())
.replace('{{main}}', README_MAIN.trim())
.replace('{{after}}', README_AFTER.trim()),
);
await writeFile(
MKDOCS_PATH,
MKDOCS_TEMPLATE.replace('{{before}}', MKDOCS_BEFORE)
MKDOCS_TEMPLATE
.replace('{{before}}', MKDOCS_BEFORE)
.replace('{{main}}', MKDOCS_MAIN)
.replace('{{after}}', MKDOCS_AFTER),
);

85
.github/templates/mkdocs_template.yml vendored Normal file
View File

@ -0,0 +1,85 @@
site_name: How To Cook
# Repository
repo_name: Anduin2017/HowToCook
repo_url: https://github.com/Anduin2017/HowToCook
edit_uri: ""
use_directory_urls: true
docs_dir: .
theme:
name: material
language: zh
features:
- content.code.annotate
# - content.tabs.link
# - header.autohide
#- navigation.expand
#- navigation.indexes
- navigation.instant
- navigation.sections
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow
# # - toc.integrate
search_index_only: true
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material//weather-sunny
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-night
name: Switch to light mode
icon:
admonition:
note: octicons/tag-16
abstract: octicons/checklist-16
info: octicons/info-16
tip: octicons/squirrel-16
success: octicons/check-16
question: octicons/question-16
warning: octicons/alert-16
failure: octicons/x-circle-16
danger: octicons/zap-16
bug: octicons/bug-16
example: octicons/beaker-16
quote: octicons/quote-16
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences
- abbr
- pymdownx.snippets
- def_list
- pymdownx.tasklist:
custom_checkbox: true
- attr_list
plugins:
- same-dir
- search
- minify:
minify_html: true
nav:
- README.md
- 做菜之前:
{{before}}
- 菜谱:
- 按种类: # 只有两层section以上才能出现navigation expansion https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-sections
{{main}}
- 进阶知识学习:
{{after}}
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md

34
.github/templates/readme_template.md vendored Normal file
View File

@ -0,0 +1,34 @@
# 程序员做饭指南
[![build](https://github.com/Anduin2017/HowToCook/actions/workflows/build.yml/badge.svg)](https://github.com/Anduin2017/HowToCook/actions/workflows/build.yml)
[![License](https://img.shields.io/github/license/Anduin2017/HowToCook)](./LICENSE)
[![GitHub contributors](https://img.shields.io/github/contributors/Anduin2017/HowToCook)](https://github.com/Anduin2017/HowToCook/graphs/contributors)
[![npm](https://img.shields.io/npm/v/how-to-cook)](https://www.npmjs.com/package/how-to-cook)
最近在家隔离,出不了门。只能宅在家做饭了。作为程序员,我偶尔在网上找找菜谱和做法。但是这些菜谱往往写法千奇百怪,经常中间莫名出来一些材料。对于习惯了形式语言的程序员来说极其不友好。
所以,我计划自己搜寻菜谱和并结合实际做菜的经验,准备用更清晰精准的描述来整理常见菜的做法,以方便程序员在家做饭。
同样,我希望它是一个由社区驱动和维护的开源项目,使更多人能够一起做一个有趣的仓库。所以非常欢迎大家贡献它~
## 如何贡献
针对发现的问题,直接修改并提交 Pull request 即可。
在写新菜谱时,请复制并修改已有的菜谱模板: [示例菜](https://github.com/Anduin2017/HowToCook/blob/master/dishes/template/%E7%A4%BA%E4%BE%8B%E8%8F%9C/%E7%A4%BA%E4%BE%8B%E8%8F%9C.md?plain=1)。
## 做菜之前
{{before}}
## 菜谱
### 家常菜
{{main}}
## 进阶知识学习
如果你已经做了许多上面的菜,对于厨艺已经入门,并且想学习更加高深的烹饪技巧,请继续阅读下面的内容:
{{after}}

View File

@ -1,6 +1,6 @@
# Code Of Counduct
# 行为准则
## 这个仓库可以做什么?
## 我们为什么坚持维护这个仓库
有很多朋友问我,为什么要维护这个仓库?为什么坚持精准的菜谱?未来这个仓库打算怎么发展?有没有想流量变现?我想在这里给出我自己的答案,并明确贡献的价值观吧。

View File

@ -42,6 +42,7 @@
- [葱煎豆腐](./dishes/vegetable_dish/葱煎豆腐.md)
- [地三鲜](./dishes/vegetable_dish/地三鲜.md)
- [红烧茄子](./dishes/vegetable_dish/红烧茄子.md)
- [虎皮青椒](./dishes/vegetable_dish/虎皮青椒/虎皮青椒.md)
- [鸡蛋羹](./dishes/vegetable_dish/鸡蛋羹/鸡蛋羹.md)
- [微波炉鸡蛋羹](./dishes/vegetable_dish/鸡蛋羹/微波炉鸡蛋羹.md)
- [茄子炖土豆](./dishes/vegetable_dish/茄子炖土豆.md)
@ -182,6 +183,7 @@
- [金汤力](./dishes/drink/金汤力/金汤力.md)
- [可乐桶](./dishes/drink/可乐桶.md)
- [奶茶](./dishes/drink/奶茶.md)
- [奇异果菠菜特调](./dishes/drink/奇异果菠菜特调/奇异果菠菜特调.md)
- [酸梅汤](./dishes/drink/酸梅汤/酸梅汤.md)
- [酸梅汤(半成品加工)](./dishes/drink/酸梅汤(半成品加工).md)
- [杨枝甘露](./dishes/drink/杨枝甘露.md)

View File

@ -3,6 +3,9 @@ set -e
# Requires: Ruby, node, python
tput setaf 2; echo "Cleaning up..."; tput setaf 0
rm ./node_modules -rf
tput setaf 2; echo "Installing markdown lint"; tput setaf 0
gem install mdl
@ -10,7 +13,7 @@ tput setaf 2; echo "Generating new readme and mkdocs"; tput setaf 0
node ./.github/readme-generate.js
tput setaf 2; echo "Running markdown lint to check issues."; tput setaf 0
mdl . -r ~MD036,~MD024,~MD004,~MD029
mdl ./dishes ./tips -r ~MD036,~MD024,~MD004,~MD029
tput setaf 2; echo "Installing python requirements..."; tput setaf 0
pip install -r requirements.txt

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -0,0 +1,43 @@
# 奇异果菠菜特调的做法
## 必备原料和工具
- 原料:
- 奇异果
- 苹果
- 菠菜叶少许
- 水
- 白砂糖
- 工具
- 榨汁机
## 计算
- 饮用水 700ml
- 奇异果 2 个
- 苹果 1/2 个
- 菠菜叶 4 叶
- 白砂糖 12 克
## 操作
- 将猕猴桃切成两半,每半再分四份小块
- 将苹果切丁
- 将菠菜叶去梗,只留叶子部分
- 将菠菜切碎
- 一起倒入榨汁机搅拌杯
- 注水
- 加入白砂糖
- 启动搅拌机,搅拌约 4 个 15 秒(每 15 秒停下看状态)
## 附加内容
- 关于白砂糖的量:全糖为 12g可根据个人情况在 0-12g 中调整
- 本品是仿照宜家的奇异果菠菜汁自己研制的,没有宜家的好喝,但也不错
- 欢迎改进!
### 成品
![奇异果菠菜特调](kiwi-example.jpg)
如果您遵循本指南的制作流程而发现有问题或可以改进的流程,请提出 Issue 或 Pull request 。

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 KiB

View File

@ -0,0 +1,43 @@
# 虎皮青椒的做法
## 必备的原料和工具
青椒若干,大蒜 2 瓣,香醋 15ml白糖 15g生抽 5ml油 15ml盐少许。
- 大青椒
- 大蒜
- 白糖(灵魂)
- 醋
- 生抽
- 盐
- 砵或者有一定深度的碗
## 计算
- 青椒 5 个 长度在 10-15cm 的最为合适
- 大蒜 2-3 瓣
- 白糖 15g
- 生抽 15ml 和白糖等量
## 操作
- 准备工作:
- 去掉青椒蒂,用自来水冲洗干净。
- 青椒切长片,平均一个青椒纵向切成 3-4 片即可。
- 大蒜去皮,切成碎末,体积在 2mm x 2mm x 2mm 即可。
- 调料 1
- 拿一个小碗倒入 20ml 油,将大蒜末放入其中。
- 调料 2
- 白糖、生抽、醋、盐全部倒入砵(碗)等容器
- 烹饪:
- 将'调料 1'倒入锅中,开火加热 5 成放入青椒。(青椒片不要叠在一起,单独成片放置锅中)
- 用锅铲不停的按压青椒,合适的时候翻面。
- 待青椒表皮出现褶皱时,倒入'调料 2',同时加大火候,翻炒。
- 30s 后即可出锅盛入盘中。
## 附加内容
如果您遵循本指南的制作流程而发现有问题或可以改进的流程,请提出 Issue 或 Pull request 。
![虎皮青椒](./虎皮青椒.jpg)

View File

@ -96,6 +96,7 @@ nav:
- 葱煎豆腐: ./dishes/vegetable_dish/葱煎豆腐.md
- 地三鲜: ./dishes/vegetable_dish/地三鲜.md
- 红烧茄子: ./dishes/vegetable_dish/红烧茄子.md
- 虎皮青椒: ./dishes/vegetable_dish/虎皮青椒/虎皮青椒.md
- 鸡蛋羹: ./dishes/vegetable_dish/鸡蛋羹/鸡蛋羹.md
- 微波炉鸡蛋羹: ./dishes/vegetable_dish/鸡蛋羹/微波炉鸡蛋羹.md
- 茄子炖土豆: ./dishes/vegetable_dish/茄子炖土豆.md
@ -229,6 +230,7 @@ nav:
- 金汤力: ./dishes/drink/金汤力/金汤力.md
- 可乐桶: ./dishes/drink/可乐桶.md
- 奶茶: ./dishes/drink/奶茶.md
- 奇异果菠菜特调: ./dishes/drink/奇异果菠菜特调/奇异果菠菜特调.md
- 酸梅汤: ./dishes/drink/酸梅汤/酸梅汤.md
- 酸梅汤(半成品加工): ./dishes/drink/酸梅汤(半成品加工).md
- 杨枝甘露: ./dishes/drink/杨枝甘露.md
@ -257,3 +259,4 @@ nav:
- 油温判断技巧: ./tips/advanced/油温判断技巧.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md