Skip to content

Instantly share code, notes, and snippets.

@puyo
Created November 19, 2010 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save puyo/707298 to your computer and use it in GitHub Desktop.
Save puyo/707298 to your computer and use it in GitHub Desktop.
Putting all your slick in one place...?
:javascript
Shining.config({...})
#first
%h1 Hi there world
%p Yes this is a slide
%p.step with a step
:javascript
// stuff for the first slide
:css
/* css relevant to the first slide */
#second
%h1 Second slide
%aside Still a slide
#third
%h1 Third slide
%p How many more?
@juliocesar
Copy link

Yeah, very very nice. I don't disagree with it. The only reason why Haml was removed was because of haml-js being buggy as hell.

I know Sammy.js uses Haml, and I seem to recall it had a pretty up to date version of it. Might want to check it out!

As for multiple slides in a single file, my plan is allowing that through either writing a single slides.html file, which the Rack server will then serve when Shining fires a request at /slides (Accept: text/html). If said file doesn't exist, the Rack server will merge the existing slides and their scripts and send everything in a single request.

I'll definitely look into the single file slides idea. There's quite a few people asking for it.

As for turning it into a Sinatra app, I'm definitely not keen on that. You can open Shining's index.html on Firefox and it runs as if you had it deployed. Meaning it's a well written JS app. And if you consider the reason behind it would be just so one can use Haml, then it's definitely a no go. Don't get me wrong, big fan of Haml here, but I'd rather even get haml-js fixed than doing that. See the second paragraph.

And thanks! That's all great quality feedback.

@juliocesar
Copy link

One other thing to bear in mind: slide scripts still need to exist. I think it could be like this:

#first
  %h1 foo
    %p bar
  :script
    1, alert('Herro world')
    5, $('p:last').show()

So Shining would have to find <script> nodes, and run through it's slide script parser.

@puyo
Copy link
Author

puyo commented Nov 19, 2010

Being a JS only app does differentiate Shining nicely from ShowOff. I will go try Sammy.js's Haml. I think the Haml option is worth pursuing (in my fork of Shining). I will try using Jasmine to test what I need from the JS Haml implementation.

I'm just mucking around for fun and learning Javascript. Don't take me too seriously. :-)

@puyo
Copy link
Author

puyo commented Nov 19, 2010

Reading about Sammy. How do you feel about Shining as a Sammy app?

@juliocesar
Copy link

Not at all. If you get it done and it works nicely, please let me know and I'll happily merge, add credits and buy you a cup of Coke at the next meetup! :D

@juliocesar
Copy link

Don't need Sammy to do what Sammy does is how I feel :)

@puyo
Copy link
Author

puyo commented Nov 19, 2010

Mmm. I'm trying it now and none of their examples work. It looked okay on the box. It does seem like overkill for this.

@juliocesar
Copy link

I think by far the most welcome change I can think of is Jasmine specs. I've tried getting the suite tested through it to no avail a few times.

@puyo
Copy link
Author

puyo commented Nov 20, 2010

Sammy's Haml is no better. It lacks forEach, filter, trim, etc. too and thus doesn't work on IE8. Your copy of haml-js seems fine though. Do you not feel confident about it? Is there anything it doesn't handle?

@juliocesar
Copy link

Mine works because I forked it and made it work. If you look at my chances, what I did is I added the missing native JS methods to it, so it just ensures it works everywhere. That could well be copied and pasted into Sammy.js' haml-js.

Now the problem with haml-js was that stuff such as line breaks would sometimes work, and sometimes not. Sometimes you had to use 2 line breaks to get it to work. It was full of small quirks like that that would make the experience frustrating. So I figured Shining would be better off without it.

@puyo
Copy link
Author

puyo commented Nov 20, 2010

Ah okay. That does sound frustrating. sad panda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment