From 6a2b197e02753ef83ab77a28a790dd967a474d5f Mon Sep 17 00:00:00 2001 From: KV Date: Tue, 21 Jul 2020 23:58:39 +0200 Subject: [PATCH] Simplify code --- src/wireviz/build_examples.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wireviz/build_examples.py b/src/wireviz/build_examples.py index ffc5a897..1ef9ebb6 100755 --- a/src/wireviz/build_examples.py +++ b/src/wireviz/build_examples.py @@ -59,9 +59,9 @@ def build(dirname): with open_file_append(path / readme) as out: if include_readme: - with open_file_read(path / f'{yaml_file.stem}.md') as info: + with open_file_read(yaml_file.with_suffix('.md')) as info: for line in info: - out.write(line.replace('## ', '## {} - '.format(i))) + out.write(line.replace('## ', f'## {i} - ')) out.write('\n\n') else: out.write(f'## Example {i}\n')