I’ve been busy of the last couple of months. A number of family and personal things meant I have less time for edlib, but I had a lot to do for edlib too. I really wanted to use edlib to give my presentation at linux.conf.au 2016 in beautiful Geelong.
As an editor with programable-everything including display it makes perfect sense to have a display made that takes some marked-up text and presents them as slides. Multiple windows are quite straight forward, so one full screen on the data projector, and one on my laptop screen from which I can control both seemed like a good idea and ended up working quite well. While I did have time (just) to get this all working, the result is far from polished and has quite a few ugly hacks. So all the work is in a ‘devel’ branch of my git tree on git://neil.brown.name/edlib and github.com/neilbrown/edlib. I’ve tagged the commit as ‘lca2016’.
The “sprint” to get it working was, I think, quite valuable. It forced me to think a bit differently about what I had and opened my eyes to a number of the different things that applications are going to want to do with edlib. So I saw lots of weaknesses and several opportunity. Hopefully I will be able to explore all of those properly over the coming weeks and get all the functionality into my mainline in a form that I am happy with.
One aspect that I thought would end up as a horrible hack turned out rather nice. I needed some way for a command in my control window (e.g. page-down) to affect the display window. I eventually realized that the document would act like a message bus to send a message along. The display window could request a “Recentre” message in the same way that pane can request “Replace” messages when content replacement happens. The control window can then send a “Recentre” message to the document, and it can forward it to any listening applications. My current solution is very specific to “Recentering”, but it will be easy enough to generalise that so that any message can be sent among different windows on the same document. I wonder what other uses I will find for this.
Another happy idea came about because I wanted to use a slightly different background image on each slide. There is a common background which is a photo of the sunrise over the bay on Monday morning. Then on most pages there is also a photo of one of the many “bollard people” who decorated the water front here. I enhanced “render-lines” to look up the “background” attribute on the pane and if that was “colour:XXX” or “image:XXX” to draw the appropriate colour or image. Adding extra options to draw a second picture over to the right seemed the wrong thing to do.
My “a-ha” insight was to teach “render-lines” to understand a background of “call:XXX” to mean that it should call the given command. The “render-present” (the presentation renderer) could then catch that command and draw the background. There is still some hard-coded knowledge specific to my presentation, but if I want to add a way to describe a background in more detail, handling that in render-present — ot at least out side of render-lines — seems like the best choice.
There were two things I wanted to add to edlib for the presentation but didn’t get time. One is a new document type which mmaps a file – typically a block device – so that edlib’s hex mode and be used to explore a block device without reading it all in.
The other was more direct rendering of the “model-view-controler” diagrams. Each of those was generated with a few lines of “Graphviz” code. I used “xdot” to show them on the screen, then “gimp” to capture the image and make the background transparent. I would much rather have plugged the python code from ‘xdot’ into edlib so that the “graphviz” code could have been in my presentation and would have been rendered on demand. I still want to do that, but wonder when I’ll give another presentation that uses graphviz style graphs…
On the whole I am happy with the talk. The room wasn’t crowded but it was far from empty and it seems that I managed to keep people engaged. Hopefully the videos will be available soon( … or now). The presentation I used can be viewed if you manage to get edlib to work. Grab the lca2016 version at https://github.com/neilbrown/edlib/releases/tag/lca2016 and follow the instruction in the last commit: https://github.com/neilbrown/edlib/commit/956605b0969a43c0ca8461cb6f9213b13039896b
…and stay tuned. I certainly plan to continue making progress with this.