Skip to content
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

Fix some broken fragment links #1534

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

StevenMaude
Copy link
Contributor

@StevenMaude StevenMaude commented May 29, 2024

Partially deals with #1500.

This PR fixes the fragment links that we can fix.

Of those that remain, there are three classes that are all probably limitations of how lychee detects fragments:

  • most links are in ehrQL's autogenerated documentation
    • from a quick look at one or two, these are probably OK, but there is something blocking correct autodetection of the links (see Check anchor links #1500 for more)
  • the link to opensafely-cli.md#jupyter-running-jupyterlab is correct but not correctly detected
    • likely because of how lychee generates the expected headings and there being backtick formatting in this heading
  • the link to study-def-variables.md#cohortextractor.patients.satisfying is correct but not correctly detected
    • because the content is added in by mkdocstrings at build-time and the link is not in the Markdown source

Note that this means we can't easily add in the --include-fragments option to lychee, unless we manually exclude these links. Otherwise the check will always fail.

@StevenMaude
Copy link
Contributor Author

For reference, these are the failures that remain.

Errors per input
Errors in docs/ehrql/how-to/dummy-measures-data.md

    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/how-to/dummy-data.md#supply-your-own-dummy-data | Failed: Cannot find fragment

Errors in docs/ehrql/explanation/measures.md

    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#Measures.define_defaults | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#BoolPatientSeries | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#weeks.starting_on | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#months.starting_on | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#Measures.configure_dummy_data | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/cli.md#generate-measures | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#Measures.define_measure | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#years.starting_on | Failed: Cannot find fragment

Errors in docs/reports/intro.md

    [ERR] file:///home/runner/work/documentation/documentation/docs/opensafely-cli.md#jupyter-running-jupyterlab | Failed: Cannot find fragment

Errors in docs/study-def.md

    [ERR] file:///home/runner/work/documentation/documentation/docs/study-def-variables.md#cohortextractor.patients.satisfying | Failed: Cannot find fragment

Errors in docs/ehrql/how-to/define-population.md

    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/language.md#BoolPatientSeries.and | Failed: Cannot find fragment

Errors in docs/ehrql/reference/language.md

    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/schemas/core.md#patients | Failed: Cannot find fragment

Errors in docs/ehrql/how-to/test-dataset-definition.md

    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/cli.md#assure | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/schemas/core.md#patients | Failed: Cannot find fragment
    [ERR] file:///home/runner/work/documentation/documentation/docs/ehrql/reference/schemas/core.md#medications | Failed: Cannot find fragment

Copy link
Contributor

@LFISHER7 LFISHER7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing these @StevenMaude!

@StevenMaude StevenMaude merged commit cd1d970 into main Jun 5, 2024
2 checks passed
@StevenMaude StevenMaude deleted the steve/fix-some-broken-fragment-links branch June 5, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants