The asciinema.org is now running the latest server and web player code and thus it fully supports this new format.
In the last tutorial about this online tool we briefly presented how it can be used.
In this tutorial, I will present some other features and how you can integrate the result in wordpress.com.
Let’s see a short example with some simple commands in Linux and how we used this tool:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | [mythcat@fedora ~]$ asciinema auth [mythcat@fedora ~]$ asciinema rec linux_commands_default.cast asciinema: recording asciicast to linux_commands_default.cast asciinema: press <ctrl-d> or type "exit" when you're done [mythcat@fedora ~]$ ls ... [mythcat@fedora ~]$ dir ... [mythcat@fedora ~]$ pwd ... [mythcat@fedora ~]$ exit asciinema: recording finished asciinema: asciicast saved to linux_commands_default.cast [mythcat@fedora ~]$ asciinema upload linux_commands_default.cast |
I used the local recording and uploaded it later to avoid additional fixes in case of errors and inconsistencies with what we want to display online.
The asciinema online tool supports sharing an asciicast on Twitter, Slack, Facebook, Google+, or any other site which supports one of these APIs: oEmbed, Open Graph, and Twitter Card APIs, see also this webpage.
To use this online tool with your blog, you will need to use the three lines of source code to change according to the number of asciinema uploaded from the URL.
In my example case is this number 455414 from this URL: https://asciinema.org/a/455414/ and the source code for this blog post is shown below:
1 2 3 | <script src="https://github.com/asciinema/asciinema-player/releases/download/v2.6.1/asciinema-player.css"/></script> <script src="https://github.com/asciinema/asciinema-player/releases/download/v2.6.1/asciinema-player.js"/></script> <script src="https://asciinema.org/a/455414.js" id="asciicast-455414" async></script> |
This tutorial can be found on my blogger webpage, you can find more tutorials by searching on the web with my nicknames: catafest or mythcat.