opensafely / documentation

Documentation for the OpenSAFELY platform
https://docs.opensafely.org
Other
32 stars 4 forks source link
non-research opensafely

OpenSAFELY Documentation

This is the public documentation for using the OpenSAFELY platform.

It provides information on how to get set up with and use the platform.

Automated checks

We have some automated checks that help us maintain the documentation.

These are not enforced for new contributions, but can be run by GitHub Actions.

Content style checks

We have a small number of style rules written for the Vale style checker.

The purpose of these checks is to help keep our documentation more consistent, even when multiple authors are working on it.

If these style checks prove useful, we could expand on these into a more fully featured style guide.

The rules are stored in the styles directory. The rules are written in YAML. See Vale's documentation for more information on Vale rules.

These checks are not scheduled and are run manually via GitHub Actions.

URL validity checks

To help keep the content up-to-date, there is a scheduled weekly link check run with the lychee link checker. Failure notifications go to Slack.

This URL check detects URLs whose resources are not accessible.

The URL check can also be run manually via GitHub Actions.

Finding URLs that fail the link check

  1. Review the failed workflow output by opening the workflow runs page and clicking on the failed run to see a summary.
  2. The summary lists any URLs that failed the check. URLs might fail for one of several reasons detailed below.

Dealing with URLs that fail the link check

Transient and persistent failures

Some URL checks may fail transiently, due to a GitHub Actions runner issue or an outage at the resource that the URL points to. When checking again later, the link check may pass.

To resolve a persistent link check failure for a URL requires:

Resolving persistent failures

Make any changes in a branch; it is possible to manually run the link checking workflow on a branch from the Actions tab. When you are satisfied that you have resolved the link check failures, open a pull request with your fixes.

It is worth checking whether failed URLs can be viewed in a browser via a fresh private/incognito browsing session.

This is a non-exhaustive list of common failures and how you might address them:

Adding a URL to .lycheeignore

Replacing inaccessible URLs

There are several options for dealing with a URL that is really no longer publicly accessible, even to real browsers, and will not be in future.

When changing a URL, you may need to ask someone who knows about the specific content for a replacement suggestion.

  1. If the information is still relevant, check if the Internet Archive has a usable, saved copy of the page and use the Internet Archive's version instead:
    • Depending on the context, often you probably want the latest version saved.
    • In some cases, you might favour using the version closest in time to when the original content was written.
  2. Find a suitable replacement URL:
    • on the same site
      • It might be that the content or resource has moved to a different place on the same site.
    • on another site
      • It might be that the content or resource has moved to a different site owned by the same organisation.
      • It might also be that an entirely different organisation now has a more relevant resource or content.
  3. Remove the URL entirely and consider rewriting the surrounding text.
Reviewing surrounding text

In all cases, when replacing URLs, review the immediate and surrounding text too. Small text edits may also be required to reflect changes in the linked resource.