generated from best-of-lists/best-of
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjustfile
61 lines (52 loc) · 1.41 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
set dotenv-load
python := env_var_or_default('PYTHON','python')
# 列出可用任务
@default:
just --list
# 安装、升级依赖
bootstrap:
{{ python }} -m pip install --upgrade ruamel.yaml
# 同步类别
sync-categories *ARGS:
{{ python }} ./scripts/sync_categories.py ./projects.yaml ./.github/ISSUE_TEMPLATE/01_suggest-project.yml {{ ARGS }}
# 列出项目添加请求
list-project-suggestions:
gh issue list --label add-project
# 从 issue 添加项目
add-project ISSUE_NUMBER:
gh issue view {{ ISSUE_NUMBER }} --json body | {{ python }} ./scripts/add_project.py ./projects.yaml
# 用`README.md`构建可用于`pandoc --from gfm`的`build/index.md`
build-for-pandoc:
#!/usr/bin/env bash
set -euxo pipefail
rm -rf build
mkdir -p build
cd build
# Write metadata
cat > index.md <<- "EOF"
---
title: best-of-BITs (bytes)
lang: zh-CN
header-includes: |
<style>
details {
margin-top: 1em;
}
li {
margin-top: 0.2em;
}
.note {
border-left: 0.25em solid #004daa;
padding-left: 1em;
}
.note > .title {
color: #004daa;
}
</style>
---
EOF
# Delete `<h1>` and unnecessary buttons
cat ../README.md \
| sed '1,5d' \
| grep --invert-match '<a href="#contents">.* alt="Back to top"></a>' \
>> index.md