comparison abcfield.py @ 943:d6e2a281cceb build-default-344

Change web page layout. Put tune contents under 'tunes/<name>' or 'tunes-<instrument>/<name>'. That way they won't move if the tune gets moved between Bookes. For now I have not attempted to redirect old URLs.
author Jim Hague <jim.hague@acm.org>
date Mon, 05 Aug 2019 23:25:28 +0100
parents 6bd946700312
children fc2b75f6c284
comparison
equal deleted inserted replaced
942:a774b3b3cad7 943:d6e2a281cceb
173 target = "--to=html" 173 target = "--to=html"
174 res = subprocess.check_output(['pandoc', '--from=markdown', target], input=t, universal_newlines=True) 174 res = subprocess.check_output(['pandoc', '--from=markdown', target], input=t, universal_newlines=True)
175 if latex: 175 if latex:
176 res = re.sub(r'\\href{(.*?).abc}', r'\\hyperlink{\1}', res) 176 res = re.sub(r'\\href{(.*?).abc}', r'\\hyperlink{\1}', res)
177 else: 177 else:
178 res = re.sub(r'href="(.*?).abc"', r'href="\1.html"', res) 178 res = re.sub(r'href="(.*?).abc"', r'href="../\1/index.html"', res)
179 return res.strip() 179 return res.strip()
180 180
181 # Implement a custom Markdown shorthand for referencing ABC files. 181 # Implement a custom Markdown shorthand for referencing ABC files.
182 # <foo.abc> will expand to ['title of foo'](foo.abc). 182 # <foo.abc> will expand to ['title of foo'](foo.abc).
183 def expandCustomMarkdown(t, dir): 183 def expandCustomMarkdown(t, dir):