# NAME Dancer2::Plugin::Showterm - Replay terminal typescript captures # VERSION version 0.0.3 # SYNOPSIS In `config.yml`: ```perl plugins: Showterm: stylesheet: /my_showterm.css ``` In your app: ```perl package MyApp; use Dancer2; use Dancer2::Plugin::Showterm; ... ``` # DESCRIPTION This plugin is a [Dancer2](https://metacpan.org/pod/Dancer2) port of the wonderful [http://showterm.io](http://showterm.io), which allows terminal screen captures taken via the UNIX tool [script](http://man7.org/linux/man-pages/man1/script.1.html) to be replayed in the browser. The plugin will intercept any request for files with a `.showterm` extension and will generate an html page that will be able to replay the same file, but with the `.typescript` extension. In other words, if you put the file `mysession.typescript` in the `public` folder of the app, then the url `/mysession.showterm` will display its webified version. The webified version can also be embedded in other pages via iframes: ```perl ``` # CAPTURING THE ACTION The cli capture is done using the UNIX utility `script`. The plugin assumes that the captured screen is 80 columns by 24 rows. ```perl $ script -ttiming ... everything you do here will be recorded ... ^D $ echo '---' | cat - timing >> typescript $ mv typescript /path/to/dancer/app/public/myscreen.typescript ``` Note that the `typescript` file the plugin uses is the concatenation of the original produced typescript with its timing file, separated with a type dash on a single line. # ADDED ROUTES ## /showterm/\* The plugin adds the javascript and stylesheets assets required by the webified typescript under `/showterm`. Those are bundled with the plugin as shared tarball. If you want to see where this tarball is on your filesystem, you can do ```perl use Dancer2; use Dancer2::Plugin::Showterm; app->find_plugin('Dancer2::Plugin::Showterm')->assets_dir; ``` or ``` $ perl -MFile::ShareDir=dist_dir -E'say dist_dir("Dancer-Plugin-Showterm")' ``` ## \*.showterm Any request for a file with the extension `.showterm` will be served the showterm page, using the same uri with its extension changed to `.typescript` as the script to play. # CONFIGURATION ```perl plugins: Showterm: stylesheet: /my_showterm.css ``` ## stylesheet If provided, will be added to the showterm page. # SEE ALSO - [http://showterm.io](http://showterm.io) - the original service - [asciinema](https://asciinema.org/) Alternative solution. Arguably simpler to embed (see [https://asciinema.org/docs/embedding](https://asciinema.org/docs/embedding)) as the project provides the required `css` and `js` files -- which mean it doesn't require any extra Dancer plugin like this one. # AUTHOR Yanick Champoux [![endorse](http://api.coderwall.com/yanick/endorsecount.png)](http://coderwall.com/yanick) # COPYRIGHT AND LICENSE This software is copyright (c) 2018 by Yanick Champoux. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.