Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 authored Dec 4, 2023
2 parents 5fa45a6 + af1122b commit fe75faf
Show file tree
Hide file tree
Showing 61 changed files with 416 additions and 164 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11

- name: Build package
run: |
Expand All @@ -28,7 +28,7 @@ jobs:
python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.6.4
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
user: __token__
password: ${{ secrets.PYPI_KEY }}
38 changes: 21 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,56 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
- uses: pre-commit/[email protected]

tests:
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9]
python-version: ["3.9", "3.10", "3.11"]
# Only test the latest major release of Sphinx because otherwise we need to
# keep multiple versions of regression tests on file and this creates lots of
# noise in the tests.
sphinx: [">=6,<7"]
sphinx: ["~=5.0","~=6.0","~=7.0"]
include:
- os: windows-latest
python-version: 3.9
sphinx: ">=6,<7"
# Python 3.12 is broken on windows builds until the following PR is released:
# https://github.com/pradyunsg/sphinx-theme-builder/pull/47
python-version: 3.11
# Windows pulling in dependencies fails
experimental: true
- os: macos-latest
python-version: 3.9
sphinx: ">=6,<7"
python-version: 3.x
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} and Sphinx ${{ matrix.sphinx }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"

- name: Install dependencies
- name: Install dependencies with Sphinx ${{ matrix.sphinx }}
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
python -m pip install --upgrade "sphinx${{matrix.sphinx}}" -e .[test] --pre
- name: Run pytest
run: >
pytest --durations=10 --cov=sphinx_book_theme --cov-report=xml --cov-report=term-missing
# Only upload to codecov on pull requests so that we don't trigger rate limit blocks
- name: Upload to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7 && github.repository == 'executablebooks/sphinx-book-theme' && github.event_name == 'pull_request'
uses: codecov/[email protected].1
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 && github.repository == 'executablebooks/sphinx-book-theme' && github.event_name == 'pull_request'
uses: codecov/[email protected].4
with:
name: ebp-sbt-pytests-py3.7
flags: pytests
Expand All @@ -73,11 +77,11 @@ jobs:
runs-on: ubuntu-latest
name: Build and Audit Documentation
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.9'
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
Expand Down Expand Up @@ -106,7 +110,7 @@ jobs:
assert len(unexpected) == 0
- name: Audit with Lighthouse
uses: treosh/lighthouse-ci-action@9.3.1
uses: treosh/lighthouse-ci-action@10.1.0
with:
configPath: ".github/workflows/lighthouserc.json"
temporaryPublicStorage: true
Expand Down
17 changes: 7 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,23 @@ default_language_version:
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-toml
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: flake8

- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
rev: v3.1.0
hooks:
- id: prettier
types_or: [scss, javascript]
9 changes: 7 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
version: 2
# Set the OS, Python version and other tools you might need

build:
os: ubuntu-22.04
tools:
python: "3.10"

python:
version: 3
install:
- method: pip
path: .[doc]
path: ".[doc]"

sphinx:
builder: html
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.0.1 -- 2023-03-31

This is a minor release supporting pydata>=0.13.3, with a few import changes from pydata.

## v1.0.0 -- 2023-03-01

This is a major release that brings in the latest PyData Sphinx Theme and a number of new features with it.
Expand Down
1 change: 0 additions & 1 deletion docs/components/source-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ an edit or open an issue.

You need to define a **source repository** for this functionality to work.
This is the online space where your code / documentation is hosted.
To
In each case, they require the following configuration to exist:

```python
Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@
"reference/blog/*": [
"navbar-logo.html",
"search-field.html",
"postcard.html",
"recentposts.html",
"tagcloud.html",
"categories.html",
"archives.html",
"ablog/postcard.html",
"ablog/recentposts.html",
"ablog/tagcloud.html",
"ablog/categories.html",
"ablog/archives.html",
"sbt-sidebar-nav.html",
]
}
Expand Down Expand Up @@ -205,7 +205,7 @@
) # noqa
content = "\n".join(content)
# Replace a relative link in the pydata docs w/ the respective one here
content = content.replace("../examples/pydata.md", "notebooks.md")
content = content.replace("../examples/pydata.ipynb", "notebooks.md")
# Write to disk in a location that will be ignored by git
path_content_file.write_text(content)

Expand Down
2 changes: 1 addition & 1 deletion docs/content/launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file instead of the text file.

## Binder / BinderHub

To add Binder links your page, add the following configuration:
To add Binder links to your page, add the following configuration:

```python
html_theme_options = {
Expand Down
9 changes: 6 additions & 3 deletions docs/content/notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ import folium
m = folium.Map(
location=[45.372, -121.6972],
zoom_start=12,
tiles='Stamen Terrain'
tiles='Stamen Terrain',
attr="Placeholder attr"
)
folium.Marker(
location=[45.3288, -121.6625],
popup='Mt. Hood Meadows',
icon=folium.Icon(icon='cloud')
icon=folium.Icon(icon='cloud'),
attr="Placeholder attr"
).add_to(m)
folium.Marker(
Expand All @@ -241,7 +243,8 @@ folium.Marker(
folium.Marker(
location=[45.3300, -121.6823],
popup='Some Other Location',
icon=folium.Icon(color='red', icon='info-sign')
icon=folium.Icon(color='red', icon='info-sign'),
attr="Placeholder attr"
).add_to(m)
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Follow these steps:
cd sphinx-book-theme
```

2. Ensure you have Python 3.7 or newer!
2. Ensure you have Python 3.9 or newer!
3. Install `tox`.
`tox` is a tool for managing virtual environments for test suites or common jobs that are run with a repository.
It ensures that your environment is consistent each time you build the docs or run tests.
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This theme draws inspiration and borrows design elements from the following them
## SCSS build process

Our SCSS source files at in `src/sphinx_book_theme/assets/styles`.
We use the [Sphinx Theme Builder](https://github.com/pradyunsg/sphinx-theme-builder) tp compile these assets and bundle them with the theme at `src/sphinx_book_theme/theme/sphinx_book_theme/static/styles`.
We use the [Sphinx Theme Builder](https://github.com/pradyunsg/sphinx-theme-builder) to compile these assets and bundle them with the theme at `src/sphinx_book_theme/theme/sphinx_book_theme/static/styles`.

These compiled files are **not checked in to `git` history**.

Expand Down
11 changes: 10 additions & 1 deletion docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ These are **in addition to** all of the {external:doc}`options available in the
- Whether to put the home page in the Navigation Bar (at the top). See [](sidebar-primary:home-page).
* - `show_navbar_depth`
- int
- Show children in the navigation bar down to the depth listed here. See [](sidebar:navbar-depth).
- Show children in the navigation bar down to the depth listed here. See [](sidebar:show-navbar-depth).
* - `max_navbar_depth`
- int
- The maximum number of levels to show in the navbar. See [](sidebar:max-navbar-depth). (4 is default)
* - `collapse_navbar`
- bool
- Whether to collapse the navbar, stopping the tree from being expanded. See [](sidebar:max-navbar-depth), (False is default)
* - `extra_navbar`
- str
- Extra HTML to add below the sidebar footer. See [](content-footer:extra-footer).
* - `extra_footer`
- str
- Extra HTML to add in the footer of each page.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/kitchen-sink/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Using Sphinx's ``sphinx.ext.autodoc`` plugin, it is possible to auto-generate do
# Don't show class signature with the class' name.
autodoc_class_signature = "separated"
.. automodule:: urllib.parse
.. automodule:: datetime
:members:
12 changes: 8 additions & 4 deletions docs/reference/notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,29 @@ import folium
m = folium.Map(
location=[45.372, -121.6972],
zoom_start=12,
tiles='Stamen Terrain'
tiles='Stamen Terrain',
attr="Placeholder attr"
)
folium.Marker(
location=[45.3288, -121.6625],
popup='Mt. Hood Meadows',
icon=folium.Icon(icon='cloud')
icon=folium.Icon(icon='cloud'),
attr="Placeholder attr"
).add_to(m)
folium.Marker(
location=[45.3311, -121.7113],
popup='Timberline Lodge',
icon=folium.Icon(color='green')
icon=folium.Icon(color='green'),
attr="Placeholder attr"
).add_to(m)
folium.Marker(
location=[45.3300, -121.6823],
popup='Some Other Location',
icon=folium.Icon(color='red', icon='info-sign')
icon=folium.Icon(color='red', icon='info-sign'),
attr="Placeholder attr"
).add_to(m)
Expand Down
2 changes: 1 addition & 1 deletion docs/sections/footer.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ However, there are two configuration points where you can add items to your foot

`html_theme_options["footer_start"]` accepts a list of HTML templates that will be placed at the beginning (left on most screens) of the footer.

`html_theme_options["footer_start"]` accepts a list of HTML templates that will be placed at the end (right on most screens) of the footer.
`html_theme_options["footer_end"]` accepts a list of HTML templates that will be placed at the end (right on most screens) of the footer.

For example, the configuration below assumes there is a template at `_templates/test.html`.
It adds the `_templates` folder to Sphinx's templates path, and adds the template to both the start and end section of the footer.
Expand Down
35 changes: 34 additions & 1 deletion docs/sections/sidebar-primary.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ html_theme_options = {
}
```

(sidebar:navbar-depth)=
(sidebar:show-navbar-depth)=
## Control the depth of the left sidebar lists to expand

You can control the level of toc items in the left sidebar to remain expanded,
Expand All @@ -73,3 +73,36 @@ html_theme_options = {
```

The default value is `1`, which shows only top-level sections of the documentation (and is used in this documentation).

(sidebar:max-navbar-depth)=

## Control the maximum depth of the left sidebar lists

You can control the level of toc items included in the left sidebar,
using the following configuration in `conf.py`:

```python
html_theme_options = {
...
"max_navbar_depth": <level>,
...
}
```

The default value is `4`.

(sidebar:collapse-navbar)=
## Turn off expandable left sidebar lists

You can turn off the sidebar expanding,
using the following configuration in `conf.py`:

```python
html_theme_options = {
...
"collapse_navbar": True,
...
}
```

The default value is `False`, which allows the navbar to be expanded.
Loading

0 comments on commit fe75faf

Please sign in to comment.