From 6015bab80e28aef2669f6fac53423aa65f70cb08 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 28 Feb 2023 13:14:51 +0100 Subject: 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 --- docs/make.bat | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/make.bat') 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 -- cgit v1.3