-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Docstrings highlighting with pygments #5462
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
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.
👀s good.
QUESTION @carltongibson: looking to adding test I found that |
@nastasi-oq I think “accident of history” is probably the simplest answer. I’m happy to see a refactoring here but it might be better to handle it in two steps. This PR adding the new functionality, not worrying about duplication. Then another PR handling the refactoring. This makes each step easier to review, and complete. Sound ok to you? |
@carltongibson IMHO there are 2 options:
|
@carltongibson new PR opened to refactor |
@carltongibson for me is final. |
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.
This is lovely. Nice small footprint. Thanks for the work!
I'm glad to contribute to DRF. |
@nastasi-oq Where did this I ask because it's pretty widespread to mark code blocks in markdown with triple backticks. For example, that's how you mark code blocks here on github. |
@dmwyatt just from the example that I found (and that is credited in the code), if you think to be better change it in another syntax I'm not against. |
@carltongibson What do you think? To be clear on what I'm talking about, this PR uses a format that is not used in any other markup system that I can find. Specifically, to mark a code block with this PR you do something like:
This '@@' markup is what I'm talking about. Here on github and lots of other places you use triple backticks to markup code blocks. Of course, I don't think the Markdown "standard" (such as it is) has any method of marking code blocks, but I think triple backticks are widely-supported. I propose code blocks be marked like:
(that extra backslash is just so I can fool githubs markdown parsing to let me put triple backticks inside a code block marked out by triple backticks) |
Yep. I’d happily review a PR making an adjustment here. I’m not particularly worried about the block markers, but the triple back ticks are widely used. (In a way it would be nice to allow the markdown processor to be pluggable. I suspect that’s not going to be a hook we’d want to expose.) |
@carltongibson always happy to make people happy: review it 😜 ! |
Currently: