summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-04-18 22:25:45 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-04-18 22:25:45 +0200
commitae6583a2826d9eba17408e557f523e4f5ae40038 (patch)
tree69afd3d4344213ca3a415403bc5c779069bce339 /bin
parent3e82fbcc77fa2083b068f212c1487726b8a40284 (diff)
add title
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pyggle18
1 files changed, 13 insertions, 5 deletions
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("<!-- $title -->", 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