-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Code blocks with a way to cross-reference library entities #11389
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
Something like this would work for your use case? https://sphinx-codeautolink.readthedocs.io/en/latest/ |
@humitos I think the extension you linked is only for Python-like code since it uses an Python AST approach. |
The extension docs also imply that it's Python only (but it is good to know that other people want this enough to write an extension!). |
I think this is very reasonable, the challenge would be implementing a lexer to run over code blocks, though likely a lot of the machinery exists already as of the support for object description directives. Do you happen to know how the C++ reference implement their functionality? A |
cppreference uses MediaWiki for its backend, and I think this page is how their code blocks are implemented. Something interesting to note is that in using std::cout; // (1)
cout << x; // (2) (1) forms a link to std::cout << "Hello, world!\n"; // links
std::cout << "Goodbye, world!\n"; // doesn't link |
Is your feature request related to a problem? Please describe.
I use
code-block:: cpp
to demonstrate how features in work quite extensively, and it would be beneficial for readers to be able to click on the entities that are mentioned and go to the page that references them (if they're available).Describe the solution you'd like
The example section of cppreference's
std::array
page is a good example of what I'd like. Notice that it's possible to click onstd::string
, which takes you through to thestd::string
documentation page.The text was updated successfully, but these errors were encountered: