ryanj/gist-reveal

[Question] Need help/advice getting my reveal-js theme to work best with gist-reveal-it

Rob-Rychs opened this issue ยท 5 comments

Hey @ryanj
First off thanks for making this it's awesome!
I made a reveal-js theme demo
It has both css for styling and js for a canvas background
not sure how the best way to load the js onto index.html if theme selection = matrix
I was wondering if you knew how I could best get my theme up and running with gist-reveal-js
I was thinking of tackling it by the todo's in my readme file but since you've been hacking on reveal for so long I wanted to ask you your thoughts on how to do this ๐Ÿ˜€
Also do you have a good gist on deploying this to openshift3?

ryanj commented

Nice demo, @Rob-Rychs!

I usually try to load css themes via gist as well, and allow the site admin to specify a default theme via gist_id: http://gist-reveal.it/#/themes

As a security measure(#10), I had taken the approach of stripping all <script> tags from content originating from gist.github.com. I know this isn't ideal for everyone, but reveal.js already covers most presentation-related functionality; and blocking embedded scripts seemed like a way to make the site a little safer (in general). Let me know if it would be helpful to include a config flag that would allow this behavior to be suppressed.

You can find the whitelist of allowed elements and attributes in the main server.js file: https://github.com/ryanj/gist-reveal/blob/master/server.js#L16-L48

If you want make site-wide changes, AND want to host your own gist-reveal server (on openshift or on any another service capable of running nodejs code), then I'd try:

  1. Save your js code in the js folder, and then add a new <script> entry to the head of index.html to load it. OR - add it to the list of js files in the package.json's scripts.build-js entry to include it in the site's js bundle via "npm run build": https://github.com/ryanj/gist-reveal/blob/master/package.json#L10

Have you considered replacing the matrix animation with an animated gif (instead of javascript)?

ryanj commented

It doesn't look like <canvas> elements are used with reveal.js very often. Switching the canvas code to an animated gif might be a decent quick fix. Or, you could add the canvas element to your site's index.html file.

Thanks! ๐Ÿ˜€

No I hadn't thought of using a gif for that but your right that might just be the easiest way to get the theme into a gist, not to mention help performance

The flag idea is something to consider because I like the idea of playing more with <canvas> + reveal.js or <script>s in gist's

Thanks a lot for your input.

looking into playing with gh-pages for #68 too

ryanj commented

github pages might work short term, but you'll eventually get rate-limited if don't include GH API keys in your requests. It's hard to avoid leaking keys when your code is 100% client-side (as with gh_pages)

This is why I use a nodejs server to handle the GH API connections. I usually load API keys via environment variables, to keep my sources clean.

makes a lot of sense ๐Ÿ‘