handles multiple pages for docs