Skip to content
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

Highlight all unmarked code blocks in docstrings as Julia code #1934

Closed
mortenpi opened this issue Sep 15, 2022 · 1 comment
Closed

Highlight all unmarked code blocks in docstrings as Julia code #1934

mortenpi opened this issue Sep 15, 2022 · 1 comment
Labels
Status: Speculative It's unknown if this is something that we wan't to do Type: Enhancement

Comments

@mortenpi
Copy link
Member

We already do this if the code block is the first element in the docstring, in order to support the common pattern where the function signature is in an indented code block

    foo()

Docs of foo...

However, it is not unreasonable to have multiple signatures in a docstring (see #1933 (comment)), and so it might be convenient to highlight them all. On the other hand, any non-Julia code block would need to get an explicit ```none. So I guess the question is which is more common in a docstring: multiple signatures or unhighlighted text blocks (hence the speculative label).

  • It might make sense to distinguish indented vs non-indented code blocks, but we do not get that information from the parser as far as I know.
  • It could also be implemented as an option (e.g. docstring_auto_highlight = :none, :first, :all, defaulting to :first).

Related issue: #1101

@odow
Copy link
Collaborator

odow commented Nov 1, 2023

Closing in favor of #1101

@odow odow closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Speculative It's unknown if this is something that we wan't to do Type: Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants