Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add documentation commands to Makefile #431

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,4 @@ dist

# scaf challenge
.scaf-challenge.json
.aider*
14 changes: 10 additions & 4 deletions {{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ PROJECT_SLUG:="{{ cookiecutter.project_slug }}"

## Release/Deployment Targets

.PHONY: ci
ci: test secure build ## Execute the same checks used in CI/CD

.git/hooks/pre-commit: ## Install pre-commit hooks
pip install pre-commit; \
cd backend/; \
pre-commit install

.PHONY: check-lint-and-formatting
check-lint-and-formatting: .git/hooks/pre-commit ## Execute check of lint and formatting using existing pre-commit hooks
cd backend; \
pre-commit run -a
Expand Down Expand Up @@ -126,7 +124,6 @@ shell-frontend:
$(KUBECTL_EXEC_FRONTEND)
{% endif %}

.PHONY: secure
secure: ## Analyze dependencies for security issues
$(KUBECTL_EXEC_BACKEND) -c "safety check"

Expand Down Expand Up @@ -162,6 +159,15 @@ prod-secrets: ## Create sealed secrets for prod
debug-prod-secrets: ## Create sealed secrets for prod
$(MAKE) secrets ENVIRONMENT=prod DEBUG=true

ensure-uv:
@which uv >/dev/null 2>&1 || { echo "Installing uv..."; curl -LsSf https://astral.sh/uv/install.sh | sh; }

docs: ensure-uv ## Build the Docs
uvx --with mkdocs-material --with mkdocs-mermaid2-plugin mkdocs build

serve-docs: ensure-uv ## Serve the Docs
uvx --with mkdocs-material --with mkdocs-mermaid2-plugin mkdocs serve -a localhost:8001

## Help

help: ## Show the list of all the commands and their help text
Expand All @@ -172,6 +178,6 @@ help: ## Show the list of all the commands and their help text
/^## .*/ {match($$0, "## (.+)$$"); txt=substr($$0,4,RLENGTH);printf "\n\033[33m%s\033[0m\n", txt ; target=""} \
' $(MAKEFILE_LIST)

.PHONY: help build build-dev outdated pipdeptree compile destroy-data load-dump clean clean-dev squeaky_clean update check-sandbox-release check-staging-release check-prod-release
.PHONY: help check-lint-and-formatting ci ensure-uv secure build build-dev outdated pipdeptree compile destroy-data load-dump clean clean-dev squeaky_clean update check-sandbox-release check-staging-release check-prod-release

.DEFAULT_GOAL := help
43 changes: 43 additions & 0 deletions {{cookiecutter.project_slug}}/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
site_name: {{ cookiecutter.project_name }}

plugins:
- search:
separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
- mermaid2:
version: '11.4.1'

theme:
name: material
palette:
- media: "(prefers-color-scheme)"
toggle:
icon: material/link
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/toggle-switch
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: indigo
toggle:
icon: material/toggle-switch-off
name: Switch to system preference
font:
text: Roboto
code: Roboto Mono

markdown_extensions:
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
Loading