Skip to content

Commit c4755c7

Browse files
authored
DOC: Fixing lychee links (#553)
1 parent be48bc0 commit c4755c7

File tree

2 files changed

+16
-29
lines changed

2 files changed

+16
-29
lines changed

.github/workflows/tests.yml

+11-29
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- 'v*'
88
pull_request:
99

10+
env:
11+
PY_COLORS: 1
12+
FORCE_COLOR: True
13+
1014
jobs:
1115
pre-commit:
1216
runs-on: ubuntu-latest
@@ -75,9 +79,15 @@ jobs:
7579
run: |
7680
python -m pip install --upgrade pip
7781
pip install -e .[doc]
78-
- name: Build documentation
82+
83+
- name: Check for broken links
84+
run: >
85+
sphinx-build -b linkcheck docs docs/_build/linkcheck
86+
87+
- name: Build documentation to audit
7988
run: >
8089
sphinx-build -b html docs docs/_build/html -w warnings.txt
90+
8191
- name: Check that there are no unexpected warnings
8292
shell: python
8393
run: |
@@ -87,34 +97,6 @@ jobs:
8797
unexpected = [ii for ii in text.split("\n") if "kitchen-sink" not in ii]
8898
assert len(unexpected) == 0
8999
90-
# Ref: https://github.com/lycheeverse/lychee-action
91-
# Excluded files:
92-
# - nature.com: DOI redirect works but errors anyway
93-
# - doi.org: DOI redirect works but errors anyway
94-
# - yahoo.com: Kitchen sink redirect we don't control
95-
# - someurl: dummy url
96-
# - mailto: fails test but works for people
97-
# - pathto(: because the pydata theme packages invalid HTML w/ this in it
98-
# - mybinder.org: because Binder sometimes incorrectly doesn't respond
99-
# - github.com/search: because GitHub search results return a network error
100-
- name: Check for broken links
101-
id: lychee
102-
uses: lycheeverse/[email protected]
103-
env:
104-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
105-
with:
106-
fail: true
107-
args: >
108-
'./docs/_build/html/**/*.html'
109-
--exclude 'nature.com'
110-
--exclude 'doi.org'
111-
--exclude 'yahoo.com'
112-
--exclude 'someurl'
113-
--exclude 'mailto:docutils-develop'
114-
--exclude 'pathto\('
115-
--exclude 'mybinder.org'
116-
--exclude 'github.com/search'
117-
118100
- name: Audit with Lighthouse
119101
uses: treosh/[email protected]
120102
with:

docs/conf.py

+5
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@
145145
bibtex_reference_style = "author_year"
146146
bibtex_default_style = "plain"
147147

148+
linkcheck_ignore = [
149+
"http://someurl/release", # This is a fake link
150+
"https://doi.org", # These don't resolve properly and cause SSL issues
151+
]
152+
148153
# -- Download kitchen sink reference docs -------------------------------------
149154
# These are the kitchen sink files used by the Sphinx Themes gallery at
150155
# https://github.com/sphinx-themes/sphinx-themes.org

0 commit comments

Comments
 (0)