Skip to content

Commit 301585f

Browse files
fix reference pages
1 parent a84b54d commit 301585f

File tree

2 files changed

+60
-109
lines changed

2 files changed

+60
-109
lines changed

_data/get_plotschema.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,20 @@ def make_underscore(path, section, value):
9191

9292
def underscores(attr, path, section):
9393
if "items" not in attr or (
94-
len(path) > 0 and path[-1] in ["shapes", "annotations", "images"]
94+
len(path) > 0 and path[0] in ["shapes", "annotations", "images"]
9595
):
9696
if "_deprecated" in attr:
9797
del attr["_deprecated"]
9898
for k in attr:
9999
if type(attr[k]) == dict and not k.endswith("src"):
100100
underscores(attr[k], path + [k], section)
101-
if attr.get("role") == "object":
102-
attr["magic_underscores"] = make_underscore(path, section, "dict(...)")
103-
else:
104-
attr["magic_underscores"] = make_underscore(path, section, "<VALUE>")
105-
else:
101+
102+
if len(path) == 0 or path[-1] != "items":
103+
if attr.get("role") == "object":
104+
attr["magic_underscores"] = make_underscore(path, section, "dict(...)")
105+
else:
106+
attr["magic_underscores"] = make_underscore(path, section, "<VALUE>")
107+
elif len(path) == 0 or path[-1] != "items":
106108
attr["magic_underscores"] = make_underscore(path, section, "list(...)")
107109

108110

0 commit comments

Comments
 (0)