From a9ec31367187bc0159100688e13400ca86b2709a Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 29 Mar 2020 23:24:35 +0200 Subject: Unify recipe for regular and automated indices Also don't run pandoc in a pipeline within a Makefile recipe: pipefail is not set, so generate-index.py failures will not be bubbled up. --- repo/www/generate-deps.py | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'repo/www/generate-deps.py') diff --git a/repo/www/generate-deps.py b/repo/www/generate-deps.py index d88d333..f17e950 100755 --- a/repo/www/generate-deps.py +++ b/repo/www/generate-deps.py @@ -37,42 +37,26 @@ def pjoin(directory, item): def write_dependencies(deps_file, directories, top_dir, out_dir): pages = list() - indices = list() - autoindices = list() for dpath, d in directories.items(): - autoindex = True - src_dir = pjoin(top_dir, dpath) + html_dir = pjoin(out_dir, dpath) for f in d.files: src_path = path.join(src_dir, f) - name, _ = path.splitext(f) - deps = [src_path] - target = pages if name == 'README': - name = 'index' - deps.append(src_dir) - target = indices - autoindex = False + html_path = path.join(html_dir, 'index.html') + print(f'{html_path}: {src_path}', file=deps_file) + continue - html_dir = pjoin(out_dir, dpath) html_path = path.join(html_dir, name+'.html') - - print(f'{html_path}: {" ".join(deps)} | {html_dir}', file=deps_file) - target.append(html_path) - - if autoindex: - autoindices.append( - path.join(out_dir, dpath, 'index.html') - ) + print(f'{html_path}: {src_path} | {html_dir}', file=deps_file) + pages.append(html_path) print(file=deps_file) print(f'pages = {" ".join(pages)}', file=deps_file) - print(f'indices = {" ".join(indices)}', file=deps_file) - print(f'autoindices = {" ".join(autoindices)}', file=deps_file) def main(arguments): -- cgit v1.2.3