Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Commit

Permalink
Setup GitHub pages, manual pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nbedos committed Aug 5, 2018
1 parent bf59a4b commit 59081f5
Show file tree
Hide file tree
Showing 36 changed files with 647 additions and 424 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static:
(test -d $(VENV_PATH) || python -m venv $(VENV_PATH))
$(VENV_ACTIVATE) && \
rm -r examples/*.svg && \
termtosvg render $(CASTS_DIR)/awesome.cast $(EXAMPLES_DIR)/awesome_window_frame.svg -t window_frame && \
termtosvg render $(CASTS_DIR)/awesome.cast $(EXAMPLES_DIR)/awesome_window_frame_js.svg -t window_frame_js && \
termtosvg render $(CASTS_DIR)/colors.cast $(EXAMPLES_DIR)/colors_progress_bar.svg -t progress_bar && \
termtosvg render $(CASTS_DIR)/htop.cast $(EXAMPLES_DIR)/htop_gjm8.svg -t gjm8 && \
Expand Down
109 changes: 12 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
[![Build Status](https://travis-ci.org/nbedos/termtosvg.svg?branch=master)](https://travis-ci.org/nbedos/termtosvg)

# termtosvg
termtosvg is a Linux terminal recorder written in Python that renders your command
termtosvg is a Unix terminal recorder written in Python that renders your command
line sessions as standalone SVG animations.

<p align="center">
<img src="https://cdn.rawgit.com/nbedos/termtosvg/0.4.0/examples/awesome.svg">
<img src="https://nbedos.github.io/termtosvg/examples/awesome_window_frame.svg">
</p>

More examples of recordings can be found [here](https://github.com/nbedos/termtosvg/blob/0.4.0/examples/examples.md)

## Motivation
I really like the clean look of SVG animations. I wanted to see
how this solution would hold out against other terminal
recorders such as [asciinema](https://github.com/asciinema/asciinema).
* [Gallery of examples](https://nbedos.github.io/termtosvg/pages/examples.html)
* [Gallery of templates](https://nbedos.github.io/termtosvg/pages/templates.html)
* [Manual page](man/termtosvg.md)

## Features
* Produce lightweight and clean looking animations embeddable on a project page
* Custom color themes, terminal UI and animation controls via [SVG templates](man/termtosvg-template.md)
* Compatible with asciinema recording format

## Installation
termtosvg is compatible with Python >= 3.5 and can be installed using pip:
termtosvg is compatible with Linux, Mac OS and BSD OSes, requires Python >= 3.5 and can be installed using pip:
```
pip3 install --user termtosvg
```
Expand All @@ -42,94 +44,7 @@ Finally, use your favorite web browser to play the animation:
$ firefox /tmp/termtosvg_exp5nsr4.svg
```

### Detailed usage
```
$ termtosvg --help
usage: termtosvg [output_file] [--font FONT] [--theme THEME] [--help] [--verbose]
Record a terminal session and render an SVG animation on the fly
positional arguments:
output_file optional filename of the SVG animation; if missing, a random
filename will be automatically generated
optional arguments:
-h, --help show this help message and exit
--font FONT font to specify in the CSS portion of the SVG animation
(DejaVu Sans Mono, Monaco...). If the font is not installed
on the viewer's machine, the browser will display a default
monospaced font instead.
--theme THEME color theme used to render the terminal session (circus,
classic-dark, classic-light, dracula, isotope, marrakesh,
material, monokai, solarized-dark, solarized-light, zenburn)
-v, --verbose increase log messages verbosity
See also 'termtosvg record --help' and 'termtosvg render --help'
```

### Subcommands
Rendering the SVG animation while recording sometimes slows down
the commands being executed due to the CPU usage. It is possible
to proceed in two ways:
1. Record the terminal session to disk in asciicast v2 format
2. Render the SVG animation using the recording on disk

The detailed usage of these two commands is available with
`termtosvg record --help` and `termtosvg render --help`

### Configuration
termtosvg configuration file is located at `~/.config/termtosvg/termtosvg.ini`
and will be created by termtosvg if it does not exist. The configuration
file is self-documenting but here are the basics.

#### Global section
The 'global' section of the file specifies the font and color theme used.

```
[global]
font = DejaVu Sans Mono
theme = solarized-dark
```
These options can be overridden at the command line with the `--font` and
`--theme` flags.

#### Color themes
All other sections of the file define color themes. For example here's
the definition of the theme 'circus':
```
[circus]
foreground = #a7a7a7
background = #191919
color0 = #191919
color1 = #dc657d
color2 = #84b97c
color3 = #c3ba63
color4 = #639ee4
color5 = #b888e2
color6 = #4bb1a7
color7 = #a7a7a7
color8 = #5f5a60
color9 = #4bb1a7
color10 = #202020
color11 = #303030
color12 = #505050
color13 = #808080
color14 = #b888e2
color15 = #ffffff
```

Color themes can be added, removed or modified. Once a color theme
has been added to the configuration it can be referred to in the global
section of the configuration file, or be used at the command line as a
parameter to the `--theme` flag.

Definitions for the foreground and background colors, as well as for color0 to
color7 are mandatory. If color8 through color15 (bright ANSI colors) are
defined, they are used to display bold characters as a
replacement for color0 through color7.

## Dependencies
termtosvg uses:
* [pyte](https://github.com/selectel/pyte) to render the terminal screen
* [svgwrite](https://github.com/mozman/svgwrite) to create SVG animations
* [base16-xresources](https://github.com/chriskempson/base16-xresources) for default color themes
* [rawgit](https://rawgit.com/) for hosting SVG animations displayed here on GitHub [rawgit on GitHub](https://github.com/rgrove/rawgit))
* [lxml](https://github.com/lxml/lxml) to work with SVG data
12 changes: 0 additions & 12 deletions docs/Makefile

This file was deleted.

47 changes: 47 additions & 0 deletions docs/examples/awesome_window_frame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 12 additions & 14 deletions docs/examples/awesome_window_frame_js.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/examples/colors_progress_bar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/examples/htop_gjm8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 12 additions & 13 deletions docs/examples/ipython_window_frame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/examples/unittest_solarized_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/pages/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1><a href="../index.html">termtosvg</a></h1>
<section id="content" class="body">
<h1 class="entry-title">examples</h1>

<p>Here are examples of recordings made by termtosvg.</p>
<p>Here are examples of recordings made by termtosvg and rendered with various SVG templates.</p>

<h2>termtosvg command line session (window_frame_js template)</h2>
<p align="center">
Expand Down
Loading

0 comments on commit 59081f5

Please sign in to comment.