Skip to content

Commit b989584

Browse files
authored
Add supporters page (#262)
1 parent 444bc6a commit b989584

18 files changed

+308
-260
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
doc/_build
22
doc/using/config_files.rst
33
doc/howto/user_interface.rst
4+
doc/howto/lab_workspaces.rst
45
doc/howto/languages.rst
6+
doc/_data/snippets
7+
doc/_data/pages
58
.ipynb_checkpoints
69
.vscode

doc/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,11 @@ help:
2020
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2121

2222
live:
23-
sphinx-autobuild --ignore */.github/* --ignore */federation/data-federation.txt --ignore */howto/languages.rst --ignore */howto/user_interface.rst --ignore */howto/lab_workspaces.rst --ignore */using/config_files.rst . _build/html/
23+
sphinx-autobuild \
24+
--ignore */.github/* \
25+
--ignore */_data/* \
26+
--ignore */howto/languages.rst \
27+
--ignore */howto/user_interface.rst \
28+
--ignore */howto/lab_workspaces.rst \
29+
--ignore */using/config_files.rst \
30+
. _build/html/
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"""Generate snippets of markdown for various types of supporters.
2+
These are meant to be inserted into our docs.
3+
"""
4+
from pathlib import Path
5+
from yaml import safe_load
6+
7+
# Code to generate the HTML grid
8+
template_binderhub = """
9+
```{{grid-item-card}}
10+
:text-align: center
11+
:class-header: bg-light
12+
:class-body: sd-p-4 sd-m-auto
13+
:class-footer: bg-light
14+
:text-align: center
15+
:link: {URL_BINDERHUB}
16+
17+
**{BINDERHUB_SUBDOMAIN}**
18+
19+
^^^
20+
21+
<img src="{LOGO}" style="max-height: 5em; min-height: 2em;" />
22+
```
23+
24+
"""
25+
26+
# Read from our YAML data file
27+
path_root = Path(__file__).parent.parent
28+
path_data = path_root / "support" / "federation.yml"
29+
binderhubs = safe_load(path_data.read_text())
30+
31+
# Generate markdown entries for each federation member
32+
entries = []
33+
for binderhub in binderhubs:
34+
entries.append(template_binderhub.format(URL_BINDERHUB=binderhub["url_binderhub"],
35+
BINDERHUB_SUBDOMAIN=binderhub["url_binderhub"].split("//")[-1],
36+
LOGO=binderhub["logo"],
37+
RUN_BY=binderhub["run_by"],
38+
RUN_BY_LINK=binderhub["run_by_link"],
39+
FUNDED_BY=binderhub["funded_by"],
40+
FUNDED_BY_LINK=binderhub["funded_by_link"],))
41+
entries = "\n".join(entries)
42+
43+
# Wrap the entries in a `grid` directive
44+
directive = f"""
45+
````{{grid}} 1 1 2 2
46+
:class-container: federation-members
47+
:gutter: 4
48+
49+
{entries}
50+
````
51+
"""
52+
53+
# Write a txt file that we can insert into docs
54+
path_md = path_root.joinpath("snippets", "federation_md.txt")
55+
path_md.parent.mkdir(parents=True, exist_ok=True)
56+
path_md.write_text(directive)

doc/_data/scripts/gen_support_md.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"""Generate snippets of markdown for various types of supporters.
2+
These are meant to be inserted into our docs.
3+
"""
4+
from pathlib import Path
5+
from yaml import safe_load
6+
from textwrap import dedent
7+
8+
# Read from our YAML data file
9+
path_root = Path(__file__).parent.parent
10+
path_data = path_root / "support" / "supporters.yml"
11+
supporters_yaml = safe_load(path_data.read_text())
12+
for kind, supporters in supporters_yaml.items():
13+
# This is where we write the txt snippet to be imported
14+
path_snippet = path_root.joinpath("snippets", f"supporters_{kind}_md.txt")
15+
path_snippet.parent.mkdir(parents=True, exist_ok=True)
16+
17+
# If no supporters are listed juts write a short message saying there are none.
18+
if not supporters:
19+
path_snippet.write_text("**There are currently no supporters of this category.**")
20+
continue
21+
22+
# Generate markdown entries for each member
23+
output = ""
24+
for supporter in supporters:
25+
output += dedent(f"""
26+
```{{grid-item-card}}
27+
:text-align: center
28+
:class-header: bg-light
29+
:class-body: sd-p-4 d-flex sd-m-auto
30+
:link: {supporter["url"]}
31+
:text-align: center
32+
33+
**{supporter["name"]}**
34+
^^^
35+
36+
<img src="{supporter['logo']}" style="max-height:5em;min-height:2em;" />
37+
38+
```
39+
40+
""")
41+
42+
# Wrap the entries in a `grid` directive
43+
directive = dedent("""
44+
````{{grid}} 1 1 2 2
45+
:class-container: support-{kind}
46+
:gutter: 4
47+
48+
{output}
49+
````
50+
""")
51+
directive = directive.format(output=output, kind=kind)
52+
53+
# Write a txt file that we can insert into docs
54+
path_snippet.write_text(directive)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""
2+
This grabs a few content pages in the repo2docker docs and imports them for use here.
3+
4+
It will put the folders in _data/pages at build time, if they do not currently exist.
5+
"""
6+
import requests
7+
from pathlib import Path
8+
9+
# Grab the latest version of the configuration file examples and howtos
10+
# Files will be placed relative to documentation root
11+
dest_root = Path(__file__).parent.parent.parent
12+
source_root = "https://raw.githubusercontent.com/jupyter/repo2docker/master/docs/source/"
13+
file_mappings = {
14+
"config_files.rst": "using/config_files.rst",
15+
"howto/languages.rst": "howto/languages.rst",
16+
"howto/user_interface.rst": "howto/user_interface.rst",
17+
"howto/lab_workspaces.rst": "howto/lab_workspaces.rst",
18+
19+
}
20+
for source, dest in file_mappings.items():
21+
path_dest = dest_root / dest
22+
if not path_dest.exists():
23+
print(f"repo2docker page does not exist, downloading from repo2docker docs. {source}")
24+
url_source = source_root + source
25+
resp = requests.get(url_source)
26+
path_dest.parent.mkdir(parents=True, exist_ok=True)
27+
path_dest.write_text(
28+
f"""
29+
.. ##################################################
30+
.. DO NOT EDIT THIS FILE, IT IS IMPORTED IN `conf.py`
31+
.. ##################################################
32+
33+
{resp.text}
34+
"""
35+
)
36+
else:
37+
print(f"repo2docker page exists, skipping download. Delete it to re-download. {source} ")

doc/federation/data-federation.yml renamed to doc/_data/support/federation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Data that is used to generate our federation page.
12
- url_binderhub: https://gke.mybinder.org
23
logo: https://binderhub.readthedocs.io/en/latest/_static/logo.png
34
funded_by: Google Cloud

doc/_data/support/supporters.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# All supporting organizations / federation members are in alphabetical order
2+
# For partner organizations, add them only if their organization lets them contribute
3+
# in an "official" capacity to Binder, not only if they do this off-hours.
4+
5+
partners:
6+
- name: 2i2c
7+
logo: https://github.com/2i2c-org/2i2c-org.github.io/blob/main/static/media/logo.png?raw=true
8+
url: https://2i2c.org
9+
10+
- name: GESIS
11+
logo: https://www.gesis.org/typo3conf/ext/gesis_web_ext/Resources/Public/webpack/dist/img/gs_home_logo_de.svg
12+
url: https://www.gesis.org
13+
14+
- name: Simula Research Laboratory
15+
logo: https://www.simula.no/sites/default/themes/simula2019/images/logo.svg?r9vi8o
16+
url: https://www.simula.
17+
18+
- name: The Turing Institute
19+
logo: https://upload.wikimedia.org/wikipedia/commons/b/b5/Alan_Turing_Institute_logo.svg
20+
url: https://www.turing.ac.uk/
21+
22+
- name: UC Berkeley
23+
logo: https://upload.wikimedia.org/wikipedia/commons/8/82/University_of_California%2C_Berkeley_logo.svg
24+
url: https://www.berkeley.edu/
25+
26+
# Have made substantial contributions to Binder in the last year (>$10,000)
27+
financial: ""
28+
29+
# Have provided cloud credits that power Binder infrastructure
30+
credits:
31+
- name: GESIS
32+
logo: https://www.gesis.org/typo3conf/ext/gesis_web_ext/Resources/Public/webpack/dist/img/gs_home_logo_de.svg
33+
url: https://www.gesis.org
34+
35+
- name: Google Open Source
36+
logo: https://www.gstatic.com/devrel-devsite/prod/v6cd15f45ec209c8961e07ea7e57ed9a0e9da4333bc915e67d1fcd2b2a9ec62d1/opensource/images/lockup.svg
37+
url: https://opensource.google/
38+
39+
- name: OVHCloud
40+
logo: https://upload.wikimedia.org/wikipedia/commons/2/26/Logo-OVH.svg
41+
url: https://www.ovhcloud.com/en/
42+
43+
- name: The Turing Institute
44+
logo: https://upload.wikimedia.org/wikipedia/commons/b/b5/Alan_Turing_Institute_logo.svg
45+
url: https://www.turing.ac.uk/

doc/about/contribute.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

doc/about/federation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ federation, check out [](federation/joining).
1717
(federation/federation-list)=
1818
## Members of the BinderHub Federation
1919

20-
Here is a list of the current members of the BinderHub federation:
20+
Below is a list of the current member hubs in the BinderHub Federation:
2121

22-
```{include} ../federation/data-federation.txt
22+
```{include} /_data/snippets/federation_md.txt
2323
```
2424

2525

doc/about/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ This is a collection of pages about the Binder service running at [mybinder.org]
99

1010
```{toctree}
1111
:maxdepth: 2
12+
:caption: Service information
1213
1314
user-guidelines
1415
status
16+
```
17+
18+
```{toctree}
19+
:maxdepth: 2
20+
:caption: Project information
1521
support
22+
supporters
1623
team
17-
contribute
1824
federation
1925
cite
2026
```

0 commit comments

Comments
 (0)