• Stars
    star
    148
  • Rank 248,503 (Top 5 %)
  • Language
    Python
  • Created almost 12 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A shell tool to turn code into a video presentation
##    ## ########  ##    ## ######## ######## ##    ## 
##   ##  ##     ##  ##  ##     ##    ##       ###   ## 
##  ##   ##     ##   ####      ##    ##       ####  ## 
#####    ########     ##       ##    ######   ## ## ## 
##  ##   ##   ##      ##       ##    ##       ##  #### 
##   ##  ##    ##     ##       ##    ##       ##   ### 
##    ## ##     ##    ##       ##    ######## ##    ##
> That's easy for you to say, Mr David, you're a human

What is Kryten?

Here is a presentation made with Kryten.

Kryten is Unix Shell tool that makes terminal-based presentations a snap to write, present, and share.

Kryten takes it's name from Kryten of the British television series Red Dwarf

Kryten

Why Kryten?

Kryten allows presenters to focus on the presentation without having to type code. It types the code for you and runs it. With Kryten, you present live code demos from prewritten presentation files. Write the presentation beforehand, and play it, step-by-step with Kryten. You can pause the presentation at any time, play backwards, and forward. It also edits files for you using a built-in editor.

When running on Mac, Kryten has the ability of reading comments in the code using text-to-speech. This allows turning a code into a video tutorial without human intervention.

Moreover it always checks the difference between the current files and what they are supposed to be and it only types in the differences.

While it can edit any types of file interactively, the shell commands are restricted to bash and Python commands.

Installing Kryten

pip install kryten

or download kryten.py from this repo.

Usage

Command line options

$ python kryten.py -h
Usage: 
    play                              (record mode)"
    play [options] -p filename.play   (playback mode)"
    play [options] -i input -o output (editor mode)"
    

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -n, --nonblock        do not ask for intput
  -d DELAY, --delay=DELAY
                        typing delay
  -p PLAY, --play=PLAY  file to play (play mode)
  -i INPUT, --input=INPUT
                        input file (editor mode)
  -o OUTPUT, --output=OUTPUT
                        output file (editor mode)
  -s, --speak           read comments, mac only
  -D, --debug           stops on tracbacks
  -m MARKMIN, --markmin=MARKMIN
                        saves markmin output (experimental)

Writing a presentation

Kryten works with .play files.

Syntax

Start comments with a #

Mark file edits with @@UPDATE@@ path.to/file.ext, followed by the new file contents, ending with @@END@@.

Try an play an existing file:

>>> python kryten.py -d 0.05 -n -p python101.play

A simple example

This example presentation presents a couple Python loops.

example1.play

# a simple loop
for i in range(5):
    print i

# another loop
for i in range(5):
    for j in range(3):
        print i+j

# print something
print 'hello world'

quit

Example with file edits

Kryten uses diff comparison to update files on the system. Use @@UPDATE@@ path.to/file to start a file edit block. Write how the file should look post-edit and end with @@END@@.

example2.play

# create a file

@@UPDATE@@ file_edit.txt
a sample presentation
@@END@@

# update the file

@@UPDATE@@ file_edit.txt
a sample presentation
with another line
@@END@@

quit

Interactive Commands

Commands in shell:
SPACE execute and move to next line
q quit
p previous
n next without execue
x quickly execute and move to next line

Commands in editor:
SPACE next line
UP, DOWN for moving highlited line
q quit
b previous
n next
s save partial
x quickly execute end exit
(i intrecative mode - not yet suported sorry)

License

Copyright Β© 2012 Massimo DiPierro.
Licensed under the BSD license. http://opensource.org/licenses/BSD-2-Clause

Thanks

Thanks for Devon Blandin for help with the docs and text alignment.

More Repositories

1

nlib

The book "Annotated Algorithms in Python" and the nlib.py library
Python
1,327
star
2

workflow

minimalist file based workflow
Python
563
star
3

web2py-appliances

Set of Example Web2py Appliances
JavaScript
210
star
4

evote

A system for secure, trusted, and verifiable voting on the web
Python
116
star
5

autoinstaller

Python
104
star
6

no.css

Tiny CSS framework with almost no classes and some pure CSS effects
CSS
99
star
7

stupid.css

HTML
92
star
8

gluino

Port of web2py to Bottle, Flask, Pyramid, Tornado, wsgiref and other frameworks
Python
82
star
9

ocl

Python to C99/OpenCL/JS compiler
Python
64
star
10

Plasmid

web app to clone, edit in-place, and republish any web site
Python
54
star
11

ulid

Python
48
star
12

canvas

canvas is a simple interface to most common matplotlib functions
Python
42
star
13

web2py-recipes-source

Source code from the web2py recipes book published by packt
Python
37
star
14

pacioli

double entry account system compatible with ledger and beancount (but BSD license)
HTML
32
star
15

web2py-haystack

A full-text search engine for web2py named after Django-Haystack (since serves a similar purpose)
Python
29
star
16

buckingham

A library for error propagation and metric conversions
Python
25
star
17

web3py

web3py (work in progress... an experiment)
Python
25
star
18

videomonitor

Python
20
star
19

markmin.js

markmin.js (yet another wiki markup language but different)
JavaScript
18
star
20

mdpcl

some exercises with pyopencl
Python
17
star
21

algorithms-animator

Algorithms Animator
Python
11
star
22

fermiqcd

Automatically exported from code.google.com/p/fermiqcd
HTML
10
star
23

w2cms

w2cms
JavaScript
10
star
24

collection2

Python
10
star
25

web2py-plugins

9
star
26

nsa

Python
8
star
27

human_security

simple rsa signing API
Python
7
star
28

regift

Python
7
star
29

kusoma

JavaScript
6
star
30

date_finder

Python
6
star
31

csvstudio

A tool for processing csv files
Python
6
star
32

web2py-cordova

Python
6
star
33

estore3

Python
5
star
34

markmin-reveal-slides

markmin-reveal-slides
Python
5
star
35

cylon

physics engine
C++
5
star
36

emte-trading

Automatically exported from code.google.com/p/emte-trading
Python
5
star
37

w3

JavaScript
5
star
38

kpar

k(onfiguration) paramaters
Python
4
star
39

qcl

qcl
Python
4
star
40

qcdutils

Automatically exported from code.google.com/p/qcdutils
Python
4
star
41

demo.python.org

demo.python.org
JavaScript
4
star
42

simplescreencast.py

Python
4
star
43

evote_ranking

Python
4
star
44

vision-controlled-arm

vision-controlled-arm
JavaScript
3
star
45

web2py-welcome-theme-stupid

Python
2
star
46

scientific-cms

JavaScript
2
star
47

mdipierro.github.io

TeX
2
star
48

iotcallme

Python
2
star
49

forgetful

Python
2
star
50

blockchain_logger

Python
2
star
51

depy2015-cats

Python
2
star
52

random_variable

library to compute expectation values of random variables
Python
1
star
53

countach

Yet another static site generator - but different
Python
1
star
54

taskutils

Python
1
star
55

p2p-toy

Python
1
star
56

compy

compy
1
star
57

my_first_project

1
star
58

xml_parser

Python
1
star