$def with (project, namespace, details)
$var breadcrumbs = ("projects", "Projects", project, f"{project}", "api", "API")
$var title: $namespace
$ namespaces = namespace.split("/")
$if len(namespaces) > 1:
$ details = details["descendants"][namespaces[1]]
$:mkdn(details["mod"]["doc"])
$ _imports, _globals, _exceptions, _functions, _classes = details["members"]
$# $ unique_imports = set(dict(_imports).keys()).difference(stdlib_module_names).difference(set(details["descendants"].keys()))
$# $if unique_imports:
$#
$# $for module in unique_imports:
$# $module\
$# $if not loop.last:
$# ,
$#
$#
$# $for descendant, desc_details in details["descendants"].items():
$# - $descendant
$#
$# $details["mod"]["all"]
$# $for global_name, global_details in _globals:
$# $if global_name == "__path__":
$# $continue
$# $(details["name"]).$global_name\
$# $if isinstance(global_details, (bool, str, int, float)):
$# = $global_details
$# $continue
$# $if global_details.get("type") in ("function", "class"):
$# $global_details["sig"]
$# ¶
$# $if doc := global_details.get("doc"):
$# $doc
$ sname = details["name"].replace(".", "/")
$for glob_name, glob_details in _globals:
$if glob_name not in details["mod"]["all"]:
$continue
$# $glob_name $glob_details["type"]
$# $func_name\
$# \
$# $func_details["sig"]
$# #
$# [source]
$#
$# $:mkdn(glob_details["doc"])
$for func_name, func_details in _functions:
$if func_name not in details["mod"]["all"]:
$continue
$func_name\
\
$func_details["sig"]
#
[source]
$:mkdn(func_details["doc"])
$for cls_name, cls_details in _classes:
$if cls_name not in details["mod"]["all"]:
$continue
$cls_name\
\
$cls_details["sig"]
#
[source]
$:mkdn(cls_details["doc"])
$# $pformat(details)