better ToC generation for remote documents