Skip to content

Commit

Permalink
fix mermaid diagram input and output names
Browse files Browse the repository at this point in the history
  • Loading branch information
jdewinne committed Nov 13, 2023
1 parent 5553df9 commit 8bf71c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/generate-readme/action-to-mermaid.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,28 @@ def generate_mermaid(action_yaml_file):
data = yaml.load(f, Loader=yaml.FullLoader)

# Add action node
nodes = []
action = Node(data['name'])
nodes.append(action)
# Add input nodes
inputs = []
if 'inputs' in data:
for input_name in data['inputs']:
input = Node(input_name)
input = Node(input_name, input_name)
nodes.append(input)
inputs.append(Link(input, action))

# Add output nodes
outputs = []
if 'outputs' in data:
for output_name in data['outputs']:
output = Node(output_name)
output = Node(output_name, output_name)
nodes.append(output)
outputs.append(Link(action, output))

chart = MermaidDiagram(
title=data['name'],
nodes=[action],
nodes=nodes,
links=inputs+outputs,
orientation = 'left to right'
)
Expand Down

0 comments on commit 8bf71c5

Please sign in to comment.