-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Change cite to literal text #3866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!
The documentation for :samp:
says this:
A piece of literal text, such as code. Within the contents, you can use curly braces to indicate a “variable” part,
as in [file](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-file).
For example, in :samp:`print 1+{variable}`, the part variable would be emphasized: print 1+variable
If you don’t need the “variable part” indication,
use the standard [code](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-code) role instead.
:samp:
and :code:
seem to generate nearly identical HTML in the end. I'm on the fence about it, since using :code:
is kind of weird here. Any thoughts on which way we should go?
I explored the Sphinx documentation and couldn't find a dedicated role for citations. However, while reviewing the quote blocks, I stumbled upon a workaround. By using the
This approach maintains the indentation that was used in the numbered list to distinguish it from regular text. Postscript: I have added syntax highlighting for citations in BibTeX. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Thanks for iterating there.
I've left one more minor set of changes (to switch to ASCII quotes, which we use almost everywhere else), and then I'm happy with this.
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good now. I'll go ahead and merge it.
* Change cite to literal text * Add bibtex syntax highlight and blockquote with line break preservation * Switch left and right quotes to ASCII quotes Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit a361bcd)
* Change cite to literal text * Add bibtex syntax highlight and blockquote with line break preservation * Switch left and right quotes to ASCII quotes Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit a361bcd)
* Change cite to literal text * Add bibtex syntax highlight and blockquote with line break preservation * Switch left and right quotes to ASCII quotes Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit a361bcd) Co-authored-by: Cristian Chitiva <cychitivav@unal.edu.co>
* Change cite to literal text * Add bibtex syntax highlight and blockquote with line break preservation * Switch left and right quotes to ASCII quotes Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit a361bcd) Co-authored-by: Cristian Chitiva <cychitivav@unal.edu.co>
Add
:samp
role to improve copy-paste (Before, Sphinx detected theS.
for Steven Macenski as a numbered list)Before:
![image](https://private-user-images.githubusercontent.com/30636259/263531709-78755ede-75d6-4528-bf0c-263d0ecf14e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxNzM4MDEsIm5iZiI6MTcyMjE3MzUwMSwicGF0aCI6Ii8zMDYzNjI1OS8yNjM1MzE3MDktNzg3NTVlZGUtNzVkNi00NTI4LWJmMGMtMjYzZDBlY2YxNGU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI4VDEzMzE0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEzMGQ2MTc2NmEzN2ZmNmJmMDc0MGI5MTljMTI1MTg1ZTZmMDgzYWRkZDM3OTZlZGQ0MTE4OGVkOTI1OTkxY2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.TzJ9FvoSUonWoEINLCs-ZjDm-lFvvy_TAP_z3CaFpKY)
Now:
![image](https://private-user-images.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