Skip to content

Commit 38335f6

Browse files
authored
Merge pull request #88 from effigies/doc/round-2
doc: Round 2
2 parents dbf83e5 + f518eca commit 38335f6

File tree

8 files changed

+61
-54
lines changed

8 files changed

+61
-54
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -94,61 +94,13 @@ consider:
9494
`upstream` refers to the original BIDS validator repository on GitHub
9595
- you can use `upstream` to always stay up to date with changes that are
9696
being made on the original BIDS validator. For that, simply navigate to
97-
the `master` branch of **your** repository using `git checkout master`,
98-
and then run `git pull upstream master`
97+
the `main` branch of **your** repository using `git checkout main`,
98+
and then run `git pull upstream main`
9999
1. When you get completely stuck with your repository and you just want to
100100
reset it to be an exact mirror of the original BIDS validator, you can
101101
run the following command (Note: this will discard all current changes):
102-
- first checkout your master: `git checkout master`
103-
- then run: `git reset --hard upstream/master`
104-
105-
## Extending the BIDS validator for a BIDS Extension Proposal (BEP)
106-
107-
### Regular expressions
108-
109-
A lot of validation of BIDS files and directories is happening through
110-
[regular expressions](https://en.wikipedia.org/wiki/Regular_expression).
111-
You can see the regular expressions
112-
[here](https://github.com/bids-standard/bids-validator/tree/master/bids-validator/bids_validator/rules).
113-
114-
Changing the regular expressions can be a delicate thing, so we recommend
115-
testing your regular expressions exhaustively. A helpful website for that can
116-
be [https://regex101.com/](https://regex101.com/), where you can test regular
117-
expressions in your browser, and even save and share them.
118-
119-
### JSON schemas
120-
121-
Another big chunk of BIDS validation is happening through [JSON schemas](https://json-schema.org/).
122-
In BIDS, a lot of metadata is saved in JSON files, which are very well defined
123-
and readable by a computer. With these properties, we can make requirements of
124-
how a JSON ought to look like. You can find our JSON schemas
125-
[here](https://github.com/bids-standard/bids-validator/tree/master/bids-validator/validators/json/schemas).
126-
127-
As with regular expressions, we recommend lots of testing on the JSON schemas.
128-
You can easily have a first try of that using a website like
129-
[https://www.jsonschemavalidator.net/](https://www.jsonschemavalidator.net/).
130-
Simply copy over a schema from BIDS validator to the left field, and try to
131-
comply to the schema, or trigger an error by typing in a JSON to the right
132-
field.
133-
134-
### Writing tests
135-
136-
For every change you make it is important to include a test. That way, we can
137-
make sure that the behavior of BIDS validator is as expected, and furthermore
138-
we will be notified whenever a contributor makes a change in the code that
139-
breaks the expected behavior of the BIDS validator.
140-
141-
A test usually provides some known data, and let's the software run over it ...
142-
just to check whether the output is as we know it should be (because we know
143-
the data, after all).
144-
145-
You can get a good impression using the following links:
146-
147-
- [How regular expressions are tested](https://github.com/bids-standard/bids-validator/blob/master/bids-validator/tests/type.spec.js)
148-
- [How JSON schemas are tested](https://github.com/bids-standard/bids-validator/blob/master/bids-validator/tests/json.spec.js)
149-
- [How TSV files are tested](https://github.com/bids-standard/bids-validator/blob/master/bids-validator/tests/tsv.spec.js)
150-
151-
For more information on how to run the tests check the [testing section](./README.md#testing) of the README.
102+
- first checkout your main: `git checkout main`
103+
- then run: `git reset --hard upstream/main`
152104

153105
[link_git]: https://git-scm.com/
154106
[link_handbook]: https://guides.github.com/introduction/git-handbook/
45.9 KB
Loading
46.3 KB
Loading
43.5 KB
Loading
44.6 KB
Loading

docs/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@
3636
"text": "The BIDS Validator",
3737
"image_light": "_static/BIDS_logo_black.svg",
3838
"image_dark": "_static/BIDS_logo_white.svg",
39-
}
39+
},
40+
"repository_url": "https://github.com/bids-standard/bids-validator",
41+
"path_to_docs": "docs",
42+
"use_source_button": True,
43+
"use_edit_page_button": True,
44+
"use_repository_button": True,
45+
"use_issues_button": True,
4046
}
4147

4248
# -- Customization

docs/user_guide/command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bids-validator <dataset>
6464
| `--ignoreNiftiHeaders` | Do not open NIfTI files, skipping any checks that rely on NIfTI header data |
6565
| `--filenameMode` | Perform filename checks only on newline-separated filenames read from [stdin] |
6666
| `--blacklistModalities MOD...` | Raise error if passed modalities are detected in the dataset. Modalities may be any of `mri`, `eeg`, `ieeg`, `meg`, `beh`, `pet`, `micr`, `motion`, `nirs`, or `mrs`. |
67-
| `--debug LEVEL` | Enable logging at the specified level. Default level is `ERROR`. Levels include (from most to least verbose): `NOTSET`, `DEBUG`, `INFO`, WARN`, `ERROR`, `CRITICAL`. |
67+
| `--debug LEVEL` | Enable logging at the specified level. Default level is `ERROR`. Levels include (from most to least verbose): `NOTSET`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `CRITICAL`. |
6868
| `--color`, `--no-color` | Enable/disable color. The validator also respects the [NO_COLOR] and [FORCE_COLOR] environment variables. |
6969

7070
## Configuration file

docs/user_guide/web.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
11
# Using the web validator
2+
3+
The web validator is the primary interface to the validator,
4+
hosted at <https://bids-standard.github.io/bids-validator/>
5+
6+
![The web interface to the BIDS Validator with the "Select Dataset Files" button highlighted.
7+
(Dark theme)](../_static/web_entrypoint_dark.png){.only-dark .no-scaled-link width="50%" align=center}
8+
![The web interface to the BIDS Validator with the "Select Dataset Files" button highlighted.
9+
(Light theme)](../_static/web_entrypoint_light.png){.only-light .no-scaled-link width="50%" align=center}
10+
11+
To validate a dataset, click the "Select Dataset Files" and select a directory to validate.
12+
The directory must contain a `dataset_description.json` to be identified as a BIDS dataset.
13+
14+
When you select a directory, you will get a permission prompt,
15+
verifying that you want to provide access to the directory.
16+
17+
::::{tab-set}
18+
19+
:::{tab-item} Firefox permission prompt
20+
21+
![The Firefox permissions prompt (Dark theme)](../_static/firefox_permissions_dark.png){.only-dark width="50%" align=center}
22+
![The Firefox permissions prompt (Light theme)](../_static/firefox_permissions_light.png){.only-light width="50%" align=center}
23+
24+
:::
25+
:::{tab-item} Chrome permission prompt
26+
:sync: install
27+
28+
![The Chromium permissions notice (Dark theme)](../_static/chromium_permissions_dark.png){.only-dark width="50%" align=center}
29+
![The Chromium permissions notice (Light theme)](../_static/chromium_permissions_light.png){.only-light width="50%" align=center}
30+
31+
:::
32+
::::
33+
34+
At present (November 2024), Firefox browsers present the request to "Upload" data,
35+
while Chromium-based browsers (Google Chrome, Microsoft Edge, and others) request permission
36+
to "view files".
37+
In both cases, confirming allows the Javascript application to read the files and perform validation,
38+
but those files are never sent to a remote server.
39+
40+
## The Legacy Validator
41+
42+
The current BIDS Validator is a complete rewrite of the original BIDS Validator,
43+
based on the [BIDS Schema].
44+
The original validator, now called the "legacy validator", can be found at
45+
<https://bids-standard.github.io/legacy-validator/>.
46+
47+
It is not recommended to use this validator, as it will become increasingly out-of-date,
48+
but it may be useful for comparative purposes.
49+
50+
[BIDS Schema]: https://bidsschematools.readthedocs.io

0 commit comments

Comments
 (0)