From d16db1acbad4c8071a6449280b0871264de064c6 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Tue, 16 Mar 2021 23:40:47 +0100 Subject: Format ordinals as superscripts --- build-programs.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'build-programs.py') 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'
  • {p}
  • ' return f'
  • {html.escape(p)}
  • ' -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( + '

    (.+)

    ', 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() -- cgit v1.2.3