Fix links originating from top-level of graph center.
This commit is contained in:
parent
539240079f
commit
d6c8b9f3db
@ -9,15 +9,20 @@ import os
|
|||||||
def gen(headline_id, graph):
|
def gen(headline_id, graph):
|
||||||
reference_node = headline_id
|
reference_node = headline_id
|
||||||
|
|
||||||
|
linked_from_internal = set()
|
||||||
g = copy.deepcopy(graph)
|
g = copy.deepcopy(graph)
|
||||||
centered_graph = { reference_node: g[reference_node] }
|
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]
|
del g[reference_node]
|
||||||
new_nodes = True
|
new_nodes = True
|
||||||
|
|
||||||
in_emacs_tree = {
|
in_emacs_tree = {
|
||||||
reference_node: set(),
|
reference_node: set(),
|
||||||
}
|
}
|
||||||
linked_from_internal = set()
|
|
||||||
|
|
||||||
while new_nodes:
|
while new_nodes:
|
||||||
new_nodes = False
|
new_nodes = False
|
||||||
|
Loading…
Reference in New Issue
Block a user