📜 ⬆️ ⬇️

Terminal Keynote - we show presentations in the terminal



Terminal Keynote is a script created by Javier Noria (Xavier Noria) to show your presentations on BaRuCo 2012 and RailsClub 2012. Its whole point is the ability to show slides with text right in the terminal.


There is no inline formatting here. To use bold type or colors, you will have to use ANSI characters. Need a simple list? The symbol "*" to help you.
')
There are 4 types of slides.

: code



Slide with source code, the code is highlighted on the fly. Need to put on the slide the name of the file or something else? Use comments and imagination.
Here is the code for this slide:

slide <<-EOS, :code # rubinius/kernel/common/module.rb class Module attr_reader :constant_table attr_writer :method_table ... end EOS 


: center



In such slides, the text line by line is centered.
Source:

 slide <<-EOS, :center Corollary: Active Support does not emulate constant name resolution algorithms EOS 


: block



Formatting is preserved, all text is centered entirely.

 slide <<-EOS, :block What is watched and reloaded: * Routes * Locales * Application files: - Ruby files under autoload_* - db/(schema.rb|structure.sql) EOS 


sections



Sections - titles to groups of slides.
You can write them like this:

 section "Constants Refresher" do ... end 


Visual effects


There is only one effect. All the characters on the slide are displayed one after another with a difference of several milliseconds. Looks like an old-school cursor.

Slide control


Spacebar, “n”, “k”, “l” or PageDown ("\ e [5 ~") - go to the next slide.
“B”, “p”, “h”, “j”, PageUp ("\ e [6 ~") - go to the previous slide.
"^" - go to the very first slide, "$" - to the very last.
"Q" - exit.

Terminal font and size


The author uses Menlo font size 32, this gives the terminal 18x52 with a resolution of 1024x768.

Installation


Installation requires Ruby 1.9 and Pygments .
Simply
After installation, an example presentation can be run like this:

 bundle exec bin/tkn examples/constant_autoloading_in_ruby_on_rails.rb 

There is a snippet for creating slides in Sublime Text 2.

Links


Repository on Github: https://github.com/fxn/tkn

Source: https://habr.com/ru/post/151512/


All Articles