MCPcopy Index your code
hub / github.com/plotly/dash / create_docstring_jl

Function create_docstring_jl

dash/development/_jl_components_generation.py:249–281  ·  view source on GitHub ↗

Create the Dash component docstring. Parameters ---------- component_name: str Component name props: dict Dictionary with {propName: propMetadata} structure description: str Component description Returns ------- str Dash component docst

(component_name, props, description)

Source from the content-addressed store, hash-verified

247
248
249def create_docstring_jl(component_name, props, description):
250 """Create the Dash component docstring.
251 Parameters
252 ----------
253 component_name: str
254 Component name
255 props: dict
256 Dictionary with {propName: propMetadata} structure
257 description: str
258 Component description
259 Returns
260 -------
261 str
262 Dash component docstring
263 """
264 # Ensure props are ordered with children first
265 props = reorder_props(props=props)
266
267 return "A{n} {name} component.\n{description}\nKeyword arguments:\n{args}".format(
268 n="n" if component_name[0].lower() in "aeiou" else "",
269 name=component_name,
270 description=description,
271 args="\n".join(
272 create_prop_docstring_jl(
273 prop_name=p,
274 type_object=prop["type"] if "type" in prop else prop["flowType"],
275 required=prop["required"],
276 description=prop["description"],
277 indent_num=0,
278 )
279 for p, prop in filter_props(props).items()
280 ),
281 )
282
283
284def create_prop_docstring_jl(

Callers 1

generate_class_stringFunction · 0.85

Calls 4

reorder_propsFunction · 0.85
create_prop_docstring_jlFunction · 0.85
filter_propsFunction · 0.70
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…