summaryrefslogtreecommitdiff
path: root/repo/www/make-deps.py
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2020-03-14 00:57:36 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2020-03-14 00:58:12 +0100
commit676eb0e85ca242250dcf2463d5447ccc0a1c2114 (patch)
treee654b572baafd05c995f33cf7264ee4a3aa4b7da /repo/www/make-deps.py
parent51e8ca3908b2b1d67403bcc17c027333618a931e (diff)
downloadmemory-leaks-676eb0e85ca242250dcf2463d5447ccc0a1c2114.tar.xz
Turn READMEs into HTML indices
Diffstat (limited to 'repo/www/make-deps.py')
-rwxr-xr-xrepo/www/make-deps.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/repo/www/make-deps.py b/repo/www/make-deps.py
index d6720e5..92da680 100755
--- a/repo/www/make-deps.py
+++ b/repo/www/make-deps.py
@@ -22,8 +22,17 @@ def find_sources(top_dir):
def html_path(source_path, top_dir, out_dir):
- _, ext = path.splitext(source_path)
- return source_path.replace(top_dir, out_dir).replace(ext, '.html')
+ fname = path.basename(source_path)
+ dname = path.dirname(source_path)
+
+ name, _ = path.splitext(fname)
+
+ if name == 'README':
+ name = 'index'
+
+ return path.join(
+ out_dir, path.relpath(dname, top_dir), f'{name}.html'
+ )
def write_dependencies(output, sources, top_dir, out_dir):