krainboltgreene / termnote

Keynotes in your flippin' TERMINAL!
http://krainboltgreene.github.com/termnote
MIT License
273 stars 22 forks source link

Crash when pressing 'j' to go to next slide #4

Closed turboladen closed 11 years ago

turboladen commented 11 years ago

I stuck the Ruby code from your README example into a file to try out. The first slide loads fine, but when I press 'j' to go to the next slide, it crashes.

Source:

require 'termnote'

include TermNote

show.add chapter title: "Hello, World"

show.add code language: "Ruby", source: <<-SOURCE
  puts "Hello, world!"
SOURCE

show.start

Backtrace:

/Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/popen.rb:374:in `header_to_json': Traceback (most recent call last): (MentosError)
  File "/Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/mentos.py", line 303, in start
    res = self.get_data(method, lexer, args, kwargs, text)
  File "/Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/mentos.py", line 171, in get_data
    res = self.highlight_text(text, lexer, formatter_name, args, _convert_keys(opts))
  File "/Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/mentos.py", line 122, in highlight_text
    lexer = self.return_lexer(lexer, args, kwargs, code)
  File "/Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/mentos.py", line 79, in return_lexer
    return lexers.get_lexer_by_name(lexer, **inputs)
  File "/Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/vendor/pygments-main/pygments/lexers/__init__.py", line 80, in get_lexer_by_name
    raise ClassNotFound('no lexer for alias %r found' % _alias)
ClassNotFound: no lexer for alias 'Ruby' found
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/popen.rb:257:in `handle_header_and_return'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/popen.rb:232:in `block in mentos'
    from /Users/Steveloveless/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/popen.rb:203:in `mentos'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/pygments.rb-0.3.2/lib/pygments/popen.rb:186:in `highlight'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/termnote-1.1.0/lib/termnote/pane/code.rb:20:in `highlighted'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/termnote-1.1.0/lib/termnote/pane/code.rb:14:in `rows'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/termnote-1.1.0/lib/termnote/pane.rb:34:in `formated_rows'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/termnote-1.1.0/lib/termnote/pane.rb:26:in `render'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/termnote-1.1.0/lib/termnote/pane.rb:16:in `call'
    from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p286/gems/termnote-1.1.0/lib/termnote/show.rb:30:in `start'
    from show.rb:11:in `<main>'
danneu commented 11 years ago

ClassNotFound: no lexer for alias 'Ruby' found

show.add code language: "Ruby"

should be

show.add code language: "ruby"

or even

show.add code language: :ruby
turboladen commented 11 years ago

Ok thanks for the tip. You might consider changing the README then, as I copied the "Ruby" straight from there.

krainboltgreene commented 11 years ago

Fixed in #7