-
Notifications
You must be signed in to change notification settings - Fork 3
feat: update to v3 themeing #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JacobCoffee
wants to merge
19
commits into
main
Choose a base branch
from
v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
449c93e
feat: update to v3 themeing
JacobCoffee 258a07b
docs: update readme
JacobCoffee 68c525c
build: update css
JacobCoffee 80a0440
fix: use new theme
JacobCoffee cd2596d
feat: use static links
JacobCoffee 3ce1f05
feat: partially done themeing for v3
JacobCoffee 38cc0e2
feat: partially done themeing for v3
JacobCoffee a3df4f4
feat: update context items
JacobCoffee 63cf784
feat: update theme
JacobCoffee ff9c7cc
feat: add sphinx-togglebutton
JacobCoffee 16ba8e5
fix: enable custom api docs styling
JacobCoffee c6d7ef8
feat: add reddit
JacobCoffee 30aafc8
docs: new discord link
JacobCoffee 7e2b31f
style: update logo and css
JacobCoffee 4799f93
style: fix theme logo
JacobCoffee e5f1df5
Merge branch 'main' into v3
cofin 4ea4888
V3 uv (#17)
JacobCoffee b5d0276
docs: do not use custom syntax pygment stuff
JacobCoffee 3a2dd24
fix: remove build error for links, build latest css
JacobCoffee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,172 @@ | ||
| install: | ||
| pdm install | ||
| npm install | ||
| SHELL := /bin/bash | ||
|
|
||
| build-assets: | ||
| npx tailwindcss -i litestar_sphinx_theme/style.css -o litestar_sphinx_theme/theme/static/litestar-sphinx-theme.css -m | ||
| # ============================================================================= | ||
| # Configuration and Environment Variables | ||
| # ============================================================================= | ||
|
|
||
| .PHONY: refresh-lockfiles | ||
| refresh-lockfiles: ## Sync lockfiles with requirements files. | ||
| pdm update --update-reuse --group :all | ||
| .DEFAULT_GOAL:=help | ||
| .ONESHELL: | ||
| .EXPORT_ALL_VARIABLES: | ||
| MAKEFLAGS += --no-print-directory | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Display Formatting and Colors | ||
| # ----------------------------------------------------------------------------- | ||
| BLUE := $(shell printf "\033[1;34m") | ||
| GREEN := $(shell printf "\033[1;32m") | ||
| RED := $(shell printf "\033[1;31m") | ||
| YELLOW := $(shell printf "\033[1;33m") | ||
| NC := $(shell printf "\033[0m") | ||
| INFO := $(shell printf "$(BLUE)ℹ$(NC)") | ||
| OK := $(shell printf "$(GREEN)✓$(NC)") | ||
| WARN := $(shell printf "$(YELLOW)⚠$(NC)") | ||
| ERROR := $(shell printf "$(RED)✖$(NC)") | ||
|
|
||
| # ============================================================================= | ||
| # Help and Documentation | ||
| # ============================================================================= | ||
|
|
||
| .PHONY: help | ||
| help: ## Display this help text for Makefile | ||
| @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
|
||
| # ============================================================================= | ||
| # Installation and Environment Setup | ||
| # ============================================================================= | ||
|
|
||
| .PHONY: install-uv | ||
| install-uv: ## Install latest version of uv | ||
| @echo "${INFO} Installing uv..." | ||
| @curl -LsSf https://astral.sh/uv/install.sh | sh >/dev/null 2>&1 | ||
| @uv tool install nodeenv >/dev/null 2>&1 | ||
| @echo "${OK} UV installed successfully" | ||
|
|
||
| .PHONY: install | ||
| install: destroy clean ## Install the project, dependencies, and pre-commit | ||
| @echo "${INFO} Starting fresh installation..." | ||
| @uv python pin 3.12 >/dev/null 2>&1 | ||
| @uv venv >/dev/null 2>&1 | ||
| @uv sync --all-extras --dev | ||
| @if ! command -v npm >/dev/null 2>&1; then \ | ||
| echo "${INFO} Installing Node environment... 📦"; \ | ||
| uvx nodeenv .venv --force --quiet >/dev/null 2>&1; \ | ||
| fi | ||
| @NODE_OPTIONS="--no-deprecation --disable-warning=ExperimentalWarning" npm install --no-fund >/dev/null 2>&1 | ||
| @echo "${OK} Installation complete! 🎉" | ||
|
|
||
| .PHONY: destroy | ||
| destroy: ## Destroy the virtual environment | ||
| @echo "${INFO} Destroying virtual environment... 🗑️" | ||
| @uv run pre-commit clean >/dev/null 2>&1 | ||
| @rm -rf .venv | ||
| @echo "${OK} Virtual environment destroyed 🗑️" | ||
|
|
||
|
|
||
| # ============================================================================= | ||
| # Dependency Management | ||
| # ============================================================================= | ||
|
|
||
| .PHONY: upgrade | ||
| upgrade: ## Upgrade all dependencies to latest stable versions | ||
| @echo "${INFO} Updating all dependencies... 🔄" | ||
| @uv lock --upgrade | ||
| @NODE_OPTIONS="--no-deprecation --disable-warning=ExperimentalWarning" npm upgrade --latest | ||
| @echo "${OK} Dependencies updated 🔄" | ||
| @uv run pre-commit autoupdate | ||
| @echo "${OK} Updated Pre-commit hooks 🔄" | ||
|
|
||
| .PHONY: lock | ||
| lock: ## Rebuild lockfiles from scratch, updating all dependencies | ||
| pdm update --update-eager --group :all | ||
| lock: ## Rebuild lockfiles from scratch | ||
| @echo "${INFO} Rebuilding lockfiles... 🔄" | ||
| @uv lock --upgrade >/dev/null 2>&1 | ||
| @echo "${OK} Lockfiles updated" | ||
|
|
||
| # ============================================================================= | ||
| # Build and Release | ||
| # ============================================================================= | ||
|
|
||
| .PHONY: build | ||
| build: ## Build the package | ||
| @echo "${INFO} Generating CSS... 🎨" | ||
| @NODE_OPTIONS="--no-deprecation --disable-warning=ExperimentalWarning" npx tailwindcss -i litestar_sphinx_theme/style.css -o litestar_sphinx_theme/theme/static/litestar-sphinx-theme.css -m | ||
| @echo "${INFO} Building package... 📦" | ||
| @uv build >/dev/null 2>&1 | ||
| @echo "${OK} Package build complete" | ||
|
|
||
|
|
||
| # ============================================================================= | ||
| # Cleaning and Maintenance | ||
| # ============================================================================= | ||
|
|
||
| .PHONY: clean | ||
| clean: ## Cleanup temporary build artifacts | ||
| @echo "${INFO} Cleaning working directory... 🧹" | ||
| @rm -rf pytest_cache .ruff_cache .hypothesis build/ -rf dist/ .eggs/ .coverage coverage.xml coverage.json htmlcov/ .pytest_cache tests/.pytest_cache tests/**/.pytest_cache .mypy_cache .unasyncd_cache/ .auto_pytabs_cache node_modules >/dev/null 2>&1 | ||
| @find . -name '*.egg-info' -exec rm -rf {} + >/dev/null 2>&1 | ||
| @find . -type f -name '*.egg' -exec rm -f {} + >/dev/null 2>&1 | ||
| @find . -name '*.pyc' -exec rm -f {} + >/dev/null 2>&1 | ||
| @find . -name '*.pyo' -exec rm -f {} + >/dev/null 2>&1 | ||
| @find . -name '*~' -exec rm -f {} + >/dev/null 2>&1 | ||
| @find . -name '__pycache__' -exec rm -rf {} + >/dev/null 2>&1 | ||
| @find . -name '.ipynb_checkpoints' -exec rm -rf {} + >/dev/null 2>&1 | ||
| @echo "${OK} Working directory cleaned" | ||
|
|
||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Type Checking | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
| .PHONY: mypy | ||
| mypy: ## Run mypy | ||
| @echo "${INFO} Running mypy... 🔍" | ||
| @uv run dmypy run | ||
| @echo "${OK} Mypy checks passed ✨" | ||
|
|
||
| .PHONY: mypy-nocache | ||
| mypy-nocache: ## Run Mypy without cache | ||
| @echo "${INFO} Running mypy without cache... 🔍" | ||
| @uv run mypy | ||
| @echo "${OK} Mypy checks passed ✨" | ||
|
|
||
| .PHONY: pyright | ||
| pyright: ## Run pyright | ||
| @echo "${INFO} Running pyright... 🔍" | ||
| @uv run pyright | ||
| @echo "${OK} Pyright checks passed ✨" | ||
|
|
||
| .PHONY: basedpyright | ||
| basedpyright: ## Run basedpyright | ||
| @echo "${INFO} Running basedpyright... 🔍" | ||
| @uv run basedpyright | ||
| @echo "${OK} Basedpyright checks passed ✨" | ||
|
|
||
| .PHONY: type-check | ||
| type-check: mypy pyright ## Run all type checking | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Linting and Formatting | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
| .PHONY: pre-commit | ||
| pre-commit: ## Run pre-commit hooks | ||
| @echo "${INFO} Running pre-commit checks... 🔎" | ||
| @NODE_OPTIONS="--no-deprecation --disable-warning=ExperimentalWarning" uv run pre-commit run --color=always --all-files | ||
| @echo "${OK} Pre-commit checks passed ✨" | ||
|
|
||
| .PHONY: slotscheck | ||
| slotscheck: ## Run slotscheck | ||
| @echo "${INFO} Running slots check... 🔍" | ||
| @uv run slotscheck -m litestar_sphinx_theme | ||
| @echo "${OK} Slots check passed ✨" | ||
|
|
||
| .PHONY: fix | ||
| fix: ## Run code formatters | ||
| @echo "${INFO} Running code formatters... 🔧" | ||
| @uv run ruff check --fix --unsafe-fixes | ||
| @echo "${OK} Code formatting complete ✨" | ||
|
|
||
| .PHONY: lint | ||
| lint: pre-commit type-check slotscheck ## Run all linting checks | ||
|
|
||
| .PHONY: check-all | ||
| check-all: lint test coverage ## Run all checks (lint, test, coverage) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| # Litestar sphinx theme | ||
|
|
||
| A Sphinx theme for the [Litestar organization](https://github.com/litestar-org), based on the | ||
| [PyData Sphinx Theme](https://github.com/pydata/pydata-sphinx-theme). | ||
| [Shibuya Theme](https://shibuya.lepture.com). | ||
|
|
||
| It doesn't do much, mostly adjusting some colours a bit of layout and add a few default links and menus. | ||
| It doesn't do much, mostly adjusting some colors a bit of layout and adding a few default links and menus. | ||
|
|
||
| Refer to the [PyData Sphinx Theme documentation](https://pydata-sphinx-theme.readthedocs.io/en/latest/) for documentation. | ||
| Refer to the [Shibuya Theme documentation](https://shibuya.lepture.com) for documentation. | ||
|
|
||
| **This theme is not intended for general use** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shibuya theme supports Reddit natively now.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! thats why I uncommented and added.
This is so that we dont need to define it in each of our projects conf.py 😄. Actually set in theme.conf this seems sortve redundant but i was keeping with the prior work in letting people set it differently if for some reason