diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-08-18 22:14:48 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-08-18 22:16:59 +0200 |
| commit | 205b6d12ff5673bd8ae59f827f07b69771b9dfee (patch) | |
| tree | 1d360828ad5485a4c572baae4eba4183ebe467b7 /repo/www/generate-page.py | |
| parent | b173c7328dc8ae69880b305216f1196b052f5e03 (diff) | |
| download | memory-leaks-205b6d12ff5673bd8ae59f827f07b69771b9dfee.tar.xz | |
Mutualize pandoc invocations
Will be useful to avoid duplicating changes to Lua filters.
Diffstat (limited to 'repo/www/generate-page.py')
| -rwxr-xr-x | repo/www/generate-page.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/repo/www/generate-page.py b/repo/www/generate-page.py index 9e0f57c..372e8a2 100755 --- a/repo/www/generate-page.py +++ b/repo/www/generate-page.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 from argparse import ArgumentParser -from subprocess import run + +from helpers import pandoc def parse_arguments(): @@ -25,13 +26,13 @@ def parse_arguments(): def main(arguments): - pandoc = ( - 'pandoc', '-s', arguments.page, '-o', arguments.output, - '--lua-filter', 'convert-internal-links.lua', - '--template', arguments.template, '-T', arguments.site_title, - '-M', f'title={arguments.title}' + pandoc( + arguments.page, + arguments.output, + arguments.template, + title=arguments.title, + site_title=arguments.site_title ) - run(pandoc, check=True) if __name__ == '__main__': |
