Highly Strung

This blog post is way overdue.

A couple of months ago, I wrote a talk entitled Highly Strung for the Virtual Java User Group (vJUG) on when and how to use strings in your code.

Spoiler: don't.

So this blog post is really just to ask you to check it out if you're interested. The link's up top, and has the talk in essay form, the slides and the video, lovingly recorded by the folks who run the vJUG.

Go on, check it out. I want to tell you something else, but afterwards.


OK, now the cool bit. Go back to that page and click on the "Presentation" link in the top-right corner, and watch as the page doesn't reload.

OK, funky JavaScript. Who cares?

Well, that's because the essay and the slides are the same HTML document (give or take). It's just markup and a little bit of JavaScript to get the ball rolling.

If you look at the HTML source of the document, you'll see that there are lots of <section> blocks. Each one is a slide in the presentation. Inside those are lots of <div> blocks with a class of notes. In presentation mode, these are hidden. And it's all Markdown under the hood, rendered by GitHub Pages, so it's just a static site.

And, well, that's about it. All that "Presentation" link does is change the CSS class on the <body> to tell the document to hide the notes (and show a few extra things), and load up reveal.js. Shiny, huh?

The only thing I'm missing is a way to get back to the essay form. Currently I reload the page, because there seems to be no way to unload reveal.js once it's loaded, but that's not so bad, y'know.


This post was cross-posted to my personal blog.

Get content like this straight to your inbox!

Software es nuestra pasión.

Somos Software Craftspeople. Construimos software bien elaborado para nuestros clientes, ayudamos a los/as desarrolladores/as a mejorar en su oficio a través de la formación, la orientación y la tutoría. Ayudamos a las empresas a mejorar en la distribución de software.

Contacto

3 Sutton Lane, planta 3
Londres, EC1M 5PU

Teléfono: +44 207 4902967

2 Mount Street
Manchester, M2 5WQ

Teléfono: +44 161 302 6795

Carrer de Pallars 99, planta 4, sala 41
Barcelona, 08018

Teléfono: +34 937 82 28 82

Correo electrónico: hello@codurance.es