mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
The key issue this commit seeks to address, is that existing tools / documentation often lead users to mistakenly use object types and not role names, a classic example being `function` not `func` Previously, the warning message for using e.g. `` external:function`target` `` (with `py` as the default domain), would be: ``` WARNING: role for external cross-reference not found: function ``` This gives no information to the user on how to fix the issue, even though there is actually quite an easy fix This commit adds logic to create more specific / helpful warning messages, e.g. ``` WARNING: role for external cross-reference not found in domains 'py', 'std': 'function' (perhaps you meant one of: 'py:func', 'py:obj') ``` This goes through the same original logic but, if the role is not found, it will look if the role name is actually an available object type on the domain(s), and then suggest its related roles. This commit also reverts #12133, which provided a (silent) fallback to auto convert an object type to a role name. |
||
---|---|---|
.. | ||
conf.py | ||
index.rst |