diff --git a/.gitignore b/.gitignore index 36f5bed..8916093 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ env lib venv wheels + +# Generated files + +content/_generated_software_table.md diff --git a/content/software_projects.md b/content/software_projects.md new file mode 100644 index 0000000..cb98b7b --- /dev/null +++ b/content/software_projects.md @@ -0,0 +1,4 @@ +## Software projects + +```{literalinclude} _generated_software_table.md +``` \ No newline at end of file diff --git a/data/software_projects.toml b/data/software_projects.toml new file mode 100644 index 0000000..287ebed --- /dev/null +++ b/data/software_projects.toml @@ -0,0 +1,13 @@ +[[ project ]] +name = "PlasmaPy" +docs = "https://docs.plasmapy.org" +github = "https://github.org/PlasmaPy/PlasmaPy" +description = "Python package for plasma research and education" +license = "BSD 3-Clause" + +[[ project ]] +name = "OMAS" +docs = "https://gafusion.github.io/omas" +github = "https://github.com/gafusion/omas" +description = "Library to interface with the ITER Integrated Modeling and Analysis Suite" +license = "MIT" diff --git a/myst.yml b/myst.yml index ac27650..7c66974 100644 --- a/myst.yml +++ b/myst.yml @@ -15,6 +15,7 @@ project: toc: - file: content/index.md + - file: content/software_projects.md keywords: - open science diff --git a/noxfile.py b/noxfile.py index da4f2d2..6e639d3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,16 +1,40 @@ # /// script -# dependencies = ["nox", "uv"] +# dependencies = ["nox", "uv", "py-markdown-table"] # /// import nox +from py_markdown_table.markdown_table import markdown_table +import tomllib +import pathlib nox.options.sessions = ["lint"] nox.options.default_venv_backend = "uv|virtualenv" @nox.session -def build(session): - session.install("uv") +def build(session: nox.Session) -> None: + """Build the website.""" + session.notify("software_table") + session.notify("mystify") + + +@nox.session +def software_table(session: nox.Session) -> None: + + software_projects_path = pathlib.Path("data/software_projects.toml") + with software_projects_path.open("rb") as data_file: + software_projects = tomllib.load(data_file) + + projects_table = markdown_table(software_projects["project"]).get_markdown() + + generated_file = pathlib.Path("content/_generated_software_table.md") + + with generated_file.open("w") as out_file: + out_file.write(projects_table) + +@nox.session +def mystify(session: nox.Session) -> None: + """Run mystmd.""" session.run("uvx", "--from=mystmd", "myst", "build", "--all", "--html")