question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[REQUEST] Default syntax rendering for inline code using Markdown

See original GitHub issue

No similar issue: I have checked and did not see a similar feature request in any issue (open or close) with the word “code”.

How would you improve Rich?

It would be nice if inline markdown code, like this, could be rendered by pygments in a default theme+language (lexer) for consistency with the way that code blocks are rendered instead of in a uniform style defined by markdown.code.

What problem does it solved for you?

In one of my project (friendly-traceback), I use code-blocks to show where an exception was raised. I then add some text, explaining the source of the problem, in which either single identifiers or parts of a line of code are inserted in a phrase using single backticks to identify as code. The lack of consistency in styling is less than ideal.

Note: I have looked at rich’s own code to see if I could monkeypatch it (which I do for some other things in my project) and could not find an easy way to do what I would like it to do. I’ve also used markdown with Sphinx, which uses Python as a default for code blocks and found that it too was not rendering inline code as Python code with the appropriate pygments theme. As far as I could tell, it does not look like something that would be easy to do and would completely understand if this issue would be closed with “won’t fix”. However, if it looks like it might be possible to monkeypatch rich (and/or commonmark?) to do this, I would appreciate if I could get some pointers as I would be willing to experiment further on my own.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
willmcgugancommented, Sep 14, 2020

v6.2.0 has inline code highlighting in Markdown. Set inline_code_lexer="python" on the Markdown constructor to enable it…

0reactions
arobergecommented, Sep 13, 2020

Thanks! I’ve been really busy with my day job (as a new Academic Year begins at our university) and have not had time to look at this. I really appreciate that you are tackling it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[REQUEST] Default syntax rendering for inline code ... - GitHub
In one of my project (friendly-traceback), I use code-blocks to show where an exception was raised. I then add some text, explaining the...
Read more >
Markdown Syntax Documentation - Daring Fireball
Markdown supports two style of links: inline and reference. In both styles, the link text is delimited by [square brackets]. To create an...
Read more >
Code · Styleguide Markdown
Inline. Use one (1) backtick character ` to create a inline code span which will render all wrapped content literally. Examples.
Read more >
How to Format Code in Markdown - freeCodeCamp
There are two ways to format code in Markdown. You can either use inline code, by putting backticks (`) around parts of a...
Read more >
20+ Useful Markdown Syntaxes for Developers
We will learn the syntaxes and how the syntax will render on the browser ... The inline code syntax uses the backtick symbols(``)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found