From 882fc5d009f0735661a9df68d54bf703c0120a6b Mon Sep 17 00:00:00 2001 From: Michael Devin Date: Thu, 26 Oct 2023 10:40:37 -0600 Subject: [PATCH] Remove linkcheck (#287) * linkcheck failures now only issue warnings * added blurb recommending to check CI workflow for linkcheck warnings --- .github/CONTRIBUTING.md | 15 ++------------- docs/build_docs.py | 2 +- docs/source/conf.py | 20 -------------------- 3 files changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d6ddbcc2..45eed855 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -76,20 +76,9 @@ The documentation uses the Jupyter notebook tutorials in the `examples` director When building the documentation locally you will need to have installed [pandoc](https://pandoc.org/installing.html) and [gifsicle](https://github.com/kohler/gifsicle). We recommend installing pandoc using its Anaconda distribution: `conda install -c conda-forge pandoc`. -**NOTE:** it may be expedient at times to: +**NOTE:** it may be expedient at times to avoid running the tutorial notebooks. To do so, add [`nbsphinx_execute = 'never'`](https://nbsphinx.readthedocs.io/en/0.9.3/configuration.html#nbsphinx_execute) to `docs/source/conf.py`. Make sure not to commit these changes! - 1. **Avoid running the tutorial notebooks:** Add [`nbsphinx_execute = 'never'`](https://nbsphinx.readthedocs.io/en/0.9.3/configuration.html#nbsphinx_execute) to `docs/source/conf.py` - 2. **Disable the link check operation:** Comment out the `linkcheck` call in `docs/build_docs.py` - -```python -if __name__ == '__main__': - source.make_theory_animations - # linkcheck() - html() - cleanup() -``` - -Make sure not to commit these changes! +If you add or change any hyperlinks in the documentation, we recommend checking the "Build documentation" warnings in the GitHub Actions CI workflow to make sure the links will not cause an issue. The CI will not fail due to broken links, only issue a warning (see [issue #286](https://github.com/sandialabs/WecOptTool/issues/286)). ### Editing the tutorials The tutorials are used as part of the Documentation. diff --git a/docs/build_docs.py b/docs/build_docs.py index 9db9bae0..75bff616 100644 --- a/docs/build_docs.py +++ b/docs/build_docs.py @@ -18,7 +18,7 @@ def linkcheck(): linkcheck_dir, doctree_dir, 'linkcheck', - warningiserror=True) + warningiserror=False) app.build() diff --git a/docs/source/conf.py b/docs/source/conf.py index ef13e3ec..25393074 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -57,26 +57,6 @@ def setup(app): 'app.add_directive', 'app.add_role',] -linkcheck_ignore = [ - 'https://github.com/HIPS/autograd/blob/master/docs/tutorial.md#', - 'https://doi.org/10.2172/1330189', - 'https://sandialabs.github.io/WecOptTool/*', - 'https://doi.org/10.1080/17445302.2015.1089052', - 'https://digitalops.sandia.gov/*', -] - -linkcheck_request_headers = { - 'https://doi.org/10.1109/TSTE.2014.2371536': { - 'User-Agent': 'my-app/0.0.1' - }, - 'https://doi.org/10.1109/9.467672': { - 'User-Agent': 'my-app/0.0.1' - }, - 'https://doi.org/10.1109/TSTE.2023.3272868': { - 'User-Agent': 'my-app/0.0.1' - }, -} - # -- References (BibTex) ----------------------------------------------------- bibtex_bibfiles = ['wecopttool_refs.bib'] bibtex_encoding = 'utf-8-sig'