Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use YAML file for people #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,6 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

/_build/
/_build/
package-lock.json
node_modules
28 changes: 28 additions & 0 deletions docs/data/team.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Listed in alphabetical order, beginning with the Steering Council
# Steering Council
- name: Chris Holdgraf
github: choldgraf
team: Steering Council
affiliation: 2i2c
- name: Greg Caporaso
github: gregcaporaso
team: Steering Council
affiliation: Northern Arizona University
- name: Rowan Cockett
github: rowanc1
team: Steering Council
affiliation: CurveNote

# Core Team
- name: Angus Hollands
github: agoose77
team: Core Team
affiliation: 2i2c
- name: Frank W Koch
github: fwkoch
team: Core Team
affiliation: CurveNote
- name: Steve Purves
github: stevejpurves
team: Core Team
affiliation: CurveNote
2 changes: 2 additions & 0 deletions docs/myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ project:
license: CC0-1.0
references:
jupyter_governance: https://jupyter.org/governance/
plugins:
- src/team.mjs
toc:
- file: index.md
- file: team.md
Expand Down
39 changes: 39 additions & 0 deletions docs/src/team.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import yaml from "js-yaml";
import fs from "fs";

// Read and parse team data
const teamData = yaml.load(fs.readFileSync("data/team.yml", "utf8"));
const teamDirective = {
name: "team",
doc: "Display members of a team!",
arg: { type: String, doc: "The team name.", required: true },
run(data, vfile, ctx) {
const team = data.arg;
var cards = [];
teamData.forEach(ii => {
if (ii["team"] === team) {
cards.push(`
:::{card} ${ii["name"]}
:link: https://github.com/${ii["github"]}
:footer: **Affiliation:** ${ii['affiliation']}
![${ii["name"]} avatar](https://github.com/${ii["github"]}.png)
:::`)
}
});
if (cards.length === 0) {
throw new Error(`Team ${team} not found.`);
}
const grid = ctx.parseMyst(`
::::{grid} 3
${cards.join("\n")}
::::`).children[0];
return [grid];
},
};

const plugin = {
name: "Compass team plugins",
directives: [teamDirective],
};

export default plugin;
26 changes: 3 additions & 23 deletions docs/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,7 @@ The Steering Council Mailing List is: [**`[email protected]`

### Members

```{grid} 3
:::{card} Chris Holdgraf
:link: https://github.com/choldgraf
![Rowan avatar](https://github.com/choldgraf.png)
Affiliation: 2i2c
:::

:::{card} Greg Caporaso
:link: https://github.com/gregcaporaso
![Rowan avatar](https://github.com/gregcaporaso.png)
Affiliation: Northern Arizona University
:::

:::{card} Rowan Cockett
:link: https://github.com/rowanc1
![Rowan avatar](https://github.com/rowanc1.png)
Affiliation: Curvenote
:::
```{team} Steering Council
```

(core-team)=
Expand All @@ -44,11 +27,8 @@ Affiliation: Curvenote

Our core team consists of the following people (in alphabetical order).

- [`@agoose77`](https://github.com/agoose77)
- [`@choldgraf`](https://github.com/choldgraf)
- [`@fwkoch`](https://github.com/fwkoch)
- [`@rowanc1`](https://github.com/rowanc1)
- [`@stevejpurves`](https://github.com/stevejpurves)
:::{team} Core Team
:::

## Software Steering Council Representative

Expand Down
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "jupyter-book-team-compass",
"repository": {
"type": "git",
"url": "https://github.com/jupyter-book/team-compass.git"
},
"devDependencies": {
"js-yaml": "^4.1.0",
"myst-cli": "^1.3.18"
},
"engines": {
"npm": ">=10.7.0",
"node": ">=18.0.0"
},
"packageManager": "[email protected]"
}