Skip to content

Commit 49da867

Browse files
ref search to broken-up pages
1 parent 21cb267 commit 49da867

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

update_ref_search.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ def insert_whitespace(x):
2525
x = x.replace(word, " " + word + " ").replace(" ", " ")
2626
return x.strip(" ")
2727

28+
split_layout_attrs = [
29+
"xaxis", "yaxis", "coloraxis", "scene", "polar", "ternary", "geo", "mapbox",
30+
"sliders", "updatemenus", "annotations", "shapes", "images"
31+
]
32+
2833
_epsilon = 0.0
2934

3035
def epsilon():
@@ -43,6 +48,10 @@ def next_level(previous_level, chain_dict):
4348
permalink=chain_dict["permalink"] + "-" + sub_attr,
4449
rank=chain_dict["rank"] + 1 + epsilon(),
4550
)
51+
for attr in split_layout_attrs:
52+
if attribute["permalink"].endswith("layout-"+attr):
53+
attribute["permalink"] = attribute["permalink"].replace("/layout/", "/layout/"+attr+"/")
54+
4655
if "description" in previous_level[sub_attr]:
4756
attribute["description"] = previous_level[sub_attr][
4857
"description"
@@ -57,7 +66,7 @@ def next_level(previous_level, chain_dict):
5766
next_level(previous_level[sub_attr], attribute.copy())
5867

5968

60-
layout_chain_dict = dict(name="layout", split_name="layout", permalink="reference/#layout", rank=epsilon())
69+
layout_chain_dict = dict(name="layout", split_name="layout", permalink="reference/layout/#layout", rank=epsilon())
6170

6271
# recursively add layout attributes to schema
6372
next_level(p["layout"]["layoutAttributes"], layout_chain_dict.copy())
@@ -66,7 +75,7 @@ def next_level(previous_level, chain_dict):
6675
trace_chain_dict = dict(
6776
name=trace_type + " traces",
6877
split_name=insert_whitespace(trace_type),
69-
permalink="reference/#" + trace_type, rank=epsilon()
78+
permalink="reference/"+ trace_type + "/#" + trace_type, rank=epsilon()
7079
)
7180
if p["traces"][trace_type]["meta"]:
7281
trace_chain_dict["description"] = (

0 commit comments

Comments
 (0)