Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Roles cannot be checked as they are not defined #925

Open
brotkrueml opened this issue Mar 14, 2024 · 1 comment
Open

[Bug]: Roles cannot be checked as they are not defined #925

brotkrueml opened this issue Mar 14, 2024 · 1 comment
Assignees
Labels
bug Something isn't working triage

Comments

@brotkrueml
Copy link
Contributor

brotkrueml commented Mar 14, 2024

Summary

Roles, like

:sql:`SELECT * FROM table`

are not defined, so typos or unsupported roles cannot be warned about, like (mind the g instead the q):

:sgl:`SELECT * FROM table`

In Sphinx, custom roles have to be defined:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#inline-code-highlighting

On rendering, Sphinx displays an error about an unknown role:

 ERROR: Unknown interpreted text role "sgl".

This way, the user can spot the error and correct it.

Guides holds no definition of custom roles and therefore cannot warn about it.

@jaapio
Copy link
Member

jaapio commented Aug 29, 2024

@linawolf it looks like the \phpDocumentor\Guides\RestructuredText\TextRoles\DefaultTextRoleFactory we do collect the roles that are known by the parser. I think we can use trigger a warning when we fall back to the generic role. But that seems not always valid to me as you can set the default role via a directive. Which makes this expected behavior. On the other hand it would be nice if we could detect typo's what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants