Skip to content

Commit

Permalink
docs: different theme
Browse files Browse the repository at this point in the history
  • Loading branch information
kai687 committed Dec 3, 2023
1 parent 4be9167 commit 739a64f
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 16 deletions.
9 changes: 7 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os

from dotenv import load_dotenv
from sphinxawesome_theme.postprocess import Icons

# Load environment variables
load_dotenv()
Expand Down Expand Up @@ -31,6 +32,10 @@
}
elif tags.has("alabaster"): # noqa
html_theme = "alabaster"
else:
# Use Furo by default
elif tags.has("furo"): # noqa
html_theme = "furo"
else:
html_theme = "sphinxawesome_theme"
html_permalinks_icon = Icons.permalinks_icon
html_theme_options = {"awesome_external_links": True}
extensions += ["sphinxawesome_theme.highlighting"]
1 change: 1 addition & 0 deletions docs/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Without customization, this extension makes the DocSearch input look good with t

- [Furo](https://pradyunsg.me/furo/)
- [Read The Docs Sphinx Theme](https://sphinx-rtd-theme.readthedocs.io/en/stable/)
- [Awesome Theme](https://sphinxawesome.xyz/)
- [Alabaster](https://alabaster.readthedocs.io/en/latest/)

If you use other themes, or to further tweak the styles, you can add custom CSS.
Expand Down
6 changes: 4 additions & 2 deletions docs/what.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This Sphinx extension automatically adds it to your Sphinx project.
- [Who can apply?](https://docsearch.algolia.com/docs/who-can-apply/)
- [Crawler GitHub Action](https://github.com/marketplace/actions/algolia-crawler-automatic-crawl)
- [Algolia Crawler docs](https://www.algolia.com/doc/tools/crawler/getting-started/overview/)
:::
:::

## What does the DocSearch Sphinx extension do?

Expand All @@ -27,7 +27,9 @@ To avoid having two different search interfaces on your website,
this extension replaces the default search box provided by Sphinx.
It overrides the built-in templates `searchbox.html` or `sidebar/search.html`.
This makes the extension work with the [Furo](https://pradyunsg.me/furo/),
[Read The Docs](https://sphinx-rtd-theme.readthedocs.io/en/stable/), and
[Read The Docs](https://sphinx-rtd-theme.readthedocs.io/en/stable/),
[Awesome](https://sphinxawesome.xyz/),
and
[Alabaster](https://alabaster.readthedocs.io/en/latest/) themes by default.

For these themes, the extension also adds custom CSS to make the DocSearch search box fit the theme.
Expand Down
42 changes: 30 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ python-dotenv = "^1.0.0"
furo = "^2023.5.20"
myst-parser = "^2.0.0"
sphinx_rtd_theme = "^2.0.0"
sphinxawesome-theme = "5.0.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.3.1"
Expand Down

0 comments on commit 739a64f

Please sign in to comment.