From 8cbfb52c91641b056d696b97fa29ee0e96562d88 Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 18 Apr 2025 18:58:57 -0400 Subject: [PATCH 1/5] Add simple data/software_projects.toml --- data/software_projects.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 data/software_projects.toml diff --git a/data/software_projects.toml b/data/software_projects.toml new file mode 100644 index 0000000..b42b357 --- /dev/null +++ b/data/software_projects.toml @@ -0,0 +1,7 @@ +[[project]] +name = "PlasmaPy" +docs = "https://docs.plasmapy.org" +url = "https://www.plasmapy.org" +description = "Python package for plasma research and education" +license = "BSD 3-Clause" +languages = [ "Python" ] From b30aa59eb5918d3ab074ecb1cc7602b6f764408a Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 18 Apr 2025 20:25:09 -0400 Subject: [PATCH 2/5] Update software projects data --- data/software_projects.toml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/data/software_projects.toml b/data/software_projects.toml index b42b357..287ebed 100644 --- a/data/software_projects.toml +++ b/data/software_projects.toml @@ -1,7 +1,13 @@ -[[project]] +[[ project ]] name = "PlasmaPy" docs = "https://docs.plasmapy.org" -url = "https://www.plasmapy.org" +github = "https://github.org/PlasmaPy/PlasmaPy" description = "Python package for plasma research and education" license = "BSD 3-Clause" -languages = [ "Python" ] + +[[ 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" From 1abd3a8d9e244d95a4a6041fc0ed84691ed122fa Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 18 Apr 2025 20:25:46 -0400 Subject: [PATCH 3/5] Add Nox session to generate software projects table --- noxfile.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) 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") From c6257c6d815035340d46880a541f8f2f0fc6bbd9 Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 18 Apr 2025 20:26:28 -0400 Subject: [PATCH 4/5] Ignore generated file --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) 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 From f4de8972f2e43fe27d7423c0b6a029b0b0317132 Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 18 Apr 2025 20:26:43 -0400 Subject: [PATCH 5/5] Add software projects page --- content/software_projects.md | 4 ++++ myst.yml | 1 + 2 files changed, 5 insertions(+) create mode 100644 content/software_projects.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/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