diff --git a/abctemplate.py b/abctemplate.py index 52e0be2..9de32e1 100755 --- a/abctemplate.py +++ b/abctemplate.py @@ -56,30 +56,20 @@ if __name__ == "__main__": lines = f.readlines() input_path = pathlib.Path(args.input.name) + fname = input_path.stem + fdir = input_path.parent vars = dict() - vars["changename"] = "" - vars["changetitle"] = "" - vars["changevisibility"] = "no" - vars["creditvisibility"] = "no" + vars["notesvisibility"] = "no" - vars["name"] = input_path.stem - vars["title"] = getFieldDisplayText(lines, "T", latex=args.latex) - vars["subtitle"] = getFieldDisplayText(lines, "T", n=2, latex=args.latex) - vars["composer"] = getFieldDisplayText(lines, "C", latex=args.latex) - vars["key"] = getFieldDisplayText(lines, "K", latex=args.latex) - vars["changefile"] = getFieldDisplayText(lines, "N", starts="Change:", latex=args.latex) - vars["credit"] = getFieldDisplayText(lines, "N", starts="Credit:", latex=args.latex) - - if vars["changefile"]: - vars["changevisibility"] = "yes" - vars["changename"] = pathlib.Path(vars["changefile"]).stem - cf = pathlib.Path(input_path.parent, vars["changefile"]) - with cf.open() as f: - vars["changetitle"] = getFieldDisplayText(f, "T", latex=args.latex) - - if vars["credit"]: - vars["creditvisibility"] = "yes" + vars["name"] = fname + vars["title"] = getFieldDisplayText(lines, fdir, "T", latex=args.latex) + vars["subtitle"] = getFieldDisplayText(lines, fdir, "T", n=2, latex=args.latex) + vars["composer"] = getFieldDisplayText(lines, fdir, "C", latex=args.latex) + vars["key"] = getFieldDisplayText(lines, fdir, "K", latex=args.latex) + vars["notes"] = getFieldDisplayText(lines, fdir, "N", starts="Dottes:", latex=args.latex) + if vars["notes"]: + vars["notesvisibility"] = "yes" for val in args.values: keyval = val.partition("=") diff --git a/dottes.html.tune b/dottes.html.tune index 900a0fd..12b1bce 100644 --- a/dottes.html.tune +++ b/dottes.html.tune @@ -43,12 +43,8 @@ ${title} dots -
- From ${credit}. -
-
- Change: ${changetitle} +
+ ${notes}