mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
The idea here is that there is a single file for the nav for all the docs, both online and offline. The nav will be the full online nav in all its blog glory, and then the build system will strip out the nav items relating to the blog when building the offline version. There's a wrinkle or two still in here; the main one being that when doing a docs-serve, it seems that the cleaning up of the online nav doesn't happen when you Ctrl-C out of the server. I'm not 100% sure of the cause of this (there could be a couple of different reasons). For now... I'm ensuring that the online/offline nav files are excluded from git. It would be nice to find out how best to always ensure that the online nav file is removed so nobody attempting to update the docs gets confused about what to edit.
70 lines
1.6 KiB
Makefile
70 lines
1.6 KiB
Makefile
run := poetry run
|
|
|
|
.PHONY: test
|
|
test:
|
|
$(run) pytest --cov-report term-missing --cov=textual tests/ -vv
|
|
|
|
.PHONY: unit-test
|
|
unit-test:
|
|
$(run) pytest --cov-report term-missing --cov=textual tests/ -vv -m "not integration_test"
|
|
|
|
.PHONY: test-snapshot-update
|
|
test-snapshot-update:
|
|
$(run) pytest --cov-report term-missing --cov=textual tests/ -vv --snapshot-update
|
|
|
|
.PHONY: typecheck
|
|
typecheck:
|
|
$(run) mypy src/textual
|
|
|
|
.PHONY: format
|
|
format:
|
|
$(run) black src
|
|
|
|
.PHONY: format-check
|
|
format-check:
|
|
$(run) black --check src
|
|
|
|
.PHONY: clean-screenshot-cache
|
|
clean-screenshot-cache:
|
|
rm -rf .screenshot_cache
|
|
|
|
.PHONY: docs-offline-nav
|
|
docs-offline-nav:
|
|
echo "INHERIT: mkdocs-offline.yml" > mkdocs-nav-offline.yml
|
|
grep -v "\- \"*[Bb]log" mkdocs-nav.yml >> mkdocs-nav-offline.yml
|
|
|
|
.PHONY: docs-online-nav
|
|
docs-online-nav:
|
|
echo "INHERIT: mkdocs-online.yml" > mkdocs-nav-online.yml
|
|
cat mkdocs-nav.yml >> mkdocs-nav-online.yml
|
|
|
|
.PHONY: docs-serve
|
|
docs-serve: clean-screenshot-cache docs-online-nav
|
|
$(run) mkdocs serve --config-file mkdocs-nav-online.yml
|
|
rm -f mkdocs-nav-online.yml
|
|
|
|
.PHONY: docs-build
|
|
docs-build: docs-online-nav
|
|
$(run) mkdocs build --config-file mkdocs-nav-online.yml
|
|
rm -f mkdocs-nav-online.yml
|
|
|
|
.PHONY: docs-build-offline
|
|
docs-build-offline: docs-offline-nav
|
|
$(run) mkdocs build --config-file mkdocs-nav-offline.yml
|
|
rm -f mkdocs-nav-offline.yml
|
|
|
|
.PHONY: clean-offline-docs
|
|
clean-offline-docs:
|
|
rm -rf docs-offline
|
|
|
|
.PHONY: docs-deploy
|
|
docs-deploy: clean-screenshot-cache
|
|
$(run) mkdocs gh-deploy
|
|
|
|
.PHONY: build
|
|
build: docs-build-offline
|
|
poetry build
|
|
|
|
.PHONY: clean
|
|
clean: clean-screenshot-cache clean-offline-docs
|