Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ env
lib
venv
wheels

# Generated files

content/_generated_software_table.md
4 changes: 4 additions & 0 deletions content/software_projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Software projects

```{literalinclude} _generated_software_table.md
```
13 changes: 13 additions & 0 deletions data/software_projects.toml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ project:

toc:
- file: content/index.md
- file: content/software_projects.md

keywords:
- open science
Expand Down
30 changes: 27 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -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")


Expand Down