Update Sphinx
- Bump versions in requirements.txt
Remove sphinx docs which were duplicated everywhere, refer to ONF main
docs site which is more complete.
Replace logo with SVG version
- Was a WebP saved as .png which broke in some browsers.
- Shift logo to sidebar, as in all other docs sites.
Cleanup Makefile
Change how the dict.txt sorter works
- Only check the dict.txt for changes
- Give human-intelligible results
Add correct licensing info for fonts
Add code of conduct and link
Change-Id: Ie4334cfea826e348eca4c93ed62a3633b33ad87c
diff --git a/Makefile b/Makefile
index 79f2f4b..2accb01 100644
--- a/Makefile
+++ b/Makefile
@@ -13,9 +13,9 @@
BUILDDIR ?= _build
# name of python virtualenv that is used to run commands
-VENV_NAME := venv-docs
+VENV_NAME := venv-docs
-.PHONY: help test lint doc8 reload Makefile prep format format-dict
+.PHONY: help Makefile test doc8 dict-check sort-dict license clean clean-all
# Put it first so that "make" without argument is like "make help".
help: $(VENV_NAME)
@@ -24,34 +24,26 @@
# Create the virtualenv with all the tools installed
$(VENV_NAME):
- python3 -m venv $(VENV_NAME) ;\
+ python3 -m venv $@ ;\
source $@/bin/activate ;\
pip install -r requirements.txt
-# automatically reload changes in browser as they're made
-reload: $(VENV_NAME)
- source $</bin/activate ; set -u ;\
- sphinx-reload $(SOURCEDIR)
-
# lint and link verification. linkcheck is part of sphinx
-test: lint spelling linkcheck dict-check
+test: license doc8 dict-check spelling linkcheck
-lint: doc8
-
-doc8: $(VENV_NAME) | $(OTHER_REPO_DOCS)
+doc8: $(VENV_NAME)
source $</bin/activate ; set -u ;\
- doc8 --max-line-length 119 \
- $$(find . -name \*.rst ! -path "*venv*" ! -path "*vendor*" ! -path "*repos*" )
+ doc8 --ignore-path $< --ignore-path _build --ignore-path LICENSES --max-line-length 119
# Words in dict.txt must be in the correct alphabetical order and must not duplicated.
-dict-check: format-dict
- @git update-index --refresh
+dict-check: sort-dict
+ @set -u ;\
+ git diff --exit-code dict.txt && echo "dict.txt is sorted" && exit 0 || \
+ echo "dict.txt is unsorted or needs to be added to git index" ; exit 1
-format: format-dict
-
-format-dict:
- @cat dict.txt | sort -u > /tmp/sorted.txt
- @mv /tmp/sorted.txt dict.txt
+sort-dict:
+ @sort -u < dict.txt > dict_sorted.txt
+ @mv dict_sorted.txt dict.txt
license: $(VENV_NAME)
source $</bin/activate ; set -u ;\
@@ -73,6 +65,6 @@
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
-%: $(VENV_NAME) Makefile | $(OTHER_REPO_DOCS) $(STATIC_DOCS)
+%: $(VENV_NAME) Makefile
source $</bin/activate ; set -u ;\
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)