From 9b25f8f91d1c27add977c892747c2490802c28ba Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 1 Apr 2016 18:18:41 +0200 Subject: [PATCH] Add --cheatsheet to src2asciidoc.py --- scripts/dev/src2asciidoc.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py index 3b4660069..e70276109 100755 --- a/scripts/dev/src2asciidoc.py +++ b/scripts/dev/src2asciidoc.py @@ -482,6 +482,19 @@ def regenerate_manpage(filename): _format_block(filename, 'options', options) +def regenerate_cheatsheet(): + """Generate cheatsheet PNGs based on the SVG.""" + files = [ + ('doc/img/cheatsheet-small.png', 300, 185), + ('doc/img/cheatsheet-big.png', 3342, 2060), + ] + + for filename, x, y in files: + subprocess.check_call(['inkscape', '-e', filename, '-b', 'white', + '-w', str(x), '-h', str(y), + 'misc/cheatsheet.svg']) + + def main(): """Regenerate all documentation.""" utils.change_cwd() @@ -494,6 +507,9 @@ def main(): if '--no-authors' not in sys.argv: print("Generating authors in README...") regenerate_authors('README.asciidoc') + if '--cheatsheet' in sys.argv: + print("Regenerating cheatsheet .pngs") + regenerate_cheatsheet() if '--html' in sys.argv: asciidoc2html.main()