diff --git a/vizro-ai/.readthedocs.yaml b/vizro-ai/.readthedocs.yaml index 1a5e1e5ce..50675a2d8 100644 --- a/vizro-ai/.readthedocs.yaml +++ b/vizro-ai/.readthedocs.yaml @@ -11,6 +11,6 @@ build: python: "3.11" commands: - pip install hatch - - cd vizro-ai/ && hatch run docs:mkdocs build --strict + - cd vizro-ai/ && hatch run docs:build && hatch run docs:link-check - mkdir --parents $READTHEDOCS_OUTPUT - mv vizro-ai/site/ $READTHEDOCS_OUTPUT/html diff --git a/vizro-ai/hatch.toml b/vizro-ai/hatch.toml index 41a67352b..3984b23c5 100644 --- a/vizro-ai/hatch.toml +++ b/vizro-ai/hatch.toml @@ -51,7 +51,13 @@ dependencies = [ "mkdocstrings[python]" ] detached = true -scripts = {serve = "mkdocs serve --strict"} + +[envs.docs.scripts] +serve = "mkdocs serve --strict" +build = "mkdocs build --strict" +# Disable warnings on the linkcheck so that HTTP redirects are accepted. We could ignore only that warning and specify +# more advanced settings using a linkcheckerrc config file. +link-check = "linkchecker site --check-extern --no-warnings --ignore=404.html --ignore-url=127.0.0.1" [envs.lint] dependencies = [ diff --git a/vizro-core/.readthedocs.yaml b/vizro-core/.readthedocs.yaml index fac29cb51..ef53d5cc8 100644 --- a/vizro-core/.readthedocs.yaml +++ b/vizro-core/.readthedocs.yaml @@ -11,6 +11,6 @@ build: python: "3.11" commands: - pip install hatch - - cd vizro-core/ && hatch run docs:mkdocs build --strict + - cd vizro-ai/ && hatch run docs:build && hatch run docs:link-check - mkdir --parents $READTHEDOCS_OUTPUT - mv vizro-core/site/ $READTHEDOCS_OUTPUT/html diff --git a/vizro-core/hatch.toml b/vizro-core/hatch.toml index 2612954b4..cc379e372 100644 --- a/vizro-core/hatch.toml +++ b/vizro-core/hatch.toml @@ -69,7 +69,13 @@ dependencies = [ "mkdocstrings[python]" ] detached = true -scripts = {serve = "mkdocs serve --strict"} + +[envs.docs.scripts] +serve = "mkdocs serve --strict" +build = "mkdocs build --strict" +# Disable warnings on the linkcheck so that HTTP redirects are accepted. We could ignore only that warning and specify +# more advanced settings using a linkcheckerrc config file. +link-check = "linkchecker site --check-extern --no-warnings --ignore=404.html --ignore-url=127.0.0.1" [envs.lint] dependencies = [