File tree Expand file tree Collapse file tree 7 files changed +130
-9
lines changed Expand file tree Collapse file tree 7 files changed +130
-9
lines changed Original file line number Diff line number Diff line change 11docs/collaboration/bids_github/
22docs/datasets/index.md
33docs/extensions/macros_doc.md
4+ docs/extensions/beps
Original file line number Diff line number Diff line change 572572
573573- number : ' 044'
574574 title : Stimuli
575+ google_doc : https://docs.google.com/document/d/1DoQghbJlQksCHEFs0boT816p3ejX2Hd9l-OWDTXFtV8/edit
575576 leads :
576577 - given-names : Seyed
577578 family-names : Yahya Shirazi
Original file line number Diff line number Diff line change 22
33You can contribute to ongoing BIDS Extension Proposals (BEPs).
44
5+ ## Active BEPs
6+
57Below is a table of currently-active BEPs.
68
79Note that all of the extension ideas that are not backwards compatible and thus will have to wait for BIDS 2.0 are listed on the
@@ -25,7 +27,7 @@ https://facelessuser.github.io/pymdown-extensions/extensions/snippets/#snippets-
2527
2628{{ MACROS__ _ generate_beps_table(file="beps_completed.yml", type="completed") }}
2729
28- < br >
30+ ## Others
2931
3032Some proposals that set out to extend the BIDS specification have instead lead to other outcomes such as:
3133
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ all: update
33serve : update
44 mkdocs serve -a localhost:8080
55
6- update : update_from_spec update_contributors update_datasets_examples tmp_figures
6+ update : update_from_spec update_contributors update_datasets_examples tmp_figures update_bep_pages
77
88package.json :
99 npm install ` cat npm-requirements.txt`
@@ -23,6 +23,9 @@ update_datasets_examples:
2323 @echo " ---------------------------------- "
2424 python data/datasets/examples/tools/print_dataset_listing.py docs/datasets/index.md
2525
26+ update_bep_pages :
27+ @echo " ---------------------------------- "
28+ python tools/build/generate_bep_pages.py
2629
2730# Figures
2831.PHONY : tmp/affiliations.html tmp/bids_timeline.html tmp/citation_per_year.html tmp/openneuro_data_growth.html
Original file line number Diff line number Diff line change 1+ ---
2+ hide:
3+ - navigation
4+ - toc
5+ ---
6+
7+ # BEP {{ bep.number }}: {% if bep .display %} {{ bep.display }} {% else %} {{ bep.title }} {% endif %}
8+
9+ {% if bep .communication_channel %}
10+ !!! note
11+
12+ Get in touch with people working on this BIDS extension: [{{ bep.communication_channel }}]({{ bep.communication_channel }})
13+ {% endif %}
14+
15+ {% if bep .pull_request %}
16+ **Pull request**: [{{ bep.pull_request }}]({{ bep.pull_request }} )
17+ {% else %}
18+ **Google doc**: [{{ bep.google_doc }}]({{ bep.google_doc }} )
19+ {% endif %}
20+
21+ ## Content
22+
23+ {% for content in bep .content %}
24+ - {{ content }}
25+ {% endfor %}
26+
27+ ## Lead(s)
28+
29+ {% for person in bep .leads %}
30+ {% if person .email %}
31+ - [{{ person["given-names"] }} {{ person["family-names"] }}](mailto:{{ person.email }})
32+ {% else %}
33+ - {{ person["given-names"] }} {{ person["family-names"] }}
34+ {% endif %}
35+ {% endfor %}
36+
37+ {% if bep .status %}
38+ ## Status
39+
40+ {% for item in bep .status %}
41+ - {{ item }}
42+ {% endfor %}
43+ {% endif %}
44+
45+ {% if bep .blocking %}
46+ ## Blockers
47+
48+ {% for item in bep .blocking %}
49+ - {{ item }}
50+ {% endfor %}
51+ {% endif %}
52+
53+ {% if bep .bids_maintainers %}
54+ ## BIDS maintainers
55+
56+ {% for person in bep .bids_maintainers %}
57+ - {{ person["given-names"] }} {{ person["family-names"] }}
58+ {% endfor %}
59+ {% endif %}
60+
61+ ## Preview
62+
63+ <iframe
64+ {% if bep.html_preview %}
65+ src =" {{ bep.html_preview }}"
66+ {% else %}
67+ src =" {{ bep.google_doc }}"
68+ {% endif %}
69+ width =" 100%"
70+ height =" 1024"
71+ frameborder =" 0"
72+ marginheight =" 0"
73+ marginwidth =" 0" >
74+ Loading…
75+ </iframe >
Original file line number Diff line number Diff line change 1- {% if type == "completed" %}
2- | Extension | Title | Content | Lead(s) |
3- | :--------: | :---- | :----- | :----- |
4- {% elif type == "other" %}
1+ {% if type == "other" %}
52| Extension | Title | Content | Lead(s) | Outcome |
63| :--------: | :---- | :----- | :----- | :------ |
74{% else %}
8- | Extension | Title | Content | Lead(s) | Last update | Problems |
9- | :--------: | :---- | :----- | :----- | :---------- | :------- |
5+ | Extension | Title | Content | Lead(s) |
6+ | :--------: | :---- | :----- | :----- |
107{% endif %}
118{% for bep in include %}
12- | [BEP {{ bep.number }}](./beps/bep_{{ bep.number }}.html ) | {% if bep .display %} {{ bep.display }} {% else %} {{ bep.title }} {% endif %} | {% for content in bep .content %} {{ content }} {% endfor %} | {% for person in bep .leads %} {% if person .email %} [{{ person["given-names"] }} {{ person["family-names"] }}](mailto:{{ person.email }}) {% else %} {{ person["given-names"] }} {{ person["family-names"] }} {% endif %} <br >{% endfor %} | {% if bep . status %} {% for item in bep . status %} - {{ item }} < br > {% endfor %} {% endif %} | {% if bep . blocking %} {% for item in bep . blocking %} - {{ item }} < br > {% endfor %} {% endif %} |
9+ | [BEP {{ bep.number }}](./beps/bep_{{ bep.number }}.md ) | {% if bep .display %} {{ bep.display }} {% else %} {{ bep.title }} {% endif %} | {% for content in bep .content %} {{ content }} {% endfor %} | {% for person in bep .leads %} {% if person .email %} [{{ person["given-names"] }} {{ person["family-names"] }}](mailto:{{ person.email }}) {% else %} {{ person["given-names"] }} {{ person["family-names"] }} {% endif %} <br >{% endfor %} |
1310{% endfor %}
Original file line number Diff line number Diff line change 1+ """Generate a page for each BEP based on its metadata."""
2+
3+ import ruamel .yaml
4+ from jinja2 import Environment , FileSystemLoader , select_autoescape
5+ from rich import print
6+
7+ from bids_website .utils import root_dir
8+
9+ yaml = ruamel .yaml .YAML ()
10+ yaml .indent (mapping = 2 , sequence = 4 , offset = 2 )
11+
12+ TEMPLATES_DIR = root_dir () / "templates"
13+
14+ WEBSITE_DATA_DIR = root_dir () / "data"
15+
16+
17+ def return_jinja_env () -> Environment :
18+ return Environment (
19+ loader = FileSystemLoader (TEMPLATES_DIR ),
20+ autoescape = select_autoescape (),
21+ lstrip_blocks = True ,
22+ trim_blocks = True ,
23+ )
24+
25+
26+ def generate_bep_page (bep : dict ) -> str :
27+ env = return_jinja_env ()
28+ template = env .get_template ("bep_page_md.jinja" )
29+ content = template .render (bep = bep )
30+ output_file = (
31+ root_dir () / "docs" / "extensions" / "beps" / f"bep_{ bep ['number' ]} .md"
32+ )
33+ output_file .write_text (content )
34+ print (f" generated: { output_file } " )
35+
36+
37+ BEPS = yaml .load (WEBSITE_DATA_DIR / "beps" / "beps.yml" )
38+
39+ for bep in BEPS :
40+ print (bep ["number" ])
41+ assert "google_doc" in bep or "pull_request" in bep
42+ generate_bep_page (bep )
You can’t perform that action at this time.
0 commit comments