Fix permalinks when id attribute is not present
Make permalinks also scroll to target when clicked

* Also produce fragment identifier compatible ids for /docs
Merge remote-tracking branch 'origin/permalinks_fix'