Skip to content

Commit

Permalink
Convert markdown descriptions to HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed Feb 28, 2024
1 parent c2fe2bc commit bb0c53a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ source .venv/bin/activate
```
One can also use `conda` and other tools to set up virtual environments.

To install the dependencies (only [`PyYAML`](https://pyyaml.org/), at the moment), you can use:
To install the dependencies, you can use:
```
python -m pip install -r requirements.txt
```
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PyYAML==6.0
Markdown==3.5.2
5 changes: 5 additions & 0 deletions yaml2json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import glob
import os

import markdown
import yaml
import json

Expand All @@ -20,6 +21,10 @@
else:
name = tool_data["name"]

# Convert markdown description to HTML
if "summary" in tool_data:
tool_data["summary"] = markdown.markdown(tool_data["summary"])

data[name] = tool_data
with open("simtools/simtools.json", "w") as f:
json.dump(data, f, indent=2, sort_keys=True)

0 comments on commit bb0c53a

Please sign in to comment.