comparison abcfield.py @ 722:f8ab14cc9d8d build-default-281

Add previous and next tune links to website.
author Jim Hague <jim.hague@acm.org>
date Tue, 10 Oct 2017 15:01:22 +0100
parents f620323ff96d
children f9a554e858f3
comparison
equal deleted inserted replaced
721:f053b23af061 722:f8ab14cc9d8d
174 174
175 # Implement a custom Markdown shorthand for referencing ABC files. 175 # Implement a custom Markdown shorthand for referencing ABC files.
176 # <foo.abc> will expand to ['title of foo'](foo.abc). 176 # <foo.abc> will expand to ['title of foo'](foo.abc).
177 def expandCustomMarkdown(t, dir, latex): 177 def expandCustomMarkdown(t, dir, latex):
178 # Given a match to (foo.abc), return a markdown link to the tune with the 178 # Given a match to (foo.abc), return a markdown link to the tune with the
179 # title of the tune as the text of the link. 179 # title (and subtitle, if present) of the tune as the text of the link.
180 def getTitle(m): 180 def getTitle(m):
181 fname = m.group(1) + ".abc" 181 fname = m.group(1) + ".abc"
182 path = pathlib.Path(dir, fname) 182 path = pathlib.Path(dir, fname)
183 with path.open() as f: 183 with path.open() as f:
184 title = getFieldDisplayText(f, dir, "T", latex=latex) 184 title = getFieldDisplayText(f, dir, "T", latex=latex)