Skip to content

DOC: Enable --strict on docs build to catch silent RTD breakage (fix pre-existing converter notebook link errors first) #1741

@romanlutz

Description

@romanlutz

Background

While fixing the RTD build (#1740), I observed that adding --strict to jupyter-book build would prevent silent regressions like the ones that were just fixed (broken TOC entries, missing image paths). --strict causes the build to fail if there are any ⛔️ errors in the output.

However, enabling --strict today would immediately fail the CI build because of pre-existing ⛔️ Link has no URL errors in 4 converter notebooks. These errors all come from <a id="..."></a> HTML anchor tags that MyST parses as malformed links.

Affected files

  • doc/code/converters/1_text_to_text_converters.ipynb (2 errors)
  • doc/code/converters/2_audio_converters.ipynb (3 errors)
  • doc/code/converters/3_image_converters.ipynb (2 errors)
  • doc/code/converters/4_video_converters.ipynb (1 error)

Each notebook also has paired .py files with identical issues that need to be kept in sync per docs.instructions.md.

Example of the problem

In 1_text_to_text_converters.ipynb:

- **[Non-LLM Converters](#non-llm-converters)**: Static transformations including encoding, ...
- **[LLM-Based Converters](#llm-based-converters)**: AI-powered transformations including ...

Then later:

<a id="non-llm-converters"></a>
## Non-LLM Converters

MyST reports:

⛔️ code/converters/1_text_to_text_converters.ipynb Link has no URL:
⚠️  code/converters/1_text_to_text_converters.ipynb Link text is empty for <#non-llm-converters>

The <a id="..."> HTML anchors are being parsed as <a> links with no href, which is what trips the "Link has no URL" error.

Proposed fix

Replace the <a id="..."></a> HTML anchors with MyST-native target syntax (name)= placed immediately before the heading. MyST also auto-generates implicit IDs from heading text, so the [Non-LLM Converters](#non-llm-converters) links should keep working with either approach.

Example:

(non-llm-converters)=
## Non-LLM Converters

After fixing all 4 notebooks (and their paired .py files), add --strict to the docs-build-all target in the Makefile so any future regression — broken TOC entry, missing image, malformed link — fails CI loudly instead of silently breaking RTD.

Acceptance criteria

  • Replace <a id="..."></a> anchors with (name)= MyST syntax in the 4 converter notebooks
  • Update paired .py files to match
  • Verify make docs-build reports 0 ⛔️ errors
  • Add --strict to the docs-build-all target (and possibly docs-build too)
  • Confirm the build still fails appropriately on simulated TOC / image errors

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions