doc: Fix 'npm help index'

This fixes the doc builder script so that the appropriate numbers get
printed into the links, and so that 'npm help index' isn't all wonky
in its formatting.