bespokejs / bespoke

DIY Presentation Micro-Framework

Home Page:http://markdalgleish.com/projects/bespoke.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add infrastructure for help text

mojavelinux opened this issue · comments

While it's not the responsibility of bespoke.js core to provide a help view, it would be nice if core could maintain and expose help metadata so that this information can be collected and displayed.

One possible way is simply define a contract (in the README) that any plugin that contributes keybindings should fire and event with metadata for a help plugin.

deck.fire('help', [{type: 'key', value: 'f', action: 'Toggles fullscreen'}]);

Another way would be to expose methods that can be used to register and retrieve help metadata.

The focus is to figure out what foundation is necessary to make it possible to write a help plugin. The main decision is to work out the structure of the metadata. Next, we need to figure out how to get that metadata to the help plugin.

Here's a screenshot of the help screen in showoff for reference.

showoff-help

We may want to split action into action and desc.

deck.fire('help', [{type: 'key', value: 'right', action: 'next', desc: 'Move to the next slide.'}]);

That way, multiple events with the same action (e.g., next) can be combined as shown in the screenshot.