Terminal Keynote - showing presentations in the terminal



    Terminal Keynote is a script created by Xavier Noria to display its presentations at BaRuCo 2012 and RailsClub 2012. The whole point is the ability to show text slides directly in the terminal.


    There is no built-in formatting here. You must use ANSI characters to use bold or colors. Need a simple list? The symbol "*" to help you.

    There are 4 types of slides.

    : code



    Slide with the source code, the code is highlighted on the fly. Need to put a file name on the slide 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 aligned in the center.
    Source:

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


    : block



    Formatting is preserved, all text is completely centered.

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


    sections



    Sections - headings for slide groups.
    You can write them like this:

    section "Constants Refresher" do
    ...
    end
    


    Visual effects


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

    Slide management


    Space, "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” is the output.

    Font and terminal size


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

    Installation


    You need Ruby 1.9 and Pygments to install .
    Just
    After installation, you can run the presentation example 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.

    References


    Github repository: https://github.com/fxn/tkn

    Also popular now: