summaryrefslogtreecommitdiff
path: root/docs/Makefile
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-02-28 13:14:51 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-03-01 13:02:57 +0100
commit6015bab80e28aef2669f6fac53423aa65f70cb08 (patch)
treeb0a8eabf00294f3b85868fd79931de2f02d5b4b9 /docs/Makefile
parent9cf2a5df70051dffcefe21c6b27203e2d5804922 (diff)
Refs #34140 -- Added configurations to run blacken-docs linter and adjusted docs.
This adds: - GitHub actions, - tox configuration, - pre-commit hook, and - makefile rules to run blacken-docs linter. Co-authored-by: David Smith <smithdc@gmail.com>
Diffstat (limited to 'docs/Makefile')
-rw-r--r--docs/Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/Makefile b/docs/Makefile
index 2b44830531..d97a7ff07c 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -49,6 +49,7 @@ help:
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " spelling to check for typos in documentation"
+ @echo " black to apply the black formatting to code blocks in documentation"
clean:
@@ -165,3 +166,10 @@ spelling:
@echo
@echo "Check finished. Wrong words can be found in " \
"$(BUILDDIR)/spelling/output.txt."
+
+black:
+ @mkdir -p $(BUILDDIR)/black
+ find -name "*.txt" -not -path "./_build/*" -not -path "./_theme/*" \
+ | xargs blacken-docs --rst-literal-block; echo $$? > "$(BUILDDIR)/black/output.txt"
+ @echo
+ @echo "Code blocks reformatted"