Skip to content

Commit

Permalink
Merge pull request #788 from executablebooks/agoose77/maint-use-codes…
Browse files Browse the repository at this point in the history
…pell

MAINT: use codespell in pre-commit
  • Loading branch information
agoose77 authored Dec 4, 2023
2 parents 19c973c + 0389312 commit 0e57ffa
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*
)$
2 changes: 1 addition & 1 deletion docs/content/content-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/subthemes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/sections/footer-content.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
2 changes: 1 addition & 1 deletion src/sphinx_book_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/sphinx_book_theme/header_buttons/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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(
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
{% if theme_home_page_in_toc == True %}
{#- This mimicks the pydata theme list style so we can append an extra item at the top #}
{#- This mimics the pydata theme list style so we can append an extra item at the top #}
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1{% if pagename == root_doc %} current active{% endif %}">
<a class="reference internal" href="{{ pathto(root_doc) }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{# Utility macros we'll re-use below -#}
{# Utility macros we'll reuse below -#}
{% macro render_inner_html(icon, text) %}
{# used across multiple button types #}
{% if icon -%}
Expand Down

0 comments on commit 0e57ffa

Please sign in to comment.