From 3173f02aa4b678aaacf7bda1f40b2ff1bff3b688 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 7 Feb 2022 22:58:37 +0300 Subject: [PATCH 1/2] Check docs links in Github Actions --- .github/workflows/sphinx.yml | 8 +++++++- Makefile | 4 ++-- docs/conf.py | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index fea526b319..95ecc1d70f 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -1,6 +1,9 @@ -name: Build Sphinx Documentation +name: Build Sphinx Documentation and check links on: + schedule: + # Weekly, at 03:00 on Monday UTC time + - cron: "0 3 * * 1" pull_request: paths: - ".github/workflows/sphinx.yml" @@ -43,3 +46,6 @@ jobs: - name: Build Documentation run: make docs + + - name: Check Documentation URLs + run: make linkcheck-docs diff --git a/Makefile b/Makefile index 2930932618..aa1fefe244 100644 --- a/Makefile +++ b/Makefile @@ -138,10 +138,10 @@ install-dev-env: ## install libraries required to build images and run tests docs: ## build HTML documentation - sphinx-build -W docs/ docs/_build/ + sphinx-build -W --keep-going docs/ docs/_build/ linkcheck-docs: ## check broken links - sphinx-build -b linkcheck docs/ docs/_build/ + sphinx-build -W --keep-going -b linkcheck docs/ docs/_build/ install-docs-env: ## install libraries required to build docs @pip install -r requirements-docs.txt diff --git a/docs/conf.py b/docs/conf.py index cb60f3f405..ab5b1270d6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -88,3 +88,15 @@ # MyST configuration reference: https://myst-parser.readthedocs.io/en/latest/sphinx/reference.html myst_heading_anchors = 3 + +linkcheck_ignore = [ + r".*github\.com.*#", # javascript based anchors + r"http://127\.0\.0\.1:49153/.*", # example + r"https://mybinder\.org/v2/gh/.*", # lots of 500 errors +] + +linkcheck_allowed_redirects = { + r"https://results\.pre-commit\.ci/latest/github/jupyter/docker-stacks/master": r"https://results\.pre-commit\.ci/run/github/.*", # Latest master CI build + r"https://github\.com/jupyter/docker-stacks/issues/new.*": r"https://github\.com/login.*", # Github wants user to be logon to use this features + r"https://github\.com/orgs/jupyter/teams/docker-image-maintainers/members": r"https://github\.com/login.*", +} From 9f7e19e9050c40be8b5d3fd7a19784b06879fdfa Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 7 Feb 2022 23:02:37 +0300 Subject: [PATCH 2/2] Add colors --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index aa1fefe244..21d004cb14 100644 --- a/Makefile +++ b/Makefile @@ -138,10 +138,10 @@ install-dev-env: ## install libraries required to build images and run tests docs: ## build HTML documentation - sphinx-build -W --keep-going docs/ docs/_build/ + sphinx-build -W --keep-going --color docs/ docs/_build/ linkcheck-docs: ## check broken links - sphinx-build -W --keep-going -b linkcheck docs/ docs/_build/ + sphinx-build -W --keep-going --color -b linkcheck docs/ docs/_build/ install-docs-env: ## install libraries required to build docs @pip install -r requirements-docs.txt