summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2016-04-01 18:18:41 +0200
committerFlorian Bruhin <git@the-compiler.org>2016-04-01 18:18:41 +0200
commit9b25f8f91d1c27add977c892747c2490802c28ba (patch)
tree056c2704efe4629f8e78b478a88145348f4872a6
parent4b9cd1c54436409aa8ffa10922bd4912c09199cc (diff)
downloadqutebrowser-9b25f8f91d1c27add977c892747c2490802c28ba.tar.gz
qutebrowser-9b25f8f91d1c27add977c892747c2490802c28ba.zip
Add --cheatsheet to src2asciidoc.py
-rwxr-xr-xscripts/dev/src2asciidoc.py16
1 files changed, 16 insertions, 0 deletions
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()