Make ref linkable, and add metadata.