canonical / canonical/pydantic-kitbash
`literalref` role doesn't work with autogenerated heading targets
- Dominant language
- Python
- Stars
- 3
- Forks
- 2
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 9
Description
## Situation
Automatically-generated heading targets referenced by the `ref` role don't render as links with the `literalref` role.
I suspect this is the role's fault, but we should determine if it's something in Kitbash first.
## Steps to reproduce
On any of our apps, try:
```rst
.. _test-page:
Test page
=========
.. kitbash-field:: craft_application.models.Project name
The :ref:`test-page-name` key.
The :literalref:`test-page-name` key.
```
Result:
> ## Test page
>
> ### name
>
> ...
>
> The [name](#name) key.
>
> The `test-page-name` key.
## Environment
I tested using the current Rockcraft stack and the standalone sphinx-roles extension, too.
Contributor guide
Research direction
Start by reproducing the issue with the provided reStructuredText example in both the Kitbash apps and the standalone sphinx-roles extension. Trace the literalref role and Kitbash's autogenerated heading targets to determine which component prevents the link, then verify that `:literalref:`test-page-name`` renders as a link like `:ref:` does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100