mkapidocs.py: provide an ancestors method