OpenNeuroOrg / openneuro

A free and open platform for analyzing and sharing neuroimaging data
https://openneuro.org/
MIT License
113 stars 40 forks source link

Support README with extensions #2721

Open effigies opened 1 year ago

effigies commented 1 year ago

Is your feature request related to a problem? Please describe.

BIDS states:

A REQUIRED text file, README, SHOULD describe the dataset in more detail. The README file MUST be either in ASCII or UTF-8 encoding and MAY have one of the extensions: .md (Markdown), .rst (reStructuredText), or .txt.

Currently OpenNeuro only recognizes READMEs at /README, so README.txt does not get rendered. Note also that a number of README.txt files are not written in Markdown, so rendering can lead to some ugly results when people use hash marks in a way inconsistent with Markdown headers.

Describe the solution you'd like

Detect the extension and use an appropriate renderer. Allow in-line editing to modify the discovered file, and not always README.

Filename Renderer
README / README.md Markdown
README.txt / README.rst <pre></pre>

Describe alternatives you've considered

Probably fine to skip README.rst. It doesn't look like there's a maintained Javascript implementation of RST, and it may not be worth calling out to Python just to get a tiny corner case.

nellh commented 1 year ago

Probably fine to skip README.rst. It doesn't look like there's a maintained Javascript implementation of RST, and it may not be worth calling out to Python just to get a tiny corner case.

We can only really display the raw file for RST since this is rendered in browser.

effigies commented 1 year ago

Edited to propose putting both .txt and .rst in <pre> tags.