fxn / tkn

Terminal Keynote - A hack for terminal-based talks
MIT License
1.11k stars 84 forks source link

How to highlight other languages? #6

Closed felippenardi closed 9 years ago

felippenardi commented 9 years ago

Hello,

As ruby is default, I'd like to know what is the code snippet to a javascript syntax highlight for example.

Btw, the ruby one itself is not actually highlighting it, is just turning some parts of the cold into bold. Is that what it is?

fxn commented 9 years ago

@felippenardi hey, yes it is explained in the README. The code macro accepts a second argument with the name of the language.

If most of your slides show JavaScript you can define your own macro:

def jscode(source)
  code source, :js
end

or whatever, at the top of you presentation file. Since everything is Ruby you can do all kind of things like this.

The theme has not been parametrized. It uses the "bw" pygments style, which as you see it is quite dry. You can change that editing this line by now.

felippenardi commented 9 years ago

@fxn Thank you so much for giving this straightforward explanation! :)