Skip to content

DOC: Fixing lychee links #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 11 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'v*'
pull_request:

env:
PY_COLORS: 1
FORCE_COLOR: True

jobs:
pre-commit:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,9 +79,15 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e .[doc]
- name: Build documentation

- name: Check for broken links
run: >
sphinx-build -b linkcheck docs docs/_build/linkcheck

- name: Build documentation to audit
run: >
sphinx-build -b html docs docs/_build/html -w warnings.txt

- name: Check that there are no unexpected warnings
shell: python
run: |
Expand All @@ -87,34 +97,6 @@ jobs:
unexpected = [ii for ii in text.split("\n") if "kitchen-sink" not in ii]
assert len(unexpected) == 0

# Ref: https://github.com/lycheeverse/lychee-action
# Excluded files:
# - nature.com: DOI redirect works but errors anyway
# - doi.org: DOI redirect works but errors anyway
# - yahoo.com: Kitchen sink redirect we don't control
# - someurl: dummy url
# - mailto: fails test but works for people
# - pathto(: because the pydata theme packages invalid HTML w/ this in it
# - mybinder.org: because Binder sometimes incorrectly doesn't respond
# - github.com/search: because GitHub search results return a network error
- name: Check for broken links
id: lychee
uses: lycheeverse/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
fail: true
args: >
'./docs/_build/html/**/*.html'
--exclude 'nature.com'
--exclude 'doi.org'
--exclude 'yahoo.com'
--exclude 'someurl'
--exclude 'mailto:docutils-develop'
--exclude 'pathto\('
--exclude 'mybinder.org'
--exclude 'github.com/search'

- name: Audit with Lighthouse
uses: treosh/[email protected]
with:
Expand Down
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@
bibtex_reference_style = "author_year"
bibtex_default_style = "plain"

linkcheck_ignore = [
"http://someurl/release", # This is a fake link
"https://doi.org", # These don't resolve properly and cause SSL issues
]

# -- Download kitchen sink reference docs -------------------------------------
# These are the kitchen sink files used by the Sphinx Themes gallery at
# https://github.com/sphinx-themes/sphinx-themes.org
Expand Down