# HG changeset patch # User Jim Hague # Date 1507566631 -3600 # Node ID f620323ff96d94ff6e5000a1c410a4b86cea3148 # Parent 77cc2f93258739bc12bf672cbc61dd535fcf4382 Add subtitle if present in tune links. diff -r 77cc2f932587 -r f620323ff96d abcfield.py --- a/abcfield.py Mon Oct 09 16:38:38 2017 +0100 +++ b/abcfield.py Mon Oct 09 17:30:31 2017 +0100 @@ -181,7 +181,12 @@ fname = m.group(1) + ".abc" path = pathlib.Path(dir, fname) with path.open() as f: - return "[" + getFieldDisplayText(f, dir, "T", latex) + "](" + fname + ")" + title = getFieldDisplayText(f, dir, "T", latex=latex) + f.seek(0) + subtitle = getFieldDisplayText(f, dir, "T", n=2, latex=latex) + if len(subtitle) > 0: + title = title + " (" + subtitle + ")" + return "[" + title + "](" + fname + ")" return re.sub(r'<(.*?).abc>', getTitle, t) # Return the raw text for a given field. Optionally the nth field is taken,