Assume that docstring code with no lang is julia
By making this assumption when parsing docstrings, we can remove the assumption that all no-lang Markdown code blocks are in fact Julia without compromising docstring highlighting.
:+1:, this seems better to me
Although doing it like Documenter where only the first code block is assumed to be Julia might be even better. The doctests etc later typically have jldoctest on them.
Personally "the default code language in Julia docstrings is Julia" makes sense to me, I'm not sure if it would be a good idea to restrict it to the first code block only or not?
I know code I've written there are instances where I've used indentation for Julia code multiple times, but I don't have a good sense off the top of my head of the general situation.
Is this the reason why
displays without any visual indication that MyNumber is code?
It's related, yup. The reason why is because the current highlighting rules don't apply any styling to it.
There are at least three routes we can take to changing this:
- Giving all code blocks a default colour (you can try
styled"{code:$(highlight(\"my code\"))}"to see how this would work) - Adding styling to identifiers
- Adding some sort of indicator of codeblocks beside colour (e.g. a vertical line on the left)
Something would be good since this is an unfortunate regression from 1.11.
Yea, I've run into this myself. Is anything negatively affected beside just the single-symbol headers in markdown code blocks?
Nothing comes to mind, but that seems worth considering when picking between 1/2/3/something else.
This was the case I ran into in the wild. The generalization MyInt <: MyNumber is also unstyled.