-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add a way to cross-reference code in prose text #11430
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
Comments
Does using custom CSS styling help? I defined a file code.cpp-type > .pre {
font-style: normal;
font-family: roman;
font-weight: normal;
/*text-decoration: underline*/
} as a test and it appears to work (with default (but this is limited to html builds) |
Won't this apply to all |
Yes you do need a novel role for your task. |
I'll probably make an extension for this soonish (it's not a high priority). Would there be any concerns with upstreaming the roles? I'd make them for all supported languages in that case, not just C++. |
A thought -- could you use a custom interpreted text role and add xref: https://docutils.sourceforge.io/docs/ref/rst/directives.html#custom-interpreted-text-roles A |
Additionally -- I believe that using texpr should work in general -- are there cases in C++ where the general texpr role doesn't work and you need to use the specific roles? A |
Possibly? My plan was to copy the
I haven't come across anything yet. My understanding of texpr is that it matches names in that role against names registered with C++ directives, but I have an English sentence that needs to be linked to a |
Is your feature request related to a problem? Please describe.
It's sometimes easier to refer to a part of an API by describing it, rather than by directly naming it, but the C++ cross-reference directives only render in monospace font.
For example:
will be rendered as
Describe the solution you'd like
It should be possible to render the above as
I noticed that there's
:cpp:expr:
and:cpp:texpr:
. Perhaps there should be at
-prefixed cross-reference for all of the API cross-references (e.g.cpp:ttype
).The text was updated successfully, but these errors were encountered: