Skip to content

avicent/doitlive

 
 

Repository files navigation

doitlive

doitlive is a tool for live presentations in the terminal. It reads a file of shell commands and replays the commands in a fake terminal session as you type random characters.

This project is a fork of sloria/doitlive aiming at introducing experimental support for markdown-based rendering of comments. If you are not after the markdown support introduced by this fork you should use the upstream project instead.

Get it now

$ pip install git+https://github.com/avicent/doitlive.git

Requires Python >= 2.7 or >= 3.3 with pip.

Differences with respect to sloria/doitlive

The following magic-comments/directives are supported:

  • #doitlive commentformat: [markdown|plain]
    • Tells doitlive to interpret the comments as markdown-encoded and, provided commentecho is on, to render them using mdv (see Dependecies below). Note that the leading the hash character and the first space are stripped from the original line before rendering them as markdown.
  • #doitlive markdowntheme: <theme>
    • Tells doitlive to force mdv into using the specified theme for both text and code. Run mdv -it all to see theme samples.
  • #doitlive click: <method>
    • Instructs doitlive to call click.<method>(). This can be useful to pause after echoing some of the comments.
  • #doitlive cd: <path>
    • Tells doitlive to quietly change the directory.

In addition, a line starting with at least eight # signs will be treated as section divider and will result in a prompt to press any key to continue at the bottom of the screen prior to having the screen cleaned.

Example

#doitlive shell: /bin/bash
#doitlive prompt: default
#doitlive commentecho: true
#doitlive speed: 1000
#doitlive commentformat: markdown
#doitlive markdowntheme: 884.0134

# # DEMONSTRATING DOITLIVE (1/2)
#
# This comment is interpreted as markdown. We can use:
#
# - Bullet lists.
# - Syntax _highlighting_.
# - Horizontal separators, as the one below.
#
# ---
whatis windows

################################################
# # DEMONSTRATING DOITLIVE (2/2)
#
# We can also use `#doitlive click: getchar` to insert pauses.

#doitlive click: getchar
# Now we continue after the pause.
#
# ---
echo "That's all folks!"

Dependencies

This fork introduces the following dependencies on top of the upstream ones:

  • mdv
    • Used for rendering the markdown comments to the terminal . Note that the dependency to mdv in setup.py is pointing to avicent/mdv and not the original mdv from axiros/mdv in order to improve some rendering aesthetics. The official mdv should also work, though.
  • blessed
    • Used for positioning the cursor.

More information

Kudos

License

MIT licensed. See the bundled LICENSE file for more details.

About

Because sometimes you need to do it live

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%