Skip to content

Commit

Permalink
Enumerate possible values for parameters in rendered markdown files (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
openvmp authored Aug 4, 2024
1 parent c20dba5 commit 17c25d8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions partcad/src/partcad/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1459,10 +1459,17 @@ def add_section(name, shape, render_cfg):
if "parameters" in config:
parameters = "Parameters:<br/><ul>"
for param_name, param in config["parameters"].items():
parameters += "<li>%s: %s</li>" % (
param_name,
param["default"],
)
if "enum" in param:
value = "<ul>"
for enum_value in param["enum"]:
if enum_value == param["default"]:
value += "<li><b>%s</b></li>" % enum_value
else:
value += "<li>%s</li>" % enum_value
value += "</ul>"
else:
value = param["default"]
parameters += "<li>%s: %s</li>" % (param_name, value)
parameters += "</ul>"
columns += [parameters]

Expand Down

0 comments on commit 17c25d8

Please sign in to comment.