From c1668ca07d161c635fa5fea5c3db15e36a030b71 Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Thu, 1 Oct 2015 23:14:18 +0800 Subject: [PATCH] [doc] Using hardcoded README.md again --- Makefile | 5 ++--- devscripts/make_readme.py | 4 ++-- devscripts/prepare_manpage.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d48485567..fdb1abb60 100644 --- a/Makefile +++ b/Makefile @@ -61,8 +61,7 @@ youtube-dl: youtube_dl/*.py youtube_dl/*/*.py chmod a+x youtube-dl README.md: youtube_dl/*.py youtube_dl/*/*.py - COLUMNS=80 python youtube_dl/__main__.py --help | python devscripts/make_readme.py README.md > README.new.md - mv -f README.new.md README.md + COLUMNS=80 python youtube_dl/__main__.py --help | python devscripts/make_readme.py CONTRIBUTING.md: README.md python devscripts/make_contributing.py README.md CONTRIBUTING.md @@ -74,7 +73,7 @@ README.txt: README.md pandoc -f markdown -t plain README.md -o README.txt youtube-dl.1: README.md - python devscripts/prepare_manpage.py README.md > youtube-dl.1.temp.md + python devscripts/prepare_manpage.py >youtube-dl.1.temp.md pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1 rm -f youtube-dl.1.temp.md diff --git a/devscripts/make_readme.py b/devscripts/make_readme.py index c9dd35aa1..8fbce0796 100755 --- a/devscripts/make_readme.py +++ b/devscripts/make_readme.py @@ -4,7 +4,7 @@ import io import sys import re -README_FILE = sys.argv[1] +README_FILE = 'README.md' helptext = sys.stdin.read() if isinstance(helptext, bytes): @@ -20,7 +20,7 @@ options = helptext[helptext.index(' General Options:') + 19:] options = re.sub(r'(?m)^ (\w.+)$', r'## \1', options) options = '# OPTIONS\n' + options + '\n' -with io.open(sys.stdout.fileno(), 'w', encoding='utf-8') as f: +with io.open(README_FILE, 'w', encoding='utf-8') as f: f.write(header) f.write(options) f.write(footer) diff --git a/devscripts/prepare_manpage.py b/devscripts/prepare_manpage.py index 06cea7e54..776e6556e 100644 --- a/devscripts/prepare_manpage.py +++ b/devscripts/prepare_manpage.py @@ -6,7 +6,7 @@ import sys import re ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -README_FILE = os.path.join(ROOT_DIR, sys.argv[1]) +README_FILE = os.path.join(ROOT_DIR, 'README.md') def filter_options(readme):