Add --cheatsheet to src2asciidoc.py

This commit is contained in:
Florian Bruhin 2016-04-01 18:18:41 +02:00
parent 4b9cd1c544
commit 9b25f8f91d

View File

@ -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()