-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
It should be possible to create fenced divs with non-h3 headings #621
Comments
As in your example the challenge block is currently forced to be h3. To accurately determine what level to place the header at I think we need to store the level of the previous header as a global variable in the lua filter, otherwise when we pass over the challenge block I don't think there is a way to know what preceded it. |
I don't know it's necessarily bad to enforce a level of uniformity in the appearance of headers in callouts and other special blocks - it prevents relying on lesson developers and maintainers to follow best practices and I don't know that we typically need that fine-grained of control. If we are going to allow variance, though, it would be ideal to have the variance take place relative to the enclosing structure, such that the document structure remains clean and accessible to screen readers, summarizers, and other technology. That is, the header level inside special blocks should be 1 level below that of the enclosing section (so typically h3 but sometimes h4, since h2s are primary headings in most lessons). |
@ndporter we can always use css to overwrite any changes to fontsize, lowering the challenge header may have so there is no visual difference. |
If it's hard to implement automatically increment, I think honoring what is in the markdown makes maintenance easier than the current behavior which makes the rendered html inconsistent with the markdown(and confused me as a maintainer). That also will make it so that markdown editors can create a correct outline structure for people while editing (increasing chances that we get good behavior in the rendered html without the auto-increment). |
Can we find a way to adjust the behaviour of sandpaper, to modify the heading level of fenced divs based on what is written in the source (R) Markdown?
At the moment, it appears that most fenced div headings are rendered as
h3
, except for the headings of solutions and hints, which are rendered as h4. The heading hierarchy of an episode can be disrupted by this, impacting the accessibility of the page.Consider the following example:
Ideally, the resulting heading hierarchy of the content written above would be as follows (indentation added for illustration):
which makes it clear to which [sub-]sub-section the exercises belong. At the moment, this will be the structure of the rendered page:
The text was updated successfully, but these errors were encountered: