Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to reveal.js 3.7 #79

Closed
dezGusty opened this issue Nov 13, 2018 · 4 comments
Closed

upgrade to reveal.js 3.7 #79

dezGusty opened this issue Nov 13, 2018 · 4 comments

Comments

@dezGusty
Copy link

Hi there,

Reveal.js v 3.7 brings the new Key Bindings API. This allows the users (well... me at least) to more easily hack Template.js and add a custom script to allow local plug-ins (stored side by side with the .md files) by configuring part of them post-initialization.

E.g.

function setCustomKeys() {
  // clear chalkboard when 'DEL' is pressed
  Reveal.addKeyBinding( 46, function() {
    RevealChalkboard.clear();
  });
  // reset chalkboard data on current slide when 'BACKSPACE' is pressed
  Reveal.addKeyBinding( 8, function() {
    RevealChalkboard.reset();
  });
}

window.onload = () => {
  setCustomKeys();
}

If you have some spare time, I would really appreciate a new release with updated dependencies.
Thank you,
dezGusty

@evilz
Copy link
Owner

evilz commented Nov 14, 2018

I will do this :)

@evilz
Copy link
Owner

evilz commented Nov 14, 2018

In fact revealjs is already in 3.7 in source code
https://github.com/evilz/vscode-reveal/blob/master/package-lock.json#L2399-L2403

I studding the best way to make a powerful and simple templating feature.

@dezGusty
Copy link
Author

I'm not sure whether this helps or not, but the way in which I made it work for me was to add a configuration option named postInitScript (value: string; e.g. postinit.js) , which allows users to point to a file on the disk to add some custom initialization code. I updated the Template.js script.

Any additions are in the local structure.

  • css\
  • data\
  • lib\
  • plugin\
  • webfonts\
  • favicon.ico
  • postinit.js
  • myfile.md

I typically start code in such a dir...

code .

A gist of the sample here

Issues:

  • no checks for availability of source file (if the user sets the value to js/xxx.js and there is no such file, it breaks the plug-in (no display of the preview) . Perhaps it would be better to not have an option; but to have a fixed file name and location (e.g. js/postinit.js) and store it the vscode extension dir (would also require updating the express initialization in Server.js)
  • not sure how to best add extra css files, such as all.min.css.

@evilz
Copy link
Owner

evilz commented Nov 19, 2018

Thank,

I'm going to stay with a fixed template fro next release, but with some changes :

  • more plugins with toggle in configuration
  • js file to load
  • more default css

@evilz evilz closed this as completed Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants