-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Document implicit section behavior #213
Comments
You could always nest the section in a div? |
Yeh, but ughh, I feel that doesn't seem very readable or user friendly In the example, its not clear why its in a div, and seems more like a "hack" than a feature 🤔 |
I guess its not the end of the world, if this is the "solution" 😬 But I do feel at least this aspect of the heading parsing should be better documented in https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html#heading I guess the logic is that headings add sections if they are a child of the |
Yes. Agreed that the "section" behavior should be documented. As for ugliness, I think it's no more ugly that What's the real-world case that is motivating this? |
👍
No you are right actually, I should of never doubted you 😅 But yes documenting the section behaviour woulf be great thanks 🙏 |
It's perhaps not only a documentation issue. To me, it might also lead to inconsistencies in interpretation, as attributes and ids are on the section node when present, not the header:
Which content is supposed to be "red", and "blue" ? The whole section (including all child nodes) or just the header? EDIT:
BTW if I am not mistaken, djot.lua (at least at one point) differs from djot.js / the online playground here - having the id on the section node, but not the other attributes. |
This would be less confusing if there were just one AST element, Section, with a field for a title. Of course, this would be rendered in HTML as a
In HTML output at least, you can choose by using appropriate CSS rules. |
Sorry in case this is not entirely the right place for this question, but I found this issue trying to figure out the intended behavior of block attributes added to headings. Now, the last comment says (emphasis mine):
This seems to be the answer I was looking for, but I initially played with the playground, and was a little surprised by this example:
Somewhat unexpectedly, all attributes are assigned to the section instead if, and only if, one of them is an id. Is that an implementation issue? Is it possible to describe the intended behavior in a sentence or two? I am not so much interested in the workarounds, but curious about the consistency here, like "if a heading generates a section, all attributes should be assigned to the section"? Thanks for Djot btw, and thanks in advance for any guidance 🙂 |
When you create a heading, it nests all other content in a section
However, for example, if a heading is nested, it turns off this nesting:
I was thinking that perhaps there should be some way to specify that a heading should not be a section?
Perhaps something like
What do you think?
Note, I guess this has some read across to unnumbered in https://pandoc.org/MANUAL.html#extension-header_attributes
The text was updated successfully, but these errors were encountered: