diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2021-03-16 23:40:47 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2021-03-16 23:40:47 +0100 |
| commit | d16db1acbad4c8071a6449280b0871264de064c6 (patch) | |
| tree | 2b9203ff9efb3b69dea51fd6b7e68826de525c01 /build-programs.py | |
| parent | 63f92ab8b68112d93a370a169582cc47e2ef78a0 (diff) | |
| download | quatuorbellefeuille.com-d16db1acbad4c8071a6449280b0871264de064c6.tar.xz | |
Format ordinals as superscripts
Diffstat (limited to 'build-programs.py')
| -rwxr-xr-x | build-programs.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/build-programs.py b/build-programs.py index 4de6cb0..8d46bf0 100755 --- a/build-programs.py +++ b/build-programs.py @@ -42,12 +42,18 @@ def piece(p): return f'<li class="intermission">{p}</li>' return f'<li>{html.escape(p)}</li>' -def print_program(info): - info['description'] = run( +def pandoc(md): + return run( ('pandoc',), - input=info['description'], capture_output=True, text=True, check=True + input=md, capture_output=True, text=True, check=True ).stdout +def print_program(info): + info['name'] = re.sub( + '<p>(.+)</p>', r'\1', pandoc(info['name']) + ) + info['description'] = pandoc(info['description']) + info['pieces'] = '\n'.join( piece(p[2:]) # Assume p.startswith('- '). for p in info['pieces'].splitlines() |
