Skip to content

Commit aaad29e

Browse files
committed
work on contributing guide
remove links to unfinished pages
1 parent d9a7dc3 commit aaad29e

File tree

13 files changed

+774
-227
lines changed

13 files changed

+774
-227
lines changed

content/contributing/docs.md

Lines changed: 90 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,98 @@
11
# Contribute to Documentation
22

3-
We use [Sphinx][] and [ReStructuredText][] to write the documentation.
3+
We use [Sphinx] to build the documentation. Historically, this has used
4+
[reStructuredText] `.rst` as the syntax. You may see some pages written in
5+
[Markdown] `.md` if the `myst-parser` dependency has been added to
6+
the project. Docstrings in code must always use rST.
7+
8+
[Sphinx]: https://sphinx-doc.org
9+
[reStructuredText]: https://docutils.sourceforge.io/rst.html
10+
[Markdown]: https://commonmark.org
11+
12+
## Work on the `stable` Branch
13+
14+
**If you are fixing or improving existing docs, or writing about existing
15+
features, you want to branch off of the `stable` branch, as well as target the
16+
`stable` branch in the PR.**
17+
18+
If you use GitHub's UI to quickly edit a file, remember to select the `stable`
19+
branch from the dropdown first. Otherwise, you'll end up submitting the fix
20+
against `main`, and a maintainer will have to do extra work to retarget it.
21+
22+
Changes to `stable` docs will show up within minutes of being merged. Changes to
23+
`main` will be unavailable until the next feature release. You'll rarely want to
24+
work off of `main` for docs, unless you're working on docs for a new unreleased
25+
feature.
26+
27+
## Building Docs
428

529
To build the docs locally, run `tox r -e docs`. To serve the docs locally, run
630
`python -m http.server docs/_build/dirhtml`. Then go to <https://localhost:8000>
731
in your browser to view the docs.
832

9-
Documentation is hosted by Read the Docs. They are built and deployed for any
10-
changes to the `main` and `A.B.x` feature branches. Each PR also generates a
11-
test build.
33+
Documentation is hosted by Read the Docs. It is deployed on every change to the
34+
`stable` branch. Each PR also generates a test build, which can be viewed by
35+
clicking the "readthedocs" build check in the PR.
1236

13-
[Sphinx]: https://sphinx-doc.org
14-
[reStructuredText]: https://docutils.sourceforge.io/rst.html
37+
## Writing Docs
38+
39+
Writing about how to write documentation is surprisingly hard! We generally like
40+
the ideas presented in [Diátaxis], which is a way of thinking about and doing
41+
documentation.
42+
43+
[Diátaxis]: https://diataxis.fr
44+
45+
It can be very hard to assess whether a change is _better_ rather than only
46+
_different_. Keep this in mind when deciding if you want to change something. If
47+
a sentence is clear and understandable, even if you would say it differently,
48+
then it should probably be left as-is.
49+
50+
The most common type of docs contribution is a typo fix. Check if the typo
51+
happened in multiple places, and fix it everywhere. Don't submit typo fixes to
52+
code comments that aren't visible in the deployed docs, unless you're also
53+
working on that code. If you find multiple different typos, you can fix them in
54+
separate commits to one PR, rather than multiple PRs. Make sure the typo is
55+
really a typo, and not a correct sentence with a different meaning.
56+
57+
The libraries' docs have been written by many people over more than a decade.
58+
This has introduced inconsistencies in style, focus, and technical level across
59+
different parts of documentation over time. We recognize that there are many
60+
ways in which documentation can be rewritten and improved. However, avoid huge
61+
rewrites unless you have already checked with maintainers. If you're changing
62+
more than a few sentences of text, and haven't received prior approval, you're
63+
probably doing too much at once. It is very hard to review such changes,
64+
especially from unknown users who we have not established trust with.
65+
66+
### Style, Spelling, and Grammar
67+
68+
Avoid referring to "you" or "we" outside of tutorials. State things directly;
69+
"to do X, use Y" rather than "if you want to do X, then you should use Y."
70+
71+
Avoid phrases that might imply something is implicitly easy, such as "just do X"
72+
or "the reason is obviously Y". Users are coming to the docs because something
73+
wasn't obvious or easy for them at that moment.
74+
75+
The documentation is in English. If you are not a native English speaker, that's
76+
OK, learners often catch issues that native speakers overlook. However, if a
77+
maintainer would have to alter a significant portion of your PR, that's not a
78+
great use of time. We also have a translation project, explained in the next
79+
section.
80+
81+
Prefer [American spelling]. Use the [serial comma]; ("a, b, and c" rather than
82+
"a, b and c"). That said, do not create a PR that tries to make everything
83+
consistent, it's ok that existing docs use alternate spellings.
84+
85+
[American spelling]: https://www.oxfordinternationalenglish.com/differences-in-british-and-american-spelling/
86+
[serial comma]: https://www.grammarly.com/blog/punctuation-capitalization/what-is-the-oxford-comma/
87+
88+
## Translating Docs
89+
90+
Currently, the community is working on translating Flask's documentation. We may
91+
add other projects in the future.
92+
93+
You can find the translation project and instructions on how to contribute here:
94+
<https://github.com/pallets-eco/flask-docs-translations>. We use [Weblate] to
95+
manage translations. You'll need an account there. Then you can use the UI to navigate
96+
to a language and find strings to translate.
97+
98+
[Weblate]: https://weblate.org

content/contributing/features.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
11
# Request a Feature
2+
3+
If you feel that one of our libraries is missing something, you should request
4+
a new feature for it on the GitHub Issues tab. For example, Flask's is here:
5+
<https://github.com/pallets/flask/issues/>.
6+
7+
The bar for accepting new features into many of our libraries is high. Our
8+
general philosophy is to provide a solid base framework that other libraries can
9+
extend, rather than blessing specific implementations in the core library. A
10+
feature request may be more successful if:
11+
12+
- If it's not possible to implement as an extension without changes to the
13+
core.
14+
- If there is one "correct" way to implement something.
15+
- If the request is similar to or complements existing behavior.
16+
17+
Before requesting a feature, try to determine if it has already been requested
18+
or implemented. Search existing issues and PRs, including closed issues and
19+
merged PRs. Requests that were previously rejected are likely to be rejected
20+
again unless (or even if) significant new reasoning is presented.
21+
22+
Click the green "New issue" button at the top right to start. Include the
23+
following information in your post:
24+
25+
- Write a short, descriptive title.
26+
- Do not include prefixes such as "\[feature]"; maintainers will apply
27+
real tags as needed.
28+
- Describe what the feature should do.
29+
- Include details such as links to relevant specs or previous discussions.
30+
- Provide an example of a problem this feature would resolve. Consider if this
31+
is problem solvable without changes to the library, such as by subclassing
32+
or using an extension.

content/contributing/index.md

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,76 +6,87 @@ contribute to an open source project, see the next section for more ideas.
66
If you would like to ask a question or open an issue or feature request, see
77
these guides:
88

9-
1. [Ask a Question](questions.md)
10-
2. [Report an Issue](issues.md)
11-
* [Report a **Security** Issue](../security.md)
12-
3. [Request a Feature](features.md)
9+
- [Ask a Question](questions.md), which also covers how to contribute by
10+
answering questions.
11+
- [Report an Issue](issues.md)
12+
- [Report a **Security** Issue](../security.md)
13+
- [Request a Feature](features.md)
1314

1415
If you would like to fix an issue or implement a feature, see these guides:
1516

16-
1. [Start Here: Development Environment Setup](setup.md)
17-
2. [Create a Pull Request](pr.md)
18-
3. [Edit and Build Documentation](docs.md)
19-
4. [Write and Run Tests](tests.md)
17+
- [Quick Reference](quick.md) If you're already familiar with contributing,
18+
this provides an essential overview of the following guides.
19+
- Start Here: Detailed Development Environment Setup - Coming Soon
20+
- [Create a Pull Request](pr.md)
21+
- Write and Run Tests - Coming Soon
22+
- Static Type Checks - Coming Soon
23+
- [Edit and Build Documentation](docs.md)
24+
- Changelog Style - Coming Soon
25+
- Linting and Formatting - Coming Soon
2026

2127
If you're getting more involved as a community or team member, see these guides:
2228

23-
* [Triaging Issues](triage.md) covers many of the things the team looks for in
24-
good issue reports and requests.
25-
* [Environment](environment.md) gives an overview of the tools we use.
29+
- [Triaging Issues](triage.md) covers many of the things the team looks for in
30+
good issue reports and requests.
31+
- Reviewing and Merging PRs - Coming Soon
32+
- Project Layout - Coming Soon, explains our standard project structure, tools,
33+
and configurations.
34+
- Git Techniques - Coming Soon, talks about various git behaviors and commands.
35+
- [Making a Release](release.md)
2636

2737
You can also support us by [making a donation](../donate.md).
2838

2939
## What to Work On
3040

3141
Anyone is welcome to work on any open ticket in any project's issue tracker,
32-
no need to ask first. Before starting, check if anyone else is assigned to the
42+
without asking first. Before starting, check if anyone else is assigned to the
3343
issue, or if there are any linked open pull requests. Look through the issue for
3444
that information as well as discussion and other linked issues for context.
3545

36-
Besides the core Pallets projects, there is an entire [ecosystem][] of
37-
extensions built on top of them. We also have our own dependencies that we use
38-
for our [development environment][]. Improving the ecosystem we're part of is a
39-
great way to contribute to Pallets.
46+
Besides the core Pallets projects, there is an entire [ecosystem] of extensions
47+
built on top of them. We also have our own dependencies that we use for our
48+
[development environment]. Improving the ecosystem we're part of is a great way
49+
to contribute to Pallets.
4050

4151
[ecosystem]: ../ecosystem.md
42-
[development environment]: environment.md
52+
[development environment]: layout
4353

4454
Writing code is not the only way to contribute to an open source project. Other
4555
activities are just as helpful. Some ideas that are too broad for individual
4656
issues include:
4757

48-
* Improve this contributing guide!
49-
* Improve documentation.
50-
* Identify common and popular questions from Stack Overflow. We want users
51-
to find official information from our documentation first. Perhaps we need
52-
a new page for a topic, or need to mention a specific error message.
53-
* Add or improve translations. We also want to improve the workflow around
54-
updating and publishing translations.
55-
* Our documentation is extensive, but it's been written over a long period
56-
of time by many people. It could use the attention of people with
57-
technical writing and editing skills.
58-
* Improve how tests are organized and written to use modern pytest idioms.
59-
* Some files have grown very large, or tests are not grouped well, or still
60-
use `unittest` idioms. Perhaps tests can be split into more files, or use
61-
pytest's parametrization feature.
62-
* Improve test coverage by adding tests for lines and branches that are
63-
not covered.
64-
* Improve static type annotations. We target mypy primarily, but would also like
65-
to improve compatibility with pyright. We also want to ensure we are using
66-
types correctly, and add tests.
67-
* Answer questions on GitHub Discussions and our Discord chat server.
68-
Referencing canonical sources and providing explanation beyond the immediate
69-
answer creates resources for others to find later and enables them to answer
70-
in turn.
58+
- Improve this contributing guide!
59+
- Improve documentation.
60+
- Identify common and popular questions from Stack Overflow. We want users
61+
to find official information from our documentation first. Perhaps we
62+
need a new page for a topic, or need to mention a specific error
63+
message.
64+
- Add or improve translations. We also want to improve the workflow around
65+
updating and publishing translations.
66+
- Our documentation is extensive, but it's been written over a long period
67+
of time by many people. It could use the attention of people with
68+
technical writing and editing skills.
69+
- Improve how tests are organized and written to use modern pytest idioms.
70+
- Some files have grown very large, or tests are not grouped well, or
71+
still use `unittest` idioms. Perhaps tests can be split into more files,
72+
or use pytest's parametrization feature.
73+
- Improve test coverage by adding tests for lines and branches that are
74+
not covered.
75+
- Improve static type annotations. We target mypy primarily, but would also
76+
like to improve compatibility with pyright. We also want to ensure we are
77+
using types correctly, and add tests.
78+
- Answer questions on GitHub Discussions and our Discord chat server.
79+
Referencing canonical sources and providing explanation beyond the immediate
80+
answer creates resources for others to find later and enables them to answer
81+
in turn.
7182

7283
## Get Help Contributing
7384

74-
If you need help with the contributing process, or want to discuss an issue or
75-
pull request you're working on, you can use the project-specific channels on
76-
our Discord chat server: https://discord.gg/pallets.
85+
If you need help with the contributing process beyond the guides here, or want
86+
to discuss an issue or pull request you're working on, use the `#contributing`
87+
channel on our Discord chat server: <https://discord.gg/pallets>.
7788

78-
You can also use comments on the issue or pull request. After getting help or
89+
You can also write comments on the issue or pull request. After getting help or
7990
researching about an issue, it's helpful to leave a comment there in order to
8091
keep public notes or help the next contributor.
8192

content/contributing/issues.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
# Report an Issue
22

3-
Include the following information in your post:
3+
If you encounter an unexpected issue when using our libraries, you should report
4+
it on the GitHub Issues tab. For example, Flask's is here:
5+
<https://github.com/pallets/flask/issues/>.
46

5-
- Describe what you expected to happen.
6-
- Include a [minimal reproducible example][] to help us identify the issue. This
7-
also helps check that the issue is not with your own code.
8-
- Describe what actually happened. Include the full traceback if there was an exception.
9-
- List the version of Python and the Pallets library you're using. Check if this
10-
issue is already fixed in the latest release or the latest code in the repository.
7+
If you have questions about your own code or how to use the libraries, read
8+
[how to ask questions](questions.md). Don't use the issue tracker to ask
9+
questions.
1110

12-
[minimal reproducible example]: https://stackoverflow.com/help/minimal-reproducible-example
11+
Before reporting an issue, try to determine if it has already been reported or
12+
fixed. Search existing issues and PRs, including closed issues and merged PRs.
13+
Search for similar phrases, code, and errors. Check that you're using the latest
14+
release.
15+
16+
You don't need to report typos in documentation, unless you're unsure. Instead,
17+
submitting a PR would probably be faster. This is _only_ the case for typos, for
18+
everything else open an issue.
19+
20+
Click the green "New issue" button at the top right to start. Include the
21+
following information in your post:
22+
23+
- Write a short, descriptive title.
24+
- Do not include prefixes such as "\[bug]" or "\[docs]"; maintainers will
25+
apply real tags as needed.
26+
- Do not include a version number in the title.
27+
- Describe what you expected to happen.
28+
- Include a [minimal reproducible example] to help us identify the issue. This
29+
also helps check that the issue is not with your own code.
30+
- Describe what actually happened. Include the full traceback if there was an
31+
exception.
32+
- List the version of Python and the project you're using. Check if this issue
33+
is already fixed in the latest release, or in `stable` or `main`.
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
Every project uses the same project layout and tools. It is helpful to be aware
44
of them and their documentation when contributing.
55

6+
Keeping every project consistent makes it easy for people to move between
7+
projects. The more a project begins to diverge, the more likely it is to
8+
cause an issue at an inopportune time. If something here is changed in one
9+
project, it should be applied to all others as well.
10+
611
## Requirements Files
712

8-
Each development environment uses a requirements file and the [pip-tools][] and
9-
[pip-compile-multi][] tools to pin versions. This ensures that tests and builds
13+
Each development environment uses a requirements file and the [pip-tools] and
14+
[pip-compile-multi] tools to pin versions. This ensures that tests and builds
1015
are reproducible when setting up a new environment or looking at previous tags.
1116

1217
The `requirements` folder contains `.in` files that list the direct, unpinned
@@ -20,16 +25,16 @@ We do not use Dependabot to update these files as it is too noisy.
2025

2126
## Tests
2227

23-
[pytest][] is used to run the tests, found in the `tests` folder.
28+
[pytest] is used to run the tests, found in the `tests` folder.
2429

25-
[tox][] is used to run different test environments, including Python versions,
30+
[tox] is used to run different test environments, including Python versions,
2631
style checks, documentation, and typing. The `tox.ini` file configures this.
2732

28-
We do not currently run [coverage][]. While our test suite is fairly robust,
33+
We do not currently run [coverage]. While our test suite is fairly robust,
2934
we don't have consistent enough coverage to make the reports useful at this
3035
time. We found that it does not impact our release quality.
3136

32-
[mypy][] is used for static type checking. Other tools may not give the same
37+
[mypy] is used for static type checking. Other tools may not give the same
3338
results.
3439

3540
See [here](tests.md) for information about writing, running, and improving
@@ -42,12 +47,12 @@ tests and test coverage.
4247

4348
## Documentation
4449

45-
[Sphinx][] is used to build the documentation. The `docs` folder contains `.rst`
46-
files, which are [ReStructuredText][].
50+
[Sphinx] is used to build the documentation. The `docs` folder contains `.rst`
51+
files, which are [ReStructuredText].
4752

48-
[Pallets-Sphinx-Themes][] contains the designs and extensions the projects use.
53+
[Pallets-Sphinx-Themes] contains the designs and extensions the projects use.
4954

50-
The docs are built and hosted on [Read the Docs][]. It will also check that the
55+
The docs are built and hosted on [Read the Docs]. It will also check that the
5156
docs build for pull requests.
5257

5358
See [here](docs.md) for information about writing and building documentation.
@@ -58,21 +63,21 @@ See [here](docs.md) for information about writing and building documentation.
5863

5964
## Code Style
6065

61-
Code style tools are run automatically on each commit using [pre-commit][].
66+
Code style tools are run automatically on each commit using [pre-commit].
6267
The `.pre-commit-config.yaml` file pins the versions of each tool.
63-
[pre-commit.ci][] runs these checks and commits fixes automatically on pull
68+
[pre-commit.ci] runs these checks and commits fixes automatically on pull
6469
requests. It will also make PRs to update the pinned versions each month.
6570

6671
See [setup](setup.md) for how to enable pre-commit.
6772

68-
[black][] enforces code formatting.
73+
[black] enforces code formatting.
6974

70-
[flake8][] enforces style "lint" rules. [flake8-bugbear][] catches more
75+
[flake8] enforces style "lint" rules. [flake8-bugbear] catches more
7176
opinionated rules.
7277

73-
[pyupgrade][] enforces using modern syntax for the Python versions we support.
78+
[pyupgrade] enforces using modern syntax for the Python versions we support.
7479

75-
[reorder_python_imports][] enforces a standard format and order for all imports
80+
[reorder_python_imports] enforces a standard format and order for all imports
7681
at the top of files.
7782

7883
[pre-commit]: https://pre-commit.com

0 commit comments

Comments
 (0)