From c196d406d4900ce6c4cec2b346d9f9b5892eeff0 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 18 Feb 2024 16:12:15 +0100 Subject: [PATCH] nix: Make postgrest-watch postgrest-docs-check work This moves the _build folder into the repo root, to avoid postgrest-watch ending in an infinite loop of restarting the build. Also, for repeated use during development, running linkcheck is not a good idea, this will quickly result in rate-limiting requests from various servers. --- .gitignore | 1 + docs/.gitignore | 1 - nix/tools/docs.nix | 27 +++++++++++++-------------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 7bfb879c9..49b3be51b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ coverage .hpc loadtest .history +.docs-build diff --git a/docs/.gitignore b/docs/.gitignore index f0ad786fb..73dceabf7 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,4 +1,3 @@ -_build Pipfile.lock *.aux *.log diff --git a/nix/tools/docs.nix b/nix/tools/docs.nix index fc20a9e5f..c1d631d54 100644 --- a/nix/tools/docs.nix +++ b/nix/tools/docs.nix @@ -35,24 +35,24 @@ let if [ "$_arg_language" == "" ]; then # clean previous build, otherwise some errors might be supressed - rm -rf "_build/html/default" + rm -rf "../.docs-build/html/default" if [ -d languages ]; then # default to updating all existing locales - build gettext _build/gettext - ${python}/bin/sphinx-intl update -p _build/gettext + build gettext ../.docs-build/gettext + ${python}/bin/sphinx-intl update -p ../.docs-build/gettext fi - build html "_build/html/default" + build html "../.docs-build/html/default" else # clean previous build, otherwise some errors might be supressed - rm -rf "_build/html/$_arg_language" + rm -rf "../.docs-build/html/$_arg_language" # update and build specific locale, can be used to create new locale - build gettext _build/gettext - ${python}/bin/sphinx-intl update -p _build/gettext -l "$_arg_language" + build gettext ../.docs-build/gettext + ${python}/bin/sphinx-intl update -p ../.docs-build/gettext -l "$_arg_language" - build html "_build/html/$_arg_language" -D "language=$_arg_language" + build html "../.docs-build/html/$_arg_language" -D "language=$_arg_language" fi ''; @@ -78,7 +78,7 @@ let server = Server() server.watch("**/*.rst", shell(build)) server.watch(f"locales/{locale}/LC_MESSAGES/*.po", shell(build)) - server.serve(root=f"_build/html/{locale}") + server.serve(root=f"../.docs-build/html/{locale}") ''; serve = @@ -139,7 +139,7 @@ let workingDir = "/docs"; } '' - ${python}/bin/sphinx-build --color -b linkcheck . _build + ${python}/bin/sphinx-build --color -b linkcheck . ../.docs-build ''; check = @@ -150,10 +150,9 @@ let workingDir = "/docs"; } '' - ${build}/bin/postgrest-docs-build - ${dictcheck}/bin/postgrest-docs-dictcheck - ${linkcheck}/bin/postgrest-docs-linkcheck - ${spellcheck}/bin/postgrest-docs-spellcheck + ${build} + ${dictcheck} + ${spellcheck} ''; in