Get small in Go present

Among the many cool tools in the Go ecosystem is present, a package for making slide presentations and blog posts. It’s an easy way to make a nice looking HTML5 presentation that can also run live code samples. Keen!

Because it’s so cool, lots of folks use it. Often they publish their slides afterwards. For example, here is a terrific talk by Brad Fitzpatrick from GoCon Tokyo.

The problem is, Go present must have only been used by folks with high-resolution displays so far. When I look at any Go present presentation in my browser, the top gets chopped off. On most slides, this is the title!

screen cap of Go present in smaller browser

That top line is supposed to read, “60% of the time, it works every time….”, but even though I am scrolled all the way to the top, I can’t see it.

This appears to be a typical case of making fixed-size assumptions in HTML. I fiddled with the CSS a bit until I arrived at manipulating the margin-top value. Ten percent was a bit too much

screen cap of Go present with 10% top margin.

but 5% worked pretty well.

screen cap of Go present with 5% top margin.

So, I added the following to my userContent.css file.

/*
 * This is to force "Go present" presentations to fit in my browser.
 */
.slides { margin-top: 5% !important; }

Now all such presentations I encounter (which is a lot lately) are readable in my browser.

Advertisements
Get small in Go present