diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e520969..fe3d9dc0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,3 +34,14 @@ repos: hooks: - id: prettier types_or: [scss, javascript] + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + exclude: > + (?x)^( + docs/reference/kitchen-sink/.*| + src/sphinx_book_theme/assets/.*| + tests/.* + )$ diff --git a/docs/content/content-blocks.md b/docs/content/content-blocks.md index 0805c435..f331af41 100644 --- a/docs/content/content-blocks.md +++ b/docs/content/content-blocks.md @@ -46,7 +46,7 @@ but I'll stop here. ```` You can also add an attribution to epigraphs by adding a blank line, -followed by a line that starts with `--`. This will be renderered like so: +followed by a line that starts with `--`. This will be rendered like so: ````{example} Epigraphs with attribution ```{epigraph} diff --git a/docs/contributing/subthemes.md b/docs/contributing/subthemes.md index 0a177c75..36222d8b 100644 --- a/docs/contributing/subthemes.md +++ b/docs/contributing/subthemes.md @@ -11,7 +11,7 @@ There are no promises that we won't make breaking changes here, so be sure to te ## Hashing your assets This theme defines a function called `hash_html_assets` that can be used to create hashes for your style files, and updates the Sphinx links to include them with `?digest=`. -You can re-use this function in a sub-theme if you wish - to do so, look at the function signature of `hash_html_assets`. +You can reuse this function in a sub-theme if you wish - to do so, look at the function signature of `hash_html_assets`. For example, here's a Python snippet that reuses this function: diff --git a/docs/contributing/versions.md b/docs/contributing/versions.md index 9d40085c..37654b85 100644 --- a/docs/contributing/versions.md +++ b/docs/contributing/versions.md @@ -40,7 +40,7 @@ This should get more energy than deciding whether to bump the major/minor versio **Major version bumps should be for truly major overhauls**. We're likely be breaking things here and there throughout, not every single breaking change. -Reserve major version changes for significant overhauls (for example, ones that require someone to comprehensively re-work thier CSS rules). +Reserve major version changes for significant overhauls (for example, ones that require someone to comprehensively re-work their CSS rules). **Major versions do not have any special meaning other than semver**. While we generally try not to bump major versions, they also carry no special meaning other than reflecting how much changed since the last version. diff --git a/docs/sections/footer-content.md b/docs/sections/footer-content.md index 37a31979..f958e61a 100644 --- a/docs/sections/footer-content.md +++ b/docs/sections/footer-content.md @@ -1,6 +1,6 @@ # Content footer -There is a content footer that spans the width of the page, and is visibile when you scroll to the bottom of the content. +There is a content footer that spans the width of the page, and is visible when you scroll to the bottom of the content. By default, the content footer has the following items: diff --git a/src/sphinx_book_theme/__init__.py b/src/sphinx_book_theme/__init__.py index bc5883ab..722c4836 100644 --- a/src/sphinx_book_theme/__init__.py +++ b/src/sphinx_book_theme/__init__.py @@ -38,7 +38,7 @@ def get_html_theme_path(): def add_metadata_to_page(app, pagename, templatename, context, doctree): - """Adds some metadata about the page that we re-use later.""" + """Adds some metadata about the page that we reuse later.""" # Add the site title to our context so it can be inserted into the navbar if not context.get("root_doc"): # TODO: Sphinx renamed master to root in 4.x, deprecate when we drop 3.x diff --git a/src/sphinx_book_theme/header_buttons/source.py b/src/sphinx_book_theme/header_buttons/source.py index 40e32b9a..a4d1a48b 100644 --- a/src/sphinx_book_theme/header_buttons/source.py +++ b/src/sphinx_book_theme/header_buttons/source.py @@ -48,7 +48,7 @@ def add_source_buttons(app, pagename, templatename, context, doctree): ) if opts.get("use_source_button") and doctree and suff: - # We'll re-use this to make action-specific URLs + # We'll reuse this to make action-specific URLs provider, edit_url = context["get_edit_provider_and_url"]() # Convert URL to a blob so it's for viewing if provider.lower() == "github": @@ -71,7 +71,7 @@ def add_source_buttons(app, pagename, templatename, context, doctree): ) if opts.get("use_edit_page_button") and doctree and suff: - # We'll re-use this to make action-specific URLs + # We'll reuse this to make action-specific URLs provider, edit_url = context["get_edit_provider_and_url"]() repo_buttons.append( { diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/components/sbt-sidebar-nav.html b/src/sphinx_book_theme/theme/sphinx_book_theme/components/sbt-sidebar-nav.html index bbfc656f..31bb5254 100644 --- a/src/sphinx_book_theme/theme/sphinx_book_theme/components/sbt-sidebar-nav.html +++ b/src/sphinx_book_theme/theme/sphinx_book_theme/components/sbt-sidebar-nav.html @@ -1,7 +1,7 @@