From 6b0ee9faff5e835e447152ad35bb65a405c13e73 Mon Sep 17 00:00:00 2001 From: thoppe Date: Mon, 14 Sep 2015 11:42:46 -0400 Subject: [PATCH] Added an option to turn off left right keyboard bindings since they were confusing people --- md2reveal.py | 14 ++++++++++++-- src/markdown_slide.py | 1 - 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/md2reveal.py b/md2reveal.py index d2a41db..38a5148 100644 --- a/md2reveal.py +++ b/md2reveal.py @@ -47,7 +47,6 @@ 'history': 'true', - 'keyboard': 'true', 'overview': 'true', 'center': 'true', 'touch' : 'true', @@ -64,7 +63,10 @@ 'transitionSpeed': '"default"', 'backgroundtransition': '"default"', 'viewDistance':3, - 'rollingLinks': 'false' + 'rollingLinks': 'false', + + 'right_left_arrow_keys':False, + } # Set the global for keeping equations @@ -85,6 +87,14 @@ reveal_init.update(js) +# Custom key bindings +is_right_left_arrow_keys = reveal_init.pop("right_left_arrow_keys") +if not is_right_left_arrow_keys: + reveal_init["keyboard"] = { + 39 : "next", + 37 : "prev", + } + if not cmdline_args.output: cmdline_args.output = cmdline_args.markdown.split('.')[0] + '.html' cmdline_args.output = os.path.basename(cmdline_args.output) diff --git a/src/markdown_slide.py b/src/markdown_slide.py index 7f3c305..0015a38 100644 --- a/src/markdown_slide.py +++ b/src/markdown_slide.py @@ -118,7 +118,6 @@ def process_image(img): # Parse the caption text caption = _global_markdown_line(img["caption"]) - img["caption_html"] = '
{}
'.format(caption) arg_text = ['{}="{}"'.format(key,val) for key,val in args.items()]