Hacker News new | past | comments | ask | show | jobs | submit login
A terminal-based presentation tool with colors and effects (github.com/vinayak-mehta)
342 points by submeta on Aug 30, 2020 | hide | past | favorite | 49 comments



Hey, author here! Just wanted to add that you can write your slides using Markdown (most of its features are supported).

Also reposting my comment from the asciimatics post that was here yesterday:

I made this on top of asciimatics, which is awesome! I had a lot of fun making this thanks to all the effects asciimatics already has.

I was also able to extend an internal asciimatics class to add a feature for pre-recorded playable code blocks. It lets you play code in your terminal presentation like someone's typing it! You can learn more about it here: https://present.readthedocs.io/en/latest/codio.html


PS: I've been wanting to build this ever since I watched Brandon Rhodes' North Bay Python 2017 keynote! https://www.youtube.com/watch?v=rrMnmLyYjU8

It's a talk about (in Brandon's words) ASCII art animation, software architecture, the mysteries of UNIX terminal settings, and the glories of Plain Text. You should totally check it out!


PPS: In case you're interested in speaker notes, I used `present` + tmux + a keylogger + reveal.js speaker notes view for a presentation last week. I posted about it here: https://vinayak.io/2020/08/24/day-11-reveal-keylogger-tmux-p...

Though I want to work on a terminal-based speaker notes view some time! https://github.com/vinayak-mehta/present/issues/5


i gotta say, every time i see a bay area python meetup on youtube, it's always super high quality. as someone who doesnt live in the bay area, i am very jealous. please pass along my compliments to organizers and i wish i could replicate it in my city.


Same, I'm not in the bay area and found this Youtube video from 2017 only 3 months ago. https://2019.northbaypython.org/ is an awesome conference that happens there every year.


I created a similar REPL presentation tool for Scala: https://github.com/marconilanna/REPLesent


REPLesent looks cool!


How did you do the matrix raining code in the demo? I did not see it in the examples. I use an mp4 of that as a screen saver but would love it in terminal instead!


Here is how to do it with a few lines of bash:

  function matrix () {
      echo -e "\e[1;40m"
      clear
      while :; do
          echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 ))
          sleep 0.05
      done|awk '{
          letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん@#$%^&*()";
          c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter;
          printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }
      }'
  }


You can use the matrix effect by adding `<!-- effect=matrix -->` to the top of your slide! :)

These effects are supported right now: fireworks, explosions, stars, matrix, plasma. I plan to add more asciimatics effects soon!


I'm hoping for <-- effect=gol --> for a Game of Life simulation. For whatever reason, it comes up in my talks often. It seems I exude geekness acme whenever I talk about hacking and self-propagating code.


That would be awesome! I'll work on it and add it some time! Opened https://github.com/vinayak-mehta/present/issues/45 to track it :D



Relies on the asciimatics Matrix effect, looks like: https://github.com/peterbrittain/asciimatics/blob/master/asc...


Yes! `present` is built on asciimatics.


Hey! It's super cool, but can't work it out how to run this on a few environemnts. Tried Ubuntu and centos, always get ModuleNotFoundError: No module named 'dataclasses'.

Centos 8.2, Python 3.6.8, present Version: 0.4.0, pip 9.0.3. Tried with global and user install in pip. Not really a python dev, more of a user :)


I just found some issues on it on github, will try to sort it out, sorry for calling here first, just expected all dependencies to be there and didn't realized "dataclasses" could be a project name!:)


could i ask about more details on shipping this? what made you start working on it? how long did you work on it to an initial state? have you had any practical work-related side benefits of doing something like this, or is it pure hobby?


I started working on this at the Recurse Center two weeks ago.

As for practical work-related side benefits, I've neither had my open-source work weigh in on the hiring process (as everyone still asks algorithms/data structures questions) nor earned much money through it. But I love building open-source tools that would be useful for people, including me (I used `present` for a talk some days ago), so you could say it's just a hobby at this point.


oh wow, very nice! well congrats on shipping this and i'm sure the exercise will come in useful in unexpected ways!


Thanks! An unrelated question: how do you track HN comments? (since you replied to this one so quickly!)


i used to use a hn comment reply notification tool at my old job, but no this one i just happened to check my replies at the right time


I cant running this apps

  \appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,


Can you raise an issue with some detail on how you installed it along with the full traceback? https://github.com/vinayak-mehta/present/issues Your OS, Python version and terminal emulator details will also help.

I'll take a look!


love it... thanks


Glad you liked it!


There's a major missed opportunity here - you can create codeblocks but there's no way to _run_ the codeblocks.

https://github.com/marconilanna/REPLesent, a similar tool for Scala, supports this by pressing `r` on any slide - all code will be evaluated into the REPL.


Also imagine they'd combine their codebase with shellshare (live streaming shell)

https://shellshare.net/


Nice! Something similar but maybe not so extreme is Deck Set. https://www.deckset.com/

Write markdown and it does the design for you.


DeckSet is great, but is quite limited in terms of allowing theme customization. If they allowed themes to be modified directly with CSS — or better, YAML/TOML/JSOn, that'd be excellent.

I've been looking very closely at Marp[1], which is a engineer-focused solution to this.

[^1] https://github.com/marp-team/marp


Only for MacOS though


I love how DeckSet looks but it only works on macOS :\


During this years juliacon there was an absolutely amazing termnial based presentation on building terminal based UI's:

https://www.youtube.com/watch?v=-TASx67pphw


Thanks for posting, this is such a cool and informative talk! I love the typewriter animation :D


Made me think of this that I have used previously: http://suso.suso.org/xulu/Shellshow

I had played with writing a pandoc filter that would add formatting escape sequences based on markdown, your tool does a better job than where I got to.

One thing I want in a tool like this is to be able to display ascii charts like from gnuplot, which is why I liked the simplicity of Shellshow. I will have to dig in to see if this is possible, if not I expect it would be easy to add.


Thanks for pointing me to Shellshow, I hadn't heard of it before, it looks cool! I'll look into it in detail sometime this week and see if I can add some of its features to `present`.

> One thing I want in a tool like this is to be able to display ascii charts like from gnuplot, which is why I liked the simplicity of Shellshow. I will have to dig in to see if this is possible, if not I expect it would be easy to add.

I've thought about adding charting features too! Asciimatics supports barcharts: https://asciimatics.readthedocs.io/en/stable/asciimatics.htm... and lets you extend classes to build other types of charts too.

Would you like to open an issue and describe this feature a bit in detail? https://github.com/vinayak-mehta/present/issues For example, what should the API look like, should it pick up data from a csv file and load it up into a barchart etc. I would love to work on this when I find time!


I wrote a terminal graphics library! It might be interesting to use something like this to be able to embed graphics into terminal-based presentations:

https://github.com/dheera/python-termgraphics


Termgraphics looks awesome, I'll try it out this week!


There is also patat (https://github.com/jaspervdj/patat) that does a similar thing.

It does not have effects, but it can do colors and has many other features one would expect from a presentation tool. It has also been around for a while, it is rather stable and written in Haskell. Many Linux distributions already have it in their repositories (https://github.com/jaspervdj/patat#installation).

Worth trying out as well!


Those special f/x are really slick. Always nice to see new Terminal development.


Very cool. Runs on repl.it nicely: https://repl.it/@amasad/terminal-present


Thanks for adding the repl.it badge!


Can it do a PDF export? I'm usually providing a PDF of my slides with some comments, as people pretty much always request that if I don't.


Not currently. A lot of people have requested that feature, I'll look into how that can be done! Tracking it here: https://github.com/vinayak-mehta/present/issues/43


Used it last week for a presentation. Loved it.


Thanks again! I loved that presentation! Looking forward to a longer one :D


What tool(s) did you use to record the example gifs in the readme?


I used https://github.com/phw/peek but I plan on trying asciinema / terminalizer soon.

I was able to record `present` with asciinema, just need to see how nicely it renders into a GIF!


You may be interested in https://nbedos.github.io/termtosvg/ - it can take asciinema recordings and turn them into animated SVGs.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: