From ae6583a2826d9eba17408e557f523e4f5ae40038 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 18 Apr 2021 22:25:45 +0200 Subject: add title --- bin/pyggle | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/pyggle b/bin/pyggle index 436f51e..109c5fd 100755 --- a/bin/pyggle +++ b/bin/pyggle @@ -169,9 +169,17 @@ if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=__doc__ ) - parser.add_argument("--header-include", metavar="FILE", type=str, help="file with HTML to include before thumbnail list") + parser.add_argument( + "--html-include", + metavar="FILE", + type=str, + help="file with HTML to include before thumbnail list", + ) parser.add_argument("--size", type=int, default=250, help="Thumbnail size [px]") - parser.add_argument("--spacing", type=float, default=1.1, help="Thumbnail spacing ratio") + parser.add_argument( + "--spacing", type=float, default=1.1, help="Thumbnail spacing ratio" + ) + parser.add_argument("--title", type=str, help="HTML title", default="") parser.add_argument("images", type=str, nargs="+") args = parser.parse_args() @@ -181,10 +189,10 @@ if __name__ == "__main__": copy_files(f"{base_dir}/share") with open(f"{base_dir}/share/html_start", "r") as f: - html_buf = f.read() + html_buf = f.read().replace("", args.title) - if args.header_include: - with open(args.header_include, "r") as f: + if args.html_include: + with open(args.html_include, "r") as f: html_buf += f.read() filenames = args.images -- cgit v1.2.3