Skip to content

Commit

Permalink
reform auto-generated DAG Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
salomaolopes committed Jan 30, 2025
1 parent 2d267bc commit c8cb9e6
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/dou_dag_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,17 @@ def prepare_doc_md(specs: DAGConfig, config_file: str) -> str:
**Configuração da dag definida no arquivo `{config_file}`**:
<dl>
"""
)
for key, value in config.items():
doc_md = doc_md + f"<dt>{key}</dt>"
if isinstance(value, list) or isinstance(value, set):
doc_md = doc_md + (
"<dd>\n\n"
+ " * "
+ "\n * ".join(str(item) for item in value)
+ "\n</dd>"
)
doc_md += f"\n**{key.replace('_', ' ').capitalize()}**\n"

if isinstance(value, (list, set)):
doc_md += "\n" + "\n".join(f"- {str(item)}" for item in value) + "\n"
else:
doc_md = doc_md + f"<dd>{str(value)}</dd>"
doc_md = doc_md + "\n"
doc_md = doc_md + "</dl>\n"
doc_md += "\n" + f"- {str(value)}\n" + "\n"

return doc_md

@staticmethod
Expand Down

0 comments on commit c8cb9e6

Please sign in to comment.