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:34:28 +0100
commit32f224e359c68e70e3f9a230be0265dcd6677079 (patch)
treef1f83e61d5f4888e3728c217b4c6c20441952914 /docs/make.bat
parent8d2ac000e43c1cfa3d331a1580525ead3d5f32d7 (diff)
[4.2.x] 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> Backport of 6015bab80e28aef2669f6fac53423aa65f70cb08 from main
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