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.

RST: Detect `::` signifying default language code-block.

See original GitHub issue

blacken-docs will do this:

- call ``reset_queries()``, like this::
+ call ``reset_queries()``, like this:
+ 
+  .. code-block:: python

But it’s an old-as-time RST convention that the :: means the following code block is the default language (i.e. Python)

Not respecting that is quite a lot of noise. Is there a way to control it? Could there be?

Thanks!

Refs https://github.com/django/django/pull/16261

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
carltongibsoncommented, Nov 30, 2022

It’s not just up to me 😄

Personally, I do want to keep the :: usage, but we can always adapt if the benefits are worth it.

I still need to investigate all the changes but, I’m more concerned by the required Oh, it always has to be valid code changes.

The trouble with skips is we no longer have an auto-formatter.

What we need is a black-ish that will hand wave over the invalid bits. (Don’t think that’s on the table)

You’ve been looking at this for while. I only just came to it. I also need to confer with Mariusz.

(This seems more a discussion for the Django PR than here… 😬)

1reaction
carltongibsoncommented, Nov 30, 2022

That’s OK. Disagreement on such is within the bounds of reason 😜

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow one to set a default language for code blocks #17 - GitHub
It would be practical if one could set a default language for highlighting code blocks -- e.g. through a buffer-local variable.
Read more >
1 Code::Blocks Project Management
During the first startup, Code::Blocks will copy the presettings from 'Default User' to the application data of the current users.
Read more >
Choose language type for code blocks in the Content Editor
Create a new code block with a default (plaintext) styling; Choose a syntax highlighting language from supported languages in highlight.js ...
Read more >
reStructuredText Primer - Sphinx documentation
reStructuredText is the default plaintext markup language used by Sphinx. ... The code-block directive can be used to set highlighting on a block-by-block ......
Read more >
Code blocks with syntax highlighting - TYPO3 Documentation
You can set the default language with the highlight directive. All following code blocks will use the language as specified in the highlight...
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