-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMakefile.docs
19 lines (16 loc) · 944 Bytes
/
Makefile.docs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- mode: Makefile -*-
# This file contains rules to update both README files (English and Chinese) from the help text.
# It is run automatically by my homepage update scripts before a commit.
# This is why all changes to the Usage section should be made in the jianpu-ly.py doc string.
update-readme:
awk -- 'BEGIN {p=1} /^Run jianpu-ly / {p=0} // {if(p) print}' < README.md > n
python jianpu-ly.py --markdown | awk -- 'BEGIN {p=0} /^Run jianpu-ly / {p=1} // {if(p) print}' >> n
echo >> n
awk -- 'BEGIN {p=0} /^Copyright and Trademarks/ {p=1} // {if(p) print}' < README.md >> n
mv n README.md
awk -- 'BEGIN {p=1} / jianpu-ly < / {p=0} // {if(p) print}' < README_zh-Hans.md > n
python jianpu-ly.py --markdown --chinese | awk -- 'BEGIN {p=0} / jianpu-ly < / {p=1} // {if(p) print}' >> n
echo >> n
awk -- 'BEGIN {p=0} /^版权和商标/ {p=1} // {if(p) print}' < README_zh-Hans.md >> n
mv n README_zh-Hans.md
.PHONY: update-readme