Live data from Hacker News

Show HN: tmux2html - Render full tmux windows or individual panes as HTML

github.com

21–30 of 30 posts

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#21

Example rendered sessions. Warning: The animated examples might not be impressive on low performance devices, and they may drain your battery if you leave them opened. Color [disk: 135KB, gzip: 17KB]: https://share.esdf.io/FGlV4sufpt/color.html Single Pane [disk: 65KB, gzip: 6KB]: https://share.esdf.io/saRkuNriJt/single.html Full Window (Big) [disk: 134KB, gzip: 11KB]: https://share.esdf.io/h5lGMPdcZF/full.html Anima…

Here's an example of not-so-real time rendering: https://share.esdf.io/log.html

It's a tmux window displaying the log file for the share.esdf.io domain. It refreshes every second, so the message above about animated examples applies.

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#22

Earlier quoted context omitted.

asciinema is a very useful. But, what I found unappealing about it was that I needed asciinema to play the recordings (is that still the case?). I wanted to be able to put the rendered session anywhere I wanted. The example links are actually hosted on my server and were uploaded using Dropshare. Pretty easy peasy if I need to share something that I don't want public.

asciinema stores the raw program output including any terminal escape sequences in a JSON format[1] and then uses a javascript terminal emulation library to replay/recreate the terminal state in your browser. The player, made up of one Javascript and one CSS file, can be self hosted[2]. [1] https://github.com/asciinema/asciinema/blob/master/doc/ascii... [2] http://blog.asciinema.org/post/self-hosting/

This doesn't meet my criteria for easy peasy :(

If there was a utility that converted that json file to a single HTML file, that'd be a different story. If you feel up to doing that, tmux2html uses an MIT license, so feel free to use the parts that parses the escape sequences.

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#23
post #19

Earlier quoted context omitted.

The thing I love so far about Vim is no one argues about key bindings because no one is right. But, almost everyone agrees that the default leader key is awful. I imagine it's the same for the Emacs community.

I actually like the default bindings for both, but yes, everyone in the community seems to have a slightly fragmented opinion of them :D.

You like the backslash as the leader key?! Well I never!

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#24
post #19

Earlier quoted context omitted.

I actually like the default bindings for both, but yes, everyone in the community seems to have a slightly fragmented opinion of them :D.

You like the backslash as the leader key?! Well I never!

I'm a goober and have never once used the leader key...I guess I'm a bit of a noob.

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#25

Earlier quoted context omitted.

asciinema stores the raw program output including any terminal escape sequences in a JSON format[1] and then uses a javascript terminal emulation library to replay/recreate the terminal state in your browser. The player, made up of one Javascript and one CSS file, can be self hosted[2]. [1] https://github.com/asciinema/asciinema/blob/master/doc/ascii... [2] http://blog.asciinema.org/post/self-hosting/

This doesn't meet my criteria for easy peasy :( If there was a utility that converted that json file to a single HTML file, that'd be a different story. If you feel up to doing that, tmux2html uses an MIT license, so feel free to use the parts that parses the escape sequences.

Well technically you could inline the Javascript+CSS stuff and you would get a single HTML file ;) No need to write anything, it already exists.

Anyway I didn't mean to discourage you from working on your project.

I just would like to use a decent terminal recording solution to showcase some of my own projects (e.g. abduco+dvtm, vis[1]). Ideally it would support:

* copy pasting from the screen cast

* pausing / adjusting playback speed

* simple self hosting mechanism

* conversion to gif as preview for inclusion in Markdown files or for environments where Javascript is disabled

* overlay to show pressed keys

AFAIK all but the last point is possible with asciinema. In the past I've used mkcast[2] which uses a fork of screenkey and is a pain to use. Apparently its developer now recommends xscast.

Anyway it is a mess to use and as a result the featured screen casts for my projects are rarely updated and by now completely out of date.

[1] https://github.com/martanne/vis

[2] https://github.com/KeyboardFire/mkcast

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#27
post #24

Earlier quoted context omitted.

You like the backslash as the leader key?! Well I never!

I'm a goober and have never once used the leader key...I guess I'm a bit of a noob.

A leader key will expand the number of keys available to you. You can have maps like j that doesn't interfere with the default j map. There is also that does the same thing. They're like having a sticky or but more comfortable. Read up on them (:h mapleader) and you will have more sun shine fun with Vim! For the record I use the comma as the key and leave as the backslash since it's used rarely.

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#28
post #24

Earlier quoted context omitted.

I'm a goober and have never once used the leader key...I guess I'm a bit of a noob.

A leader key will expand the number of keys available to you. You can have maps like j that doesn't interfere with the default j map. There is also that does the same thing. They're like having a sticky or but more comfortable. Read up on them (:h mapleader) and you will have more sun shine fun with Vim! For the record I use the comma as the key and leave as the backslash since it's used rarely.

I started using ? as the leader (I don't do reverse searches). The other options (, \) always get in the way while programming. I might try the backtick, but it means that programming in languages that use backticks (Rust, I think) would be a pain.

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#29

Earlier quoted context omitted.

This doesn't meet my criteria for easy peasy :( If there was a utility that converted that json file to a single HTML file, that'd be a different story. If you feel up to doing that, tmux2html uses an MIT license, so feel free to use the parts that parses the escape sequences.

Well technically you could inline the Javascript+CSS stuff and you would get a single HTML file ;) No need to write anything, it already exists. Anyway I didn't mean to discourage you from working on your project. I just would like to use a decent terminal recording solution to showcase some of my own projects (e.g. abduco+dvtm, vis[1]). Ideally it would support: * copy pasting from the screen cast * pausing / adjust…

Don't worry about me. I won't be discouraged about anything :)

I want to be able to produce GIFs since that's relatively easy enough, but it got me thinking that there just needs to be support for embedding an iframe in (Github's) markdown. Just strip scripts out of it and let authors worry about making it look right in the markdown in terms of size and using CSS for animations. GIFs are just huge and look bad when making their size reasonable.

In regard to key overlays, I feel the same way. I'm having that issue right now with my other project[1]. There was a little bit of effort put into making the animations with key overlays, and I really don't want to update them so that the images are correct with the current fixes.

In the scope of tmux, is it even possible to capture what keys were pressed? I'd be interested in adding such a feature to tmux2html since having an overlay with CSS and HTML would be trivial.

BTW, vis is pretty cool.

[1]: https://github.com/tweekmonster/braceless.vim

Re: Show HN: tmux2html - Render full tmux windows or individual panes as HTML

#30
post #28

Earlier quoted context omitted.

A leader key will expand the number of keys available to you. You can have maps like j that doesn't interfere with the default j map. There is also that does the same thing. They're like having a sticky or but more comfortable. Read up on them (:h mapleader) and you will have more sun shine fun with Vim! For the record I use the comma as the key and leave as the backslash since it's used rarely.

I started using ? as the leader (I don't do reverse searches). The other options (, \) always get in the way while programming. I might try the backtick, but it means that programming in languages that use backticks (Rust, I think) would be a pain.

The backtick is also used for for jumping to marks. I wouldn't recommend overriding that one. `. will put your cursor back to the last insertion point. '. will put you back on the last insertion line. They're quite handy. A common key that is used is . There' is also using CAPSLOCK as a leader key, but it's not very portable since it requires configuring the OS. I think ? is fine for a leader key as long as you know that you're not going to use reverse search ever.

Looks like HN is slowing down the post speeds here. If you want to talk about Vim more, send me a message @cloudsiphon on Twitter.

Post reply on HN