if we're generating the right stuff in the php, do we need this in the JS?
I'd prefer to have just one place that canonicalizes the data and it feels like that should be in mkdoc.php