I added another three lines of code for generating labels for the :name: option. Unfortunately I don't know how to convert the node.get('names') to a proper reference identifier. Therefore I used node.get('ids') which contains the parsed name but also contains identifiers from ordinary labels. This leads to multiple labels when a container gets a label not via :name:. It was the best solution I could find quickly.