Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
substitute '@@' code block delimiter with triple backtick, more con…#5513
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…istent with other markdown extensions
… syntax name in codeblock
carltongibson left a comment
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.
Looks good in principle. Just the test that’s failing.
nastasi-oq commentedOct 19, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm in the same releases matrix ofhttps://travis-ci.org/encode/django-rest-framework/jobs/290016056 and it works on my machine. |
carltongibson commentedOct 20, 2017
Hey@nastasi-oq seegem#1 (comment) I refactored the test a bit, to show the rendered markdown. It looks like it's leaving the |
nastasi-oq commentedOct 20, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@carltongibson the point is that triple backtick is managed in any case (without pygments) as block of |
carltongibson commentedOct 20, 2017
Fine. That explains that. |
carltongibson left a comment
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.
OK. Lets have this.
Thanks@nastasi-oq!
merwok commentedNov 7, 2017
Hello! I had missed that one could use markdown in view docstrings to get nice code blocks, since it’s more common to have reST in the Python world, so first let me say thanks! This PR seems nice, but I can’t make it work locally. After installing markdown and pygments I tried json and javascript as lexer name, with and without leading space, with and without a blank line following. (I know reST and Sphinx very well but always forget details of Github Markdown.) Could the docs give a simple example? |
merwok commentedNov 7, 2017
FTR: Looking at the source code, it seems like the pygments_css function is only used by the DocumentationRenderer, which only works with include_docs_url. The classic HTML API renderer has markdown code blocks without colors. |
carltongibson commentedNov 7, 2017
@merwok This is because it's only just been added. A PR back porting this to the Browsable API would be welcome I guess. |
merwok commentedNov 7, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That’s interesting! I am not ready to switch to include_docs_url in my projects, so I would like to improve Browsable API. I’ll open a ticket if one isn’t already. |
merwok commentedNov 9, 2017
Quick update: it turns out that both Documentation and Browsable renderers are quite different but both end up calling apply_markdown. The generated HTML for BrowsableAPIRenderer already contains the pygments markup, only the CSS is missing. |

…sistent with other markdown extensions
following the discussion on the previous pull request (#5462) I moved from:
to:
(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)