def build(pkgdir, dsa, capture): # create a linker (link database) for cross-linking l = linker.TempLinker() # create a project.Project instance to contain the LayoutPage instances proj = project.Project() # output dir from py.__.conftest import option targetdir = get_apigenpath() targetdir.ensure(dir=True) # find out what to build all_names = dsa._get_names(filter=lambda x, y: True) namespace_tree = htmlgen.create_namespace_tree(all_names) # and build it apb = htmlgen.ApiPageBuilder(targetdir, l, dsa, pkgdir, namespace_tree, proj, capture, LayoutPage) spb = htmlgen.SourcePageBuilder(targetdir, l, pkgdir, proj, capture, LayoutPage) apb.build_namespace_pages() class_names = dsa.get_class_names() apb.build_class_pages(class_names) function_names = dsa.get_function_names() apb.build_function_pages(function_names) spb.build_pages(pkgdir) l.replace_dirpath(targetdir)
def get_relpath(self): return linker.relpath(self.targetpath.strpath, get_apigenpath().strpath) + '/'
def a_apigenref(self, name, relhtmlpath): apipath = get_apigenpath() return html.a(name, class_="menu", href=relpath(self.targetpath.strpath, apipath.join(relhtmlpath).strpath))