![]() |
Public API index.
tfdocs.doc_generator_visitor.ApiTree()
Items must be inserted in order from root to leaves.
Lookup a path-tuple to fetch a node:
node = index[path]
Use the node_from_obj
method to lookup the node for a python object:
node = index.node_from_obj(obj)
Remember that maybe_singleton
(numbers, strings, tuples) classes can't be
looked up this way.
To build a tree, nodes must be inserted in tree order starting from the root.
Attributes | |
---|---|
root
|
The root ApiFileNode of the tree.
|
Methods
from_path_tree
@classmethod
from_path_tree( path_tree: PathTree, score_name_fn ) -> ApiTree
Create an ApiTree from an PathTree.
Args | |
---|---|
path_tree
|
The PathTree to convert.
|
score_name_fn
|
The name scoring function. |
Returns | |
---|---|
an ApiIndex , created from path_tree .
|
insert
insert(
path: ApiPath, py_object: Any, aliases: List[ApiPath]
)
Add an object to the index.
iter_nodes
iter_nodes()
Iterate over the nodes in BFS order.
node_for_object
node_for_object(
obj: Any
) -> Optional[ApiTreeNode]
__contains__
__contains__(
path: ApiPath
) -> bool
True if the dictionary has the specified key, else False.
__eq__
__eq__(
other
)
Return self==value.