Skip to content

Commit 05c127e

Browse files
authored
Merge pull request #439 from jo-mueller/more-contribution-help
More help for contributing
2 parents 4978403 + db33884 commit 05c127e

3 files changed

Lines changed: 214 additions & 45 deletions

File tree

contributing/index.md

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,13 @@
33
Thanks for taking the time to contribute to the `OME-Zarr` specification!
44
We welcome contributions from anyone.
55

6-
The below sections explain how to contributed in different ways to the
7-
`OME-Zarr` specification.
6+
Below you find links and guidelines on how to contribute to specific parts of the NGFF project.
87

9-
## Changes to the specification
10-
11-
Any suggested major changes to the `OME-Zarr` specification should be opened as
12-
request for comment (RFC) documents.
13-
14-
In the future we will flesh out this page with a guide to RFCs, but in the
15-
meantime the RFC process is outlined in the
16-
[Implementation section of RFC 1](../rfc/1/index.md#implementation).
17-
18-
### Comment on a Request For Comment (RFC)
19-
20-
If you want to leave a suggestion or comment on an RFC that is under review,
21-
please leave a comment in a new page under the "comments/" directory for the
22-
relevant RFC. A template is also available for formatting your comment:
23-
[template](../rfc/1/templates/review_template).
24-
25-
### How to change the specification
26-
27-
To make a change such as the end-product of an RFC or a minor correction to the currently developed specification version,
28-
please do so via a pull request (PR) against the `main` branch of the [ome/ngff-spec](https://github.com/ome/ngff-spec) repository.
29-
This repository contains the specification documents in Markdown format,
30-
json examples and the schema files for validation.
31-
32-
## Changes to this website
33-
34-
The repository for this website is [ome/ngff](https://github.com/ome/ngff).
35-
Contributions to these pages are welcome as issues or PRs.
36-
37-
To do so, create a fork of the ``ome/ngff`` repository, make your changes,
38-
and submit a pull request (PR) against the `main` branch.
39-
40-
### Syntax
41-
This repository uses Sphinx to publish a ReadTheDocs site at https://ngff.openmicroscopy.org in the [Sphinx Book Theme](https://sphinx-book-theme.readthedocs.io/en/stable/).
42-
43-
[MyST](https://myst-parser.readthedocs.io/en/latest/) syntax can be used in addition to basic Markdown and HTML.
44-
45-
### Configuration
46-
Edit [conf.py](./conf.py) with options from the [Sphinx Book Theme](https://sphinx-book-theme.readthedocs.io/en/stable/). The [PyData Sphinx Theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide) user guide may also have more up to date instructions for configuration properties.
47-
48-
### Previews
49-
Each PR receives a unique preview URL of the format `https://ngff--<PR#>.org.readthedocs.build/` where `<PR#>` is the PR number. This link is also posted to each PR by the Github actions bot in an "Automated Review URLs" comment as the "Readthedocs" link.
50-
51-
Please check that your changes render correctly at this URL. New commits will automatically be live at the PR url after a few minutes.
8+
```{toctree}
9+
:maxdepth: 1
10+
:glob:
11+
*/index
12+
```
5213

5314
## Contributing to OME
5415
(contributing:ome)=
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Changes to the specification
2+
(contributing:spec)=
3+
4+
Any suggested major changes to the `OME-Zarr` specification should be opened as
5+
request for comment (RFC) documents.
6+
7+
In the future we will flesh out this page with a guide to RFCs, but in the
8+
meantime the RFC process is outlined in the
9+
[Implementation section of RFC 1](../rfc/1/index.md#implementation).
10+
11+
## Comment on a Request For Comment (RFC)
12+
13+
If you want to leave a suggestion or comment on an RFC that is under review,
14+
please leave a comment in a new page under the "comments/" directory for the
15+
relevant RFC. A template is also available for formatting your comment:
16+
[template](../rfc/1/templates/review_template).
17+
18+
## How to change the specification
19+
20+
To make a change such as the end-product of an RFC or a minor correction to the currently developed specification version,
21+
please do so via a pull request (PR) against the `main` branch of the [ome/ngff-spec](https://github.com/ome/ngff-spec) repository.
22+
Such a PR can contain a change of any of the following components of the ngff-spec repo:
23+
24+
- The spec text itself (`ngff-spec/index.md`)
25+
- The schemas (`ngff-spec/schemas/`)
26+
- Example json metadata (`ngff-spec/examples/`)
27+
28+
## Author guidelines
29+
30+
This repository uses Sphinx to publish a ReadTheDocs site at https://ngff.openmicroscopy.org in the [Pydata Theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/).
31+
[MyST](https://myst-parser.readthedocs.io/en/latest/) syntax can be used in addition to basic Markdown and HTML.
32+
33+
Many flavors of markdown exist. I.e., the ngff-spec page uses [Jupyter Book](https://jupyterbook.org) and the ngff website (this page) uses [Sphinx](https://www.sphinx-doc.org/en/master/).
34+
To make sure that all used markdown stylings and syntax styles are compatible,
35+
please find below a few guidelines for writing markdown in the [ngff-spec](https://github.com/ome/ngff-spec) repository.
36+
37+
```{note}
38+
Please don't let *I don't understand the markdown syntax* stop you from contributing!
39+
If you have a suggestion for a change to the website or specification but are not sure how to write it in markdown,
40+
please just write it in plain markdown and we can help you with the formatting.
41+
```
42+
43+
### Text format
44+
45+
Contributions should conform to [Semantic Line Breaks (SemBr)](https://sembr.org/),
46+
to improve change tracking.
47+
48+
### Referencing
49+
50+
The specification uses [MyST](https://mystmd.org) extensively for a number of formatting options
51+
to make the text readable and improve structure.
52+
53+
MyST allows a number of ways to reference and cross-reference inside this text
54+
and across several of the pages in this repo.
55+
For an overview of supported referencing syntax,
56+
see the [MyST doc pages](https://mystmd.org/guide/cross-references).
57+
It is recommended to use the following syntax in this document for consistency:
58+
59+
```markdown
60+
anchor: (your-reference-name)=
61+
reference: [This is a reference](#your-reference-name)
62+
```
63+
64+
This way, your cross-references will always resolve to the correct page,
65+
even if the location of the markdown file changes in the future.
66+
67+
For cross-referencing in the spec document,
68+
make sure to prepend the reference anchor with `versionX` like so:
69+
70+
```markdown
71+
## Some header
72+
(version0.9:some-header)=
73+
```
74+
75+
Otherwise, the same anchors may not be possible to resolve
76+
if multiple versions of the spec document are built and viewed together (i.e., the anchor `(ngff-spec: some_anchor)` may exist in multiple documents).
77+
78+
### Highlighting
79+
80+
If you refer to fields or values that would appear in JSON files,
81+
please use backticks to highlight them, like so:
82+
83+
```markdown
84+
The `multiscales` field contains an array of dictionaries.
85+
```
86+
87+
You may still use bold, italics or quotation marks for emphasis where appropriate,
88+
but please use backticks for JSON fields and values.
89+
90+
### Citations
91+
92+
ngff-spec relies on [sphinxcontrib-bibtex](https://pypi.org/project/sphinxcontrib-bibtex/) for citations.
93+
To add a citation to the text, add it as a bibtex entry in the `references.bib` file in the root of this repository.
94+
You can then cite it in the text using the following syntax:
95+
96+
```markdown
97+
This is a citation {cite:t}`citation_key`.
98+
```
99+
100+
where `citation_key` is the key of the bibtex entry in the `references.bib` file.
101+
102+
### Json examples
103+
104+
We suggest using [dropdowns](https://mystmd.org/guide/dropdowns-cards-and-tabs) for example code and other highlighting.
105+
For examples, please use the following syntax to wrap your examples:
106+
107+
`````markdown
108+
:::{dropdown} Example
109+
110+
Some informative text about your example
111+
```json
112+
"key": "value"
113+
```
114+
:::
115+
`````
116+
117+
which results in
118+
119+
:::{dropdown} Example
120+
121+
Some informative text about your example
122+
```json
123+
"key": "value"
124+
```
125+
:::
126+
127+
If you want to link in example metadata from somewhere in this repo (i.e, a json file),
128+
use this syntax:
129+
130+
`````markdown
131+
:::dropdown Example
132+
133+
Some informative text about your example
134+
```{literalinclude} path/to/example.json
135+
:language: json
136+
:linenos:
137+
:tab-width: 2
138+
```
139+
:::
140+
`````
141+
142+
Other useful admonitions and directives (e.g., `hint`, `note`) can be found [here](https://mystmd.org/guide/directives).
143+
144+
## Building *only* the spec document
145+
146+
The spec document under the [ngff-spec](github.com/ome/ngff-spec) repository can be built as a standalone document to make writing and rendering a smoother experience.
147+
To build the spec document, you first need to install the necessary dependencies:
148+
149+
After cloning the ngff-spec repo, navigate into the repository on your machine and install the dependencies using pip:
150+
151+
```bash
152+
cd path/to/ngff-spec
153+
pip install -e .
154+
```
155+
156+
This document uses [jupyter-book](https://jupyterbook.org) to generate the pages
157+
and [MyST](https://mystmd.org) markdown for formatting.
158+
After installing these via the dependencies,
159+
navigate into the repository on your machine and build the book using the following command:
160+
161+
```bash
162+
python pre_build.py
163+
jupyter book start
164+
```
165+
166+
This autogenerates some of the markdown files (examples, schemas) and starts a local server to view the book.

contributing/website/index.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Changes to this website
2+
3+
The repository for this website is [ome/ngff](https://github.com/ome/ngff).
4+
Contributions to these pages are welcome as issues or PRs.
5+
6+
To do so, create a fork of the ``ome/ngff`` repository, make your changes,
7+
and submit a pull request (PR) against the `main` branch.
8+
9+
## Configuration
10+
Edit [conf.py](https://github.com/ome/ngff/blob/main/conf.py) with options from the [PyData Theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/). The [PyData Sphinx Theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/index.html) user guide may also have more up to date instructions for configuration properties.
11+
12+
## Building the pages locally
13+
14+
Before submitting changes to the ngff website,
15+
please build the pages locally and make sure that everything renders correctly.
16+
17+
To do so, first install a few necessary (Python) dependencies:
18+
19+
```bash
20+
cd path/to/ngff/repo
21+
pip install -r requirements.txt
22+
pip install specifications/dev
23+
```
24+
25+
Then, you can build the pages locally with:
26+
27+
```bash
28+
make html
29+
```
30+
31+
or
32+
33+
```bash
34+
python conf.py
35+
```
36+
37+
You can then find the rendered pages under `_build/html/index.html`.
38+
39+
## Previews
40+
Each PR receives a unique preview URL of the format `https://ngff--<PR#>.org.readthedocs.build/` where `<PR#>` is the PR number. This link is also posted to each PR by the Github actions bot in an "Automated Review URLs" comment as the "Readthedocs" link.
41+
42+
Please check that your changes render correctly at this URL. New commits will automatically be live at the PR url after a few minutes.

0 commit comments

Comments
 (0)