Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: executablebooks/sphinx-book-theme
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.3
Choose a base ref
...
head repository: executablebooks/sphinx-book-theme
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.1
Choose a head ref
Loading
Showing with 4,345 additions and 3,755 deletions.
  1. +2 −2 .github/dependabot.yml
  2. +3 −3 .github/workflows/lighthouserc.json
  3. +34 −0 .github/workflows/publish.yml
  4. +20 −37 .github/workflows/tests.yml
  5. +3 −0 .gitignore
  6. +10 −4 .pre-commit-config.yaml
  7. +69 −4 CHANGELOG.md
  8. +1 −1 CONTRIBUTING.md
  9. +1 −1 README.md
  10. BIN docs/_static/ebp-logo.png
  11. BIN docs/_static/logo-square.png
  12. +13 −0 docs/_static/logo-wide-dark.svg
  13. +0 −2 docs/_templates/sections/header.html
  14. +5 −0 docs/_templates/test.html
  15. +1 −1 docs/{customize → components}/custom-css.md
  16. +19 −0 docs/components/download.md
  17. +5 −0 docs/components/icon-links.md
  18. +11 −0 docs/components/index.md
  19. +8 −0 docs/components/logo.md
  20. +125 −0 docs/components/source-files.md
  21. +67 −32 docs/conf.py
  22. +4 −4 docs/{ → content}/content-blocks.md
  23. +10 −0 docs/content/index.md
  24. +2 −2 docs/{ → content}/launch.md
  25. +1 −1 docs/{ → content}/notebooks.md
  26. +3 −2 docs/contributing/index.md
  27. +48 −0 docs/contributing/versions.md
  28. +0 −12 docs/customize/download.md
  29. +0 −30 docs/customize/header.md
  30. +0 −14 docs/customize/single-page.md
  31. +0 −80 docs/customize/source-files.md
  32. +10 −10 docs/index.md
  33. +5 −28 docs/{customize/index.md → reference.md}
  34. +0 −3 docs/reference/extensions.md
  35. +123 −0 docs/reference/kitchen-sink/admonitions.rst
  36. +24 −5 docs/reference/kitchen-sink/api.rst
  37. +266 −0 docs/reference/kitchen-sink/blocks.rst
  38. +271 −0 docs/reference/kitchen-sink/generic.rst
  39. +89 −0 docs/reference/kitchen-sink/images.rst
  40. +25 −6 docs/reference/kitchen-sink/index.rst
  41. +0 −346 docs/reference/kitchen-sink/lists-and-tables.rst
  42. +268 −0 docs/reference/kitchen-sink/lists.rst
  43. +0 −474 docs/reference/kitchen-sink/paragraph-markup.rst
  44. +256 −0 docs/reference/kitchen-sink/really-long.rst
  45. +103 −0 docs/reference/kitchen-sink/structure.rst
  46. +107 −0 docs/reference/kitchen-sink/tables.rst
  47. +66 −0 docs/reference/kitchen-sink/typography.rst
  48. +15 −14 docs/reference/notebooks.md
  49. +2 −2 docs/reference/special-theme-elements.md
  50. +45 −0 docs/scripts/update_kitchen_sink.py
  51. 0 docs/{customize → sections}/announcements.md
  52. +26 −0 docs/sections/footer-content.md
  53. +21 −0 docs/sections/footer.md
  54. +46 −0 docs/sections/header.md
  55. +12 −0 docs/sections/index.md
  56. +2 −41 docs/{customize → sections}/sidebar-primary.md
  57. +1 −1 docs/{customize → sections}/sidebar-secondary.md
  58. +20 −18 pyproject.toml
  59. +66 −15 src/sphinx_book_theme/__init__.py
  60. +11 −7 src/sphinx_book_theme/_transforms.py
  61. +36 −76 src/sphinx_book_theme/assets/scripts/index.js
  62. +8 −38 src/sphinx_book_theme/assets/styles/abstracts/_mixins.scss
  63. +32 −44 src/sphinx_book_theme/assets/styles/abstracts/_variables.scss
  64. +17 −16 src/sphinx_book_theme/assets/styles/base/_base.scss
  65. +0 −9 src/sphinx_book_theme/assets/styles/base/_bootstrap.scss
  66. +79 −50 src/sphinx_book_theme/assets/styles/base/_print.scss
  67. +16 −49 src/sphinx_book_theme/assets/styles/base/_typography.scss
  68. +0 −119 src/sphinx_book_theme/assets/styles/components/_buttons.scss
  69. +21 −0 src/sphinx_book_theme/assets/styles/components/_icon-links.scss
  70. +23 −0 src/sphinx_book_theme/assets/styles/components/_logo.scss
  71. +35 −8 src/sphinx_book_theme/assets/styles/components/_search.scss
  72. +0 −20 src/sphinx_book_theme/assets/styles/content/_admonitions.scss
  73. +0 −38 src/sphinx_book_theme/assets/styles/content/_code.scss
  74. +0 −10 src/sphinx_book_theme/assets/styles/content/_field-lists.scss
  75. +0 −18 src/sphinx_book_theme/assets/styles/content/_footnotes.scss
  76. +0 −5 src/sphinx_book_theme/assets/styles/content/_glossary.scss
  77. +125 −41 src/sphinx_book_theme/assets/styles/content/_margin.scss
  78. +0 −43 src/sphinx_book_theme/assets/styles/content/_math.scss
  79. +11 −0 src/sphinx_book_theme/assets/styles/content/_notebooks.scss
  80. +5 −8 src/sphinx_book_theme/assets/styles/content/_quotes.scss
  81. +0 −16 src/sphinx_book_theme/assets/styles/content/_sidebar.scss
  82. +0 −72 src/sphinx_book_theme/assets/styles/content/_tableofcontents.scss
  83. +0 −41 src/sphinx_book_theme/assets/styles/extensions/_ablog.scss
  84. 0 src/sphinx_book_theme/assets/styles/extensions/{comments.scss → _comments.scss}
  85. +0 −41 src/sphinx_book_theme/assets/styles/extensions/_myst-nb.scss
  86. +0 −64 src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss
  87. +0 −12 src/sphinx_book_theme/assets/styles/extensions/_sphinx-tabs.scss
  88. +11 −22 src/sphinx_book_theme/assets/styles/index.scss
  89. +0 −48 src/sphinx_book_theme/assets/styles/pages/_search.scss
  90. +4 −0 src/sphinx_book_theme/assets/styles/sections/_announcement.scss
  91. +22 −0 src/sphinx_book_theme/assets/styles/sections/_article-container.scss
  92. +2 −19 src/sphinx_book_theme/assets/styles/sections/_article.scss
  93. +5 −21 src/sphinx_book_theme/assets/styles/sections/_footer-article.scss
  94. +13 −0 src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
  95. +171 −14 src/sphinx_book_theme/assets/styles/sections/_header-article.scss
  96. +10 −0 src/sphinx_book_theme/assets/styles/sections/_header-primary.scss
  97. +0 −22 src/sphinx_book_theme/assets/styles/sections/_headers.scss
  98. +26 −102 src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
  99. +71 −87 src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
  100. +0 −76 src/sphinx_book_theme/assets/styles/sections/_sidebars-toggle.scss
  101. +2 −2 src/sphinx_book_theme/assets/translations/jsons/By the.json
  102. +2 −2 src/sphinx_book_theme/assets/translations/jsons/By.json
  103. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Contents.json
  104. +1 −1 src/sphinx_book_theme/assets/translations/jsons/Copyright.json
  105. +1 −1 src/sphinx_book_theme/assets/translations/jsons/Download notebook file.json
  106. +1 −1 src/sphinx_book_theme/assets/translations/jsons/Download source file.json
  107. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Edit this page.json
  108. +1 −1 src/sphinx_book_theme/assets/translations/jsons/Fullscreen mode.json
  109. +1 −1 src/sphinx_book_theme/assets/translations/jsons/Last updated on.json
  110. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Launch.json
  111. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Open an issue.json
  112. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Print to PDF.json
  113. +0 −87 src/sphinx_book_theme/assets/translations/jsons/Search the docs.json
  114. +0 −128 src/sphinx_book_theme/assets/translations/jsons/Search this book.json
  115. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Source repository.json
  116. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Sphinx Book Theme.json
  117. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Theme by the.json
  118. +2 −2 src/sphinx_book_theme/assets/translations/jsons/Toggle navigation.json
  119. +1 −1 src/sphinx_book_theme/assets/translations/jsons/open issue.json
  120. +2 −2 src/sphinx_book_theme/assets/translations/jsons/repository.json
  121. +2 −1 src/sphinx_book_theme/assets/translations/jsons/suggest edit.json
  122. +122 −111 src/sphinx_book_theme/header_buttons/__init__.py
  123. +77 −52 src/sphinx_book_theme/header_buttons/launch.py
  124. +117 −0 src/sphinx_book_theme/header_buttons/source.py
  125. +15 −0 src/sphinx_book_theme/theme/sphinx_book_theme/components/article-header-buttons.html
  126. +5 −0 src/sphinx_book_theme/theme/sphinx_book_theme/components/author.html
  127. +5 −0 src/sphinx_book_theme/theme/sphinx_book_theme/components/extra-footer.html
  128. +15 −0 src/sphinx_book_theme/theme/sphinx_book_theme/components/page-toc.html
  129. +3 −3 src/sphinx_book_theme/theme/sphinx_book_theme/components/sbt-sidebar-nav.html
  130. +0 −14 src/sphinx_book_theme/theme/sphinx_book_theme/components/sidebar-logo.html
  131. +0 −4 src/sphinx_book_theme/theme/sphinx_book_theme/components/toc-button.html
  132. +3 −0 src/sphinx_book_theme/theme/sphinx_book_theme/components/toggle-primary-sidebar.html
  133. +7 −0 src/sphinx_book_theme/theme/sphinx_book_theme/components/toggle-secondary-sidebar.html
  134. +19 −92 src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
  135. +23 −39 src/sphinx_book_theme/theme/sphinx_book_theme/macros/buttons.html
  136. +0 −1 src/sphinx_book_theme/theme/sphinx_book_theme/sections/announcement.html
  137. +0 −4 src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-article.html
  138. +9 −20 src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-content.html
  139. +0 −32 src/sphinx_book_theme/theme/sphinx_book_theme/sections/header-article.html
  140. 0 src/sphinx_book_theme/theme/sphinx_book_theme/sections/header.html
  141. +0 −3 src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar.html
  142. +40 −15 src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
  143. +1 −1 tests/sites/base/conf.py
  144. +1 −1 tests/sites/base/index.md
  145. +3 −3 tests/sites/base/page2.md
  146. +0 −1 tests/sites/base/section1/ntbk.ipynb
  147. +145 −41 tests/test_build.py
  148. +123 −110 tests/test_build/build__header-article.html
  149. +32 −28 tests/test_build/build__pagetoc--page-multipletitles.html
  150. +23 −19 tests/test_build/build__pagetoc--page-onetitle.html
  151. +0 −2 tests/test_build/build__pagetoc--page-onetitlenoheadings.html
  152. +0 −92 tests/test_build/build__sidebar-primary__nav.html
  153. +7 −0 tests/test_build/header__launch-buttons--bitbucket.html
  154. +11 −0 tests/test_build/header__launch-buttons--github.html
  155. +7 −0 tests/test_build/header__launch-buttons--gitlab.html
  156. +7 −0 tests/test_build/header__launch-buttons--gitlab_manual.html
  157. +54 −36 tests/test_build/header__repo-buttons--all-off.html
  158. +94 −78 tests/test_build/header__repo-buttons--all-on.html
  159. +77 −61 tests/test_build/header__repo-buttons--custom-branch.html
  160. +60 −42 tests/test_build/header__repo-buttons--one-on.html
  161. +6 −0 tests/test_build/header__source-buttons--bitbucket.html
  162. +8 −0 tests/test_build/header__source-buttons--github.html
  163. +6 −0 tests/test_build/header__source-buttons--github_manual.html
  164. +6 −0 tests/test_build/header__source-buttons--gitlab.html
  165. +6 −0 tests/test_build/header__source-buttons--gitlab_manual.html
  166. +55 −57 tests/test_build/test_header_launchbtns.html
  167. +16 −25 tests/test_build/test_marginnote.html
  168. +3 −3 tests/test_build/test_right_sidebar_title.html
  169. +9 −2 tests/test_build/test_sidenote.html
  170. +0 −61 tests/test_build/test_topbar_launchbtns.html
  171. +4 −4 tox.ini
  172. +1 −1 webpack.config.js
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
6 changes: 3 additions & 3 deletions .github/workflows/lighthouserc.json
Original file line number Diff line number Diff line change
@@ -9,9 +9,9 @@
},
"assert": {
"assertions": {
"categories:performance": ["error", { "minScore": 0.85 }],
"categories:accessibility": ["error", { "minScore": 0.85 }],
"categories:best-practices": ["error", { "minScore": 0.85 }]
"categories:performance": ["error", { "minScore": 0.8 }],
"categories:accessibility": ["error", { "minScore": 0.8 }],
"categories:best-practices": ["error", { "minScore": 0.8 }]
}
}
}
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This will run every time a tag is created and pushed to the repository.
# It calls our tests workflow via a `workflow_call`, and if tests pass
# then it triggers our upload to PyPI for a new release.
name: Publish to PyPI
on:
release:
types: ["published"]

jobs:
tests:
uses: ./.github/workflows/tests.yml
publish:
name: publish
needs: [tests] # require tests to pass before deploy runs
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Build package
run: |
sudo apt-get install gettext
python -m pip install -U pip build
python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.6.4
with:
user: __token__
password: ${{ secrets.PYPI_KEY }}
57 changes: 20 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ on:
tags:
- 'v*'
pull_request:
workflow_call:

env:
PY_COLORS: 1
@@ -16,30 +17,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: pre-commit/action@v2.0.3
- uses: pre-commit/action@v3.0.0

tests:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9]
sphinx: [">=3,<4", ">=4,<5"]
# 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"]
include:
- os: windows-latest
python-version: 3.9
sphinx: ">=3,<4"
sphinx: ">=6,<7"
- os: macos-latest
python-version: 3.9
sphinx: ">=4,<5"
sphinx: ">=6,<7"
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
- name: Set up Python ${{ matrix.python-version }} and Sphinx ${{ matrix.sphinx }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
@@ -54,9 +58,10 @@ jobs:
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'
uses: codecov/codecov-action@v3.1.0
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7 && github.repository == 'executablebooks/sphinx-book-theme' && github.event_name == 'pull_request'
uses: codecov/codecov-action@v3.1.1
with:
name: ebp-sbt-pytests-py3.7
flags: pytests
@@ -70,7 +75,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.7'
cache: "pip"
@@ -80,7 +85,9 @@ jobs:
python -m pip install --upgrade pip
pip install -e .[doc]
# Only check for broken links on pull requests so that we don't block releases
- name: Check for broken links
if: github.event_name == 'pull_request'
run: >
sphinx-build -b linkcheck docs docs/_build/linkcheck
@@ -93,39 +100,15 @@ jobs:
run: |
from pathlib import Path
text = Path("./warnings.txt").read_text().strip()
expected_warning_snippets = ["kitchen-sink", "urllib/parse.py"]
print("\n=== Sphinx Warnings ===\n\n" + text) # Print just for reference so we can look at the logs
unexpected = [ii for ii in text.split("\n") if "kitchen-sink" not in ii]
unexpected = [ii for ii in text.split("\n") if not any(snippet in ii for snippet in expected_warning_snippets)]
assert len(unexpected) == 0
- name: Audit with Lighthouse
uses: treosh/lighthouse-ci-action@9.3.0
uses: treosh/lighthouse-ci-action@9.3.1
with:
configPath: ".github/workflows/lighthouserc.json"
temporaryPublicStorage: true
uploadArtifacts: true
runs: 5

publish:
name: Publish to PyPI
needs: [pre-commit, tests]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: 3.7

- name: Build package
run: |
python -m pip install -U pip build
python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_KEY }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -138,3 +138,6 @@ node_modules/
# Editors
.vscode/
.idea

# Files we create automatically
docs/content/pydata-content-blocks.md
14 changes: 10 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -5,10 +5,16 @@ exclude: >
(?x)^(
\.vscode/settings\.json|
)$
# Fix the node version to avoid a GLIBC error
# ref: https://stackoverflow.com/questions/71939099/bitbucket-pipeline-error-installing-pre-commit-ts-lint/71940852#71940852
default_language_version:
node: 16.14.2

repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-toml
- id: check-json
@@ -17,17 +23,17 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
rev: v3.0.0-alpha.4
hooks:
- id: prettier
types_or: [scss, javascript]
Loading