Skip to content

Commit 3f33049

Browse files
kattnifreakboy3742brutusthebeedependabot[bot]HalfWhitt
authored
Contribution guide consolidation (#94)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Russell Keith-Magee <[email protected]> Co-authored-by: Brutus the Bee <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Whittington <[email protected]>
1 parent eba4fab commit 3f33049

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2637
-180
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
args: [ --fix ]
1717
- id: ruff-format
1818
- repo: https://github.com/rvben/rumdl-pre-commit
19-
rev: v0.0.190
19+
rev: v0.0.192
2020
hooks:
2121
- id: rumdl
22-
args: [--force-exclude]
22+
args: []

.pyspelling.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ matrix:
3434
- open: '{%'
3535
content: '[\d\D]*'
3636
close: '%}'
37+
# Ignores the Jinja variables and their contents
38+
- open: '{{'
39+
content: '[\d\D]*'
40+
close: '}}'
41+
# Ignores the autorefs link targets
42+
- open: '\]\['
43+
content: '[\d\D]*'
44+
close: '\]'
3745
# Ignore the mkdocstrings calls
3846
- open: ':::'
3947
content: '[\d\D]*'

.rumdl.toml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
[global]
22
flavor = "mkdocs"
33
include = ["**/*.md"]
4-
exclude = ["docs/en/content_test_bed/*_include.md", "docs/en/SUMMARY.md"]
4+
exclude = ["docs/en/SUMMARY.md", "comment.md"]
55
respect-gitignore = true
66

77
# Disable rules:
8-
# MD013: Enforces line length
9-
# MD014: Forces commands in codeblocks to show output
10-
disable = ["MD013", "MD014",]
8+
# MD014: Force commands in codeblocks to show output
9+
disable = ["MD014"]
10+
11+
[per-file-ignores]
12+
# MD002: First heading should be level 1, found level 2; title will be included in the target page
13+
# MD034: URL without angle brackets or link formatting; triggers on URLs with Jinja variable included
14+
# MD041: First line in file should be level 1 heading; title will be included in the target page
15+
"src/beeware_docs_tools/shared_content/en/*.md" = ["MD002", "MD034", "MD041",]
16+
17+
[MD013] # Line length
18+
line_length = 999999 # Force reflow to paragraph content to remove linebreaks
19+
reflow = true
20+
reflow_mode = "normalize"
21+
22+
[MD026] # Remove punctuation at the end of headings
23+
punctuation = ",;:"
1124

1225
[MD033] # No inline HTML
1326
allowed_elements = ["nospell",] # pyspelling inline disable tag
27+
28+
[MD061]
29+
terms = ["TODO"]

README.md

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@ Tools for building BeeWare's documentation with a common theme and translations.
44

55
## Adding a new language
66

7-
Weblate is able to generate a new language, however, adding a new language
8-
also requires a few changes to the documentation repository.
7+
Weblate is able to generate a new language, however, adding a new language also requires a few changes to the documentation repository.
98

10-
Once a new language is generated, you'll need to add a new
11-
`mkdocs.<language-code>.yml` file and update the `tox.ini` file.
9+
Once a new language is generated, you'll need to add a new `mkdocs.<language-code>.yml` file and update the `tox.ini` file.
1210

13-
The following example outlines how you would go about adding German to
14-
this repo. The concepts are the same for any language in any of the docs
15-
repos.
11+
The following example outlines how you would go about adding German to this repo. The concepts are the same for any language in any of the docs repos.
1612

1713
### The new MkDocs configuration file
1814

19-
The first thing to do is create a new file named `mkdocs.de.yml` in the
20-
`docs` directory, with the following content:
15+
The first thing to do is create a new file named `mkdocs.de.yml` in the `docs` directory, with the following content:
2116

2217
```yaml
2318
INHERIT: config.yml
@@ -36,30 +31,19 @@ Here's what is going on in this file:
3631
3732
* This file inherits the configuration content from `config.yml`.
3833
* The `site_name` value is translated.
39-
* The `site_url` value is the project site URL, followed by the language
40-
code.
34+
* The `site_url` value is the project site URL, followed by the language code.
4135
* The `docs_dir` should be the language code.
42-
* The `theme: language:` value should be the language code, as specified by the
43-
MkDocs Material theme. The list can be found
44-
[here](https://squidfunk.github.io/mkdocs-material/setup/changing-the-language/).
45-
For most languages, this will be the same as the `docs_dir` language code; but
46-
for some (in particular languages with locale variants like `zh_CN`), there are
47-
differences.
48-
* The `extra: translation_type:` should be `machine` until the translation reaches
49-
100% for the first time, at which point it should be `human`. It will revert to
50-
`machine` from `human` if it regresses to below 90%.
36+
* The `theme: language:` value should be the language code, as [specified by the MkDocs Material theme](https://squidfunk.github.io/mkdocs-material/setup/changing-the-language/). For most languages, this will be the same as the `docs_dir` language code; but for some (in particular languages with locale variants like `zh_CN`), there are differences.
37+
* The `extra: translation_type:` should be `machine` until the translation reaches 100% for the first time, at which point it should be `human`. It will revert to `machine` from `human` if it regresses to below 90%.
5138

5239
### The update to `tox.ini`
5340

5441
You'll need to make several changes to this file.
5542

5643
You'll need to add the following:
5744

58-
* The language code environment flag to the header line which begins `[testenv:docs`,
59-
preceded by a `-`, with no spaces included.
60-
* The language code exclusion to the first command, which begins with `!lint`,
61-
preceded by `-!`, with no spaces included.
45+
* The language code environment flag to the header line which begins `[testenv:docs`, preceded by a `-`, with no spaces included.
46+
* The language code exclusion to the first command, which begins with `!lint`, preceded by `-!`, with no spaces included.
6247
* The language code to the end of the second line beginning with `translate :`.
6348
* The language code to the end of the line beginning with `all :`.
64-
* A new line at the end that matches the other language-specific lines with the
65-
new language code.
49+
* A new line at the end that matches the other language-specific lines with the new language code.

docs/config.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ copyright: © Russell Keith-Magee
22

33
not_in_nav: |
44
/index.md
5+
/about/releases.md
56
67
validation:
78
omitted_files: warn
@@ -12,6 +13,15 @@ validation:
1213
extra:
1314
project_name: beeware-docs-tools
1415
package_name: beeware-docs-tools
16+
formal_name: "BeeWare Docs Tools"
17+
website: false # true shows beeware.org-specific content, false shows project content. Default: false.
18+
min_python_version: "3.10" # The oldest supported Python version
19+
min_python_version_tag: "310" # The tag version of the minimum python version
20+
recent_python_version: "3.13" # The newest Python version known to work on all platforms
21+
docs_python_version: "3.13" # The version of Python required to build the documentation
22+
translated: false # true hides content related to building translations. Default: false.
23+
hide_coverage: false # true hides content related to code coverage. Default: false.
24+
macos_only: false # true hides tabbed content, and displays only macOS instructions. Default: false.
1525
alternate:
1626
- name: English
1727
link: /en/
@@ -73,6 +83,7 @@ markdown_extensions:
7383
pymdownx.superfences: {}
7484
pymdownx.blocks.admonition: {}
7585
pymdownx.blocks.caption: {}
86+
pymdownx.details: {}
7687
pymdownx.blocks.tab:
7788
alternate_style: true
7889
pymdownx.snippets:
@@ -86,10 +97,12 @@ markdown_extensions:
8697

8798
plugins:
8899
search: {}
89-
autorefs: {}
100+
autorefs:
101+
resolve_closest: true # autorefs warns of the Usage headings begin duplicates without this - we will have to assign unique ids to all of them otherwise
90102
literate-nav:
91103
nav_file: SUMMARY.md
92-
macros: {}
104+
macros:
105+
include_dir: {}
93106
mkdocstrings:
94107
default_handler: python
95108
handlers:

docs/en/SUMMARY.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,36 @@
66
- ./section_three/*
77
- Shared content test bed
88
- [Shared content test bed](content_test_bed/index.md)
9-
- [Style guide](content_test_bed/style_guide_include.md)
9+
- How-to guides
10+
- Contribute
11+
- [Contributing](content_test_bed/how-to/contribute/index.md)
12+
- [First-time contributors](content_test_bed/how-to/contribute/first_time_contributors.md)
13+
- What can I do?
14+
- [Fix an issue](content_test_bed/how-to/contribute/what/fix_issue.md)
15+
- [Implement a new feature](content_test_bed/how-to/contribute/what/implement_feature.md)
16+
- [Write documentation](content_test_bed/how-to/contribute/what/write_docs.md)
17+
- [Triage an issue](content_test_bed/how-to/contribute/what/triage.md)
18+
- [Review a pull request](content_test_bed/how-to/contribute/what/review_pr.md)
19+
- [Propose a new feature](content_test_bed/how-to/contribute/what/propose_feature.md)
20+
- [Translate content](content_test_bed/how-to/contribute/what/translate.md)
21+
- [Use the tools](content_test_bed/how-to/contribute/what/use_tools.md)
22+
- How do I contribute?
23+
- [Setting up a development environment](content_test_bed/how-to/contribute/how/dev_environment.md)
24+
- [Reproducing an issue](content_test_bed/how-to/contribute/how/reproduce_issue.md)
25+
- [Working from a branch](content_test_bed/how-to/contribute/how/branches.md)
26+
- [Avoiding scope creep](content_test_bed/how-to/contribute/how/scope_creep.md)
27+
- [Writing, running, and testing code](content_test_bed/how-to/contribute/how/write_code.md)
28+
- [Building documentation](content_test_bed/how-to/contribute/how/build_docs.md)
29+
- [Writing documentation](content_test_bed/how-to/contribute/how/write_docs.md)
30+
- [Adding a change note](content_test_bed/how-to/contribute/how/change_note.md)
31+
- [Submitting a pull request](content_test_bed/how-to/contribute/how/submit_pr.md)
32+
- [Providing a review](content_test_bed/how-to/contribute/how/review_pr.md)
33+
- [Submitting a new issue](content_test_bed/how-to/contribute/how/new_issue.md)
34+
- [Proposing a new feature](content_test_bed/how-to/contribute/how/propose_feature.md)
35+
- [Translating content](content_test_bed/how-to/contribute/how/translate.md)
36+
- What happens next?
37+
- [Pull request review process](content_test_bed/how-to/contribute/next/pr_review.md)
38+
- [Release process](content_test_bed/how-to/contribute/next/release.md)
39+
- Style guides
40+
- [Code style guide](content_test_bed/how-to/contribute/style/code_style_guide.md)
41+
- [Documentation style guide](content_test_bed/how-to/contribute/style/docs_style_guide.md)

docs/en/about/releases.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place-holder file
2+
3+
This file is included purely to satisfy the link in the `code_contribution_base.md` file. It is excluded from nav.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# First-time contributors
2+
3+
{% extends "contribute/first_time_contributors.md" %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Work from a feature branch, not your `main` branch
2+
3+
{% extends "contribute/how/branches.md" %}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Building documentation
2+
3+
{% extends "contribute/how/build_docs.md" %}
4+
5+
{% block front_matter %}
6+
7+
Before you build the documentation, and have a [development environment](dev_environment.md) set up.
8+
9+
{% endblock %}
10+
11+
{% block end_matter %}
12+
13+
Once you have successfully built the docs, you are ready to [write documentation](write_docs.md).
14+
15+
{% endblock %}

0 commit comments

Comments
 (0)