]>
Raphaƫl G. Git Repositories - youtubedl/blob - devscripts/prepare_manpage.py
7ece37754d1003ba4cbe63fed109eef00711adcd
1 from __future__
import unicode_literals
8 ROOT_DIR
= os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
)))
9 README_FILE
= os
.path
.join(ROOT_DIR
, 'README.md')
11 with io
.open(README_FILE
, encoding
='utf-8') as f
:
14 PREFIX
= '''%YOUTUBE-DL(1)
18 youtube\-dl \- download videos from youtube.com or other video platforms
22 **youtube-dl** \[OPTIONS\] URL [URL...]
25 readme
= re
.sub(r
'(?s)^.*?(?=# DESCRIPTION)', '', readme
)
26 readme
= re
.sub(r
'\s+youtube-dl \[OPTIONS\] URL \[URL\.\.\.\]', '', readme
)
27 readme
= PREFIX
+ readme
29 if sys
.version_info
< (3, 0):
30 print(readme
.encode('utf-8'))