Skip to content

Commit

Permalink
testing 9
Browse files Browse the repository at this point in the history
  • Loading branch information
asucrews authored Jul 3, 2024
1 parent f9b8ddd commit 88e07a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@ action:

mode: single
max_exceeded: silent

18 changes: 13 additions & 5 deletions scripts/yaml_to_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,19 @@ def yaml_to_markdown(yaml_file, markdown_file):

f.write("\n## Actions\n")
for action in data['action']:
f.write(f"### {action['choose']['conditions'][0]['id']}\n")
for step in action['sequence']:
service = step.get('service', 'Unknown service')
data = step.get('data', 'No data')
f.write(f"- **{service}**: {data}\n")
if 'choose' in action:
for choice in action['choose']:
conditions = choice.get('conditions', [])
if conditions:
condition_id = conditions[0].get('id', 'Unknown')
f.write(f"### {condition_id}\n")
for step in choice.get('sequence', []):
service = step.get('service', 'Unknown service')
data = step.get('data', 'No data')
f.write(f"- **{service}**: {data}\n")
else:
# Handle other types of actions if necessary
pass

f.write("\n## Mode\n")
f.write(f"- **Mode**: {data['mode']}\n")
Expand Down

0 comments on commit 88e07a7

Please sign in to comment.