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
Related
Background
While fixing the RTD build (#1740), I observed that adding
--stricttojupyter-book buildwould prevent silent regressions like the ones that were just fixed (broken TOC entries, missing image paths).--strictcauses the build to fail if there are any⛔️errors in the output.However, enabling
--stricttoday would immediately fail the CI build because of pre-existing⛔️ Link has no URLerrors 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
.pyfiles with identical issues that need to be kept in sync perdocs.instructions.md.Example of the problem
In
1_text_to_text_converters.ipynb:Then later:
MyST reports:
The
<a id="...">HTML anchors are being parsed as<a>links with nohref, 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 ConvertersAfter fixing all 4 notebooks (and their paired
.pyfiles), add--strictto thedocs-build-alltarget in theMakefileso any future regression — broken TOC entry, missing image, malformed link — fails CI loudly instead of silently breaking RTD.Acceptance criteria
<a id="..."></a>anchors with(name)=MyST syntax in the 4 converter notebooks.pyfiles to matchmake docs-buildreports 0⛔️errors--strictto thedocs-build-alltarget (and possiblydocs-buildtoo)Related