Revealing “hidden” section in org-mode doc exported to HTML

Here, I’ll describe how to include a “hidden” section, in a HTML document exported from org-mode which uses org-info.js.

The section isn’t displayed at page load, and only revealed once the ‘n’ letter is pressed (accessing next section).

The trick is to have a section with an empty headline, with no headlines numbering, containing a <div> whose class is for instance myhidden the :

#+options: num:nil
*         <---- this line contains unbreakable space C-x 8 SPC
#+HTML: <div class="myhidden">


#+HTML: </div> <!-- .myhidden -->

The div will be hidden, cause we tell the CSS to hide it :

#+HTML_HEAD_EXTRA: <style> 
#+HTML_HEAD_EXTRA: .myhidden {display: none; visibility:hidden;}
#+HTML_HEAD_EXTRA: </style>

The document uses the org-info.js :

#+INFOJS_OPT: view:showall toc:nil buttons:nil

Then, I’m adding a hook, for handling the next page display, which
will switch the visibility :

#+HTML_HEAD_EXTRA: <script type="text/javascript">
#+HTML_HEAD_EXTRA: function toggle_visibility() {
#+HTML_HEAD_EXTRA:    var elements = document.getElementsByClassName("myhidden"),
#+HTML_HEAD_EXTRA:        n = elements.length;
#+HTML_HEAD_EXTRA:    for (var i = 0; i < n; i++) {
#+HTML_HEAD_EXTRA:      var e = elements[i];
#+HTML_HEAD_EXTRA:      if( == 'block') {
#+HTML_HEAD_EXTRA: = 'none'
#+HTML_HEAD_EXTRA: = 'hidden';
#+HTML_HEAD_EXTRA:      } else {
#+HTML_HEAD_EXTRA: = 'block';
#+HTML_HEAD_EXTRA: = 'visible';
#+HTML_HEAD_EXTRA: orgInfoHooks = {
#+HTML_HEAD_EXTRA: 'onShowSection': [
#+HTML_HEAD_EXTRA:     toggle_visibility,
#+HTML_HEAD_EXTRA: /* ]]> */
#+HTML_HEAD_EXTRA: </script>

Yeah, that’s a hack, but it may work.

Installing a Docker Swarm cluster inside VirtualBox with Docker Machine

I’ve documented the process of installing a Docker Swarm cluster inside VirtualBox with Docker Machine. This allows experimenting with Docker Swarm, the simple docker container orchestrator, over VirtualBox.

This allows you to play with orchestration scenarii without having to install docker on real machines.

Also, such an environment may be handy for teaching if you don’t want to install docker on the lab’s host. Installing the docker engine on Linux hosts for unprivileged users requires some care (refer to docs about securing Docker), as the default configuration may allow learners to easily gain root privileges (which may or not be desired).

See more at

Making Debian stable/jessie images for OpenStack with bootstrap-vz and cloud-init

I’m investigating the creation of VM images for different virtualisation solutions.

Among the target platforms is a destop as a service platform based on an OpenStack public cloud.

We’ve been working with bootstrap-vz for creating VMs for Vagrant+VirtualBox so I wanted to test its use for OpenStack.

There are already pre-made images available, including official Debian ones, but I like to be able to re-create things instead of depending on some external magic (which also means to be able to optimize, customize and avoid potential MitM, of course).

It appears that bootstrap-vz can be used with cloud-init provided that some bits of config are specified.

In particular the cloud_init plugin of bootstrap-vz requires a metadata_source set to “NoCloud, ConfigDrive, OpenStack, Ec2“. Note we explicitely spell it ‘OpenStack‘ and not ‘Openstack‘ as was mistakenly done in the default Debian cloud images (see

The following snippet of manifest provides the necessary bits :

name: debian-{system.release}-{system.architecture}-{%Y}{%m}{%d}
  name: kvm
  - virtio_pci
  - virtio_blk
  workspace: /target
  # create or reuse a tarball of packages
  tarball: true
  release: jessie
  architecture: amd64
  bootloader: grub
  charmap: UTF-8
  locale: en_US
  timezone: UTC
  backing: raw
    #type: gpt
    type: msdos
      filesystem: ext4
      size: 4GiB
      size: 512MiB
  # change if another mirror is closer
    password: whatever
    username: debian
    # Note we explicitely spell it 'OpenStack' and not 'Openstack' as done in the default Debian cloud images (see
    metadata_sources: NoCloud, ConfigDrive, OpenStack, Ec2
  # admin_user:
  #   username: Administrator
  #   password: Whatever
    # reduce the size by around 250 Mb
    zerofree: true

I’ve tested this with the bootstrap-vz version in stretch/testing (0.9.10+20170110git-1) for creating jessie/stable image, which were booted on the OVH OpenStack public cloud. YMMV.

Hope this helps

Using org-mode and org-reveal for teaching material

I’ve finally put together in a single example repo an example of the way I manage teaching material with org-mode.

It needs more docs and work, but should be usable. Docs and demo at and the Gitlab repo at for those curious.

It doesn’t intend to be a full-fleshed product (also the name is just a codename), but release early, release often, they said 😉

Of course, teaching requires much more stuff than slides and handbooks, but eh, that’s my contribution for the moment.

Update 2017/05/18: I’ve updated the docs and repo to include generation of a “printed slides deck” in PDF, using DeckTape.

Long time no see … been teaching Web architecture and apps

I’ve been away for long from my blog, quite busy teaching and coordinating the CSC4101 course on Web architectures and applications for the engineering school.

The course is almost over and it’ll be time for documenting some of the things I’ve played with. Mainly the org-mode based system I’ve used to manage a single source file for multiple documents used for teaching (slides, handbook, etc.).

Expect a bit more life here in the coming days, hopefully.