From 5c9b60967d899cb9c869375ae89f1a8af3da58b7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 14 Jun 2024 10:16:21 +0200 Subject: [PATCH] [ENH] automatically open external links in a new tab - closes #414 --- data/beps.yml | 5 ++--- data/beps_other.yml | 6 +++--- docs/bep/index.md | 18 +++++++++--------- mkdocs.yml | 1 + requirements.in | 1 + requirements.txt | 4 +++- templates/beps_table_md.jinja | 2 +- tools/convert_posts.py | 5 +---- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/data/beps.yml b/data/beps.yml index 9cfde8a6..5102768f 100644 --- a/data/beps.yml +++ b/data/beps.yml @@ -246,7 +246,7 @@ - name: ' ' email: status: - - BEP is open to new leadership, see also [BEP032 (animal electrophys)](https://docs.google.com/document/d/1oG-C8T-dWPqfVzL2W8HO3elWK8NIh2cOCPssRGv23n0/){:target="_blank"} + - BEP is open to new leadership, see also [BEP032 (animal electrophys)](https://docs.google.com/document/d/1oG-C8T-dWPqfVzL2W8HO3elWK8NIh2cOCPssRGv23n0/) blocking: - Searching for a new leader. google_doc_created: 2018-04 @@ -308,8 +308,7 @@ - 'New BEP, seeking contributors and collecting community feedback relating to: priority sequences to support, best supported binary structured formats (e.g. CBOR? HDF5? MsgPack?).' - Comments may be submitted directly on the document. - - Generating example datasets [here](https://github.com/JAgho/MISP_plot/tree/main){:target="_blank"} and determining best practice with vendors to - record data in-sequence + - Generating example datasets [here](https://github.com/JAgho/MISP_plot/tree/main) and determining best practice with vendors to record data in-sequence blocking: google_doc_created: 2021-04 pull_request_created: diff --git a/data/beps_other.yml b/data/beps_other.yml index ba2602a4..2ced33f0 100644 --- a/data/beps_other.yml +++ b/data/beps_other.yml @@ -35,7 +35,7 @@ content: - raw status: - - Became the [File mapper](https://github.com/DCAN-Labs/file-mapper){:target="_blank"}. + - Became the [File mapper](https://github.com/DCAN-Labs/file-mapper). - number: '019' title: DICOM Metadata @@ -45,8 +45,8 @@ content: - metadata status: - - Closed in favor of possible direct support of DICOM within BIDS (see this [issue](https://github.com/bids-standard/bids-specification/issues/1552){:target="_blank"} - and this [pull request](https://github.com/bids-standard/bids-specification/pull/1551){:target="_blank"}). + - Closed in favor of possible direct support of DICOM within BIDS (see this [issue](https://github.com/bids-standard/bids-specification/issues/1552) + and this [pull request](https://github.com/bids-standard/bids-specification/pull/1551)). google_doc_created: 2017-10 pull_request_created: pull_request_merged: diff --git a/docs/bep/index.md b/docs/bep/index.md index 1cc254b0..39e12fdd 100644 --- a/docs/bep/index.md +++ b/docs/bep/index.md @@ -3,32 +3,32 @@ Neurostars Website - The easiest way to contribute to BIDS is to ask questions you have about the specification on -[Neurostars](https://neurostars.org){:target="_blank"}. +[Neurostars](https://neurostars.org). - If your question has a -[bids tag](https://neurostars.org/search?q=tags%3Abids){:target="_blank"} +[bids tag](https://neurostars.org/search?q=tags%3Abids) it will be much easier for others to find the answer. - You can also get involved by _answering_ questions on -[Neurostars](https://neurostars.org/search?q=tags%3Abids){:target="_blank"}! +[Neurostars](https://neurostars.org/search?q=tags%3Abids)! Github Issues - You can contribute to the BIDS specification by opening -[Issues](https://github.com/bids-standard/bids-specification/issues){:target="_blank"} +[Issues](https://github.com/bids-standard/bids-specification/issues) and proposing changes via -[Pull Requests](https://github.com/bids-standard/bids-specification/pulls){:target="_blank"} +[Pull Requests](https://github.com/bids-standard/bids-specification/pulls) on -[GitHub](https://github.com/bids-standard/bids-specification){:target="_blank"}. +[GitHub](https://github.com/bids-standard/bids-specification). - To make improvements to the website that you are reading right now, you can also open an -[Issue](https://github.com/bids-standard/bids-website/issues){:target="_blank"} +[Issue](https://github.com/bids-standard/bids-website/issues) and propose changes via Pull Requests at the -[BIDS website GitHub repository](https://github.com/bids-standard/bids-website){:target="_blank"}. +[BIDS website GitHub repository](https://github.com/bids-standard/bids-website). Become a part of the BIDS Community There are so many ways to help us build this community. - You could help someone else learn the benefits of BIDS by giving a talk in your local organization -- Or you could work on [building a BIDS App](https://bids-apps.neuroimaging.io/){:target="_blank"}! +- Or you could work on [building a BIDS App](https://bids-apps.neuroimaging.io/)! The only requirement is that everyone who contributes adheres to our [BIDS Code of Conduct](https://github.com/bids-standard/bids-specification/blob/master/CODE_OF_CONDUCT.md). diff --git a/mkdocs.yml b/mkdocs.yml index 8d25f38c..4d7ddca2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,6 +15,7 @@ plugins: # categories: # - categories # - tags + - open-in-new-tab - macros: module_name: macros/main - redirects: diff --git a/requirements.in b/requirements.in index e6248872..efba74c3 100644 --- a/requirements.in +++ b/requirements.in @@ -4,3 +4,4 @@ mkdocs-macros-plugin mkdocs-redirects ruamel.yaml faqtory +mkdocs-open-in-new-tab diff --git a/requirements.txt b/requirements.txt index a93754bf..7b2a891f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -40,7 +40,6 @@ idna==3.7 # via requests jinja2==3.1.4 # via - # -r requirements.in # faqtory # mkdocs # mkdocs-macros-plugin @@ -64,6 +63,7 @@ mkdocs==1.6.0 # via # mkdocs-macros-plugin # mkdocs-material + # mkdocs-open-in-new-tab # mkdocs-redirects # mkdocs-rss-plugin mkdocs-get-deps==0.2.0 @@ -74,6 +74,8 @@ mkdocs-material==9.5.21 # via -r requirements.in mkdocs-material-extensions==1.3.1 # via mkdocs-material +mkdocs-open-in-new-tab==1.0.3 + # via -r requirements.in mkdocs-redirects==1.2.1 # via -r requirements.in mkdocs-rss-plugin==1.12.2 diff --git a/templates/beps_table_md.jinja b/templates/beps_table_md.jinja index d7bdc4ea..eefa6e03 100644 --- a/templates/beps_table_md.jinja +++ b/templates/beps_table_md.jinja @@ -9,5 +9,5 @@ | :--------: | :---- | :----- | :----- | :---------- | {% endif %} {% for bep in include %} -| [BEP {{ bep.number }}]({{ bep.link }}){:target="_blank"} | {% 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.name }}](mailto:{{ person.email }}) {% else %} {{ person.name }} {% endif %}
{% endfor %} | {% for item in bep.status %} - {{ item }}
{% endfor %} | +| [BEP {{ bep.number }}]({{ bep.link }}) | {% 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.name }}](mailto:{{ person.email }}) {% else %} {{ person.name }} {% endif %}
{% endfor %} | {% for item in bep.status %} - {{ item }}
{% endfor %} | {% endfor %} diff --git a/tools/convert_posts.py b/tools/convert_posts.py index 4e812886..cb8cc2e9 100644 --- a/tools/convert_posts.py +++ b/tools/convert_posts.py @@ -31,10 +31,7 @@ # for line in content: # if frontmatter_done: - # f.write( - # line.replace('{:target:"_blank"}', "").replace( - # '{:target="_blank"}', "" - # ) + # f.write(line) # ) # continue