Skip to content

Map Sphinx admonition classes so warnings convert to MyST - #99

Open
BetterAndBetterII wants to merge 2 commits into
executablebooks:mainfrom
BetterAndBetterII:fix/admonitions-97
Open

BetterAndBetterII wants to merge 2 commits into
executablebooks:mainfrom
BetterAndBetterII:fix/admonitions-97

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Summary

With Sphinx enabled (the default), .. warning:: and the other standard admonitions were wrapped in {eval-rst} instead of becoming MyST admonition directives.

Sphinx 8.2+ registers its own classes under sphinx.directives.admonitions.*. The conversion map only listed the older docutils.parsers.rst.directives.admonitions.* paths, so those directives fell through to eval_rst.

Fix

Add matching parse_content / parse_all entries for the Sphinx admonition classes (including SeeAlso).

Test

  • tests/test_admonitions.py injects a Sphinx-module-path Warning stand-in and asserts the MyST {warning} form (not {eval-rst}).

Fixes #97

BetterAndBetterII and others added 2 commits September 1, 2026 14:36
Sphinx replaced docutils admonition directive classes, so the default
conversion map missed them and fell back to eval-rst. Fixes executablebooks#97.
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.

Admonitions not parsed

1 participant