diff --git a/scripts/gen_centered_graph.py b/scripts/gen_centered_graph.py index 40840b9..6806e1a 100644 --- a/scripts/gen_centered_graph.py +++ b/scripts/gen_centered_graph.py @@ -9,15 +9,20 @@ import os def gen(headline_id, graph): reference_node = headline_id + linked_from_internal = set() g = copy.deepcopy(graph) centered_graph = { reference_node: g[reference_node] } + for l in g[reference_node]['links']: + lt = l['target'] + if lt.startswith("id:"): + lt = lt[3:] + linked_from_internal.add(lt) del g[reference_node] new_nodes = True in_emacs_tree = { reference_node: set(), } - linked_from_internal = set() while new_nodes: new_nodes = False