]>
jfr.im git - yt-dlp.git/blob - devscripts/make_readme.py
3 # yt-dlp --help | make_readme.py
4 # This must be run in a console of correct width
8 README_FILE
= 'README.md'
9 helptext
= sys
.stdin
.read()
11 if isinstance(helptext
, bytes):
12 helptext
= helptext
.decode('utf-8')
14 with open(README_FILE
, encoding
='utf-8') as f
:
17 header
= oldreadme
[:oldreadme
.index('## General Options:')]
18 footer
= oldreadme
[oldreadme
.index('# CONFIGURATION'):]
20 options
= helptext
[helptext
.index(' General Options:'):]
21 options
= re
.sub(r
'(?m)^ (\w.+)$', r
'## \1', options
)
22 options
= options
+ '\n'
24 with open(README_FILE
, 'w', encoding
='utf-8') as f
: