summaryrefslogtreecommitdiff
path: root/docs/make.bat
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/make.bat
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/make.bat')
-rw-r--r--docs/make.bat9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/make.bat b/docs/make.bat
index 4743692ca3..72d71136c2 100644
--- a/docs/make.bat
+++ b/docs/make.bat
@@ -35,6 +35,7 @@ if "%1" == "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
goto end
)
@@ -196,4 +197,12 @@ spelling/output.txt.
goto end
)
+if "%1" == "black" (
+ for /f "usebackq tokens=*" %%i in (`dir *.txt /s /b ^| findstr /v /c:"_build" /c:"_theme"`) do (
+ blacken-docs --rst-literal-block %%i
+ )
+ echo.
+ echo.Code blocks reformatted
+)
+
:end