Skip to content

Commit 0f9b311

Browse files
daexsgvwilson
authored andcommitted
Fixed markdown formatting for valType 'info_array'
All three cases in 'InfoArrayValidator' no longer encounter '[][]' errors. For examples, see '_node.py' groups property, '_image.py' zmax property, '_dimension.py' constraintrange property. Keep the newline between "...specified as" and "* ..." to avoid rendering a code block. Note: Python now raises a SyntaxWarning due to '\['.
1 parent c2e20c7 commit 0f9b311

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

_plotly_utils/basevalidators.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -716,15 +716,15 @@ def __init__(
716716

717717
def description(self):
718718
desc = """\
719-
The '{plotly_name}' property is a number and may be specified as:""".format(
719+
The '{plotly_name}' property is a number and may be specified as:""".format(
720720
plotly_name=self.plotly_name
721721
)
722722

723723
if not self.has_min_max:
724724
desc = (
725725
desc
726-
+ """
727-
- An int or float"""
726+
+ """\n
727+
- An int or float"""
728728
)
729729

730730
else:
@@ -1983,17 +1983,16 @@ def description(self):
19831983
# ### Case 1 ###
19841984
if self.dimensions in (1, "1-2"):
19851985
upto = " up to" if self.free_length and self.dimensions == 1 else ""
1986-
desc += """
1987-
1986+
desc += """\n
19881987
* a list or tuple of{upto} {N} elements where:\
19891988
""".format(upto=upto, N=len(self.item_validators))
19901989

19911990
for i, item_validator in enumerate(self.item_validators):
19921991
el_desc = item_validator.description().strip()
19931992
desc = (
19941993
desc
1995-
+ """
1996-
({i}) {el_desc}""".format(i=i, el_desc=el_desc)
1994+
+ """\n
1995+
({i}) {el_desc}""".format(i=i, el_desc=el_desc)
19971996
)
19981997

19991998
# ### Case 2 ###
@@ -2006,15 +2005,15 @@ def description(self):
20062005
for i, item_validator in enumerate(self.item_validators):
20072006
# Update name for 2d
20082007
orig_name = item_validator.plotly_name
2009-
item_validator.plotly_name = "{name}[i][{i}]".format(
2008+
item_validator.plotly_name = "{name}\\[i\\]\\[{i}\\]".format(
20102009
name=self.plotly_name, i=i
20112010
)
20122011

20132012
el_desc = item_validator.description().strip()
20142013
desc = (
20152014
desc
2016-
+ """
2017-
({i}) {el_desc}""".format(i=i, el_desc=el_desc)
2015+
+ """\n
2016+
({i}) {el_desc}""".format(i=i, el_desc=el_desc)
20182017
)
20192018
item_validator.plotly_name = orig_name
20202019
else:
@@ -2039,9 +2038,9 @@ def description(self):
20392038
)
20402039

20412040
el_desc = item_validator.description().strip()
2042-
desc += """
2043-
* a 2D list where:
2044-
{el_desc}
2041+
desc += """\n
2042+
* a 2D list where:\n
2043+
{el_desc}
20452044
""".format(el_desc=el_desc)
20462045

20472046
item_validator.plotly_name = orig_name

0 commit comments

Comments
 (0)