-
Notifications
You must be signed in to change notification settings - Fork 19
Default pipeline should include <section/>s #279
Default pipeline should include <section/>s #279
Comments
@koraa do you remember changing this? |
It is not a regression, it is an "evolution". The default |
@trieloff What do you mean? |
I don't remember ever seeing |
I am almost sure that the code that handles the sections never touched the original content document and I have seen the |
Well, then it is an enhancement indeed. |
@trieloff When I test this on the current pipeline, is rendered as just that – hr. I think we just never really did use much in our examples :) AFAICS, the current behaviour is not really a bug – the way sections where supposed to be used until now was just to use the content.sections property and manually convert to html. This is indeed what #260 is intended to change :) |
Good. But I agree with @kptdobe that it would make sense to split write-protection removal and section handling into two separate PRs. |
ah ah, I think we all agree then ;) |
Note also that #143 is a slightly different thing which will be invalidated by the current issue: idea here was to have a VDOM object for each section which we will get for free once the sections are in the content.document object. I am going to close #143 and use this one as a replacement. Or maybe: if we keep the |
Agree. |
I agree that that's ok, however i don't find it particularly intuitive. Following our "intuitive over consistent" principle, I would vote for no sections, if there are no thematic breaks. |
I don't think that would make it easier to use, because you'd always have to check if |
The sections are definitely not intuitively expected in DOM from an md that has no ThematicBreaks. Also, playing with the sections I found them quite annoying in some ESI usecases I had, that would just include let’s say a short header or footer... |
@kptdobe, @davidnuescheler: Also wonder how this relates to #86. I was about to look into that one, but wonder if it still applies if we don't want any sectioning when there are no thematic breaks. Since the HTML5 spec introduces implicit sectioning (see: #86 (comment)), I also wonder what added value the thematic breaks bring if we explicitly introduce sections for all headings. With the folling examples:
# Foo
## Bar
### Baz
## Qux Assuming the pipeline performs explicit sectioning, the former example would result in the following HTML: <section>
<h1>Foo</h1>
<section>
<h2>Bar</h2>
<section>
<h3>Baz</h3>
</section>
</section>
<section>
<h2>Qux</h2>
</section>
</section> which is what the HTML5 document outline would be anyway. Now, assuming we use thematic breaks for explicit sectioning instead, then it seems to me it is easy to break the intuitive outline: # Foo
## Bar
---
### Baz
## Qux would turn into: <section>
<h1>Foo</h1>
<h2>Bar</h2>
</section>
<section>
<h3>Baz</h3>
<h2>Qux</h2>
</section> The HTML5 outline would even be wrong then, as it would have: <section>
<h1>Foo</h1>
<section>
<h2>Bar</h2>
</section>
</section>
<section>
<section>
<h3>Baz</h3>
</section>
<h2>Qux</h2>
</section> Can we assume all authors will consciously section the content as needed, or do we want the pipeline to enforce proper sectioning? Another point to consider is that the HTML5 sections always have a start and an end tag which lets you nest them as needed, while the thematic breaks we have only apply on the 1st level as we only have a "start" tag. On the other hand, introducing explicit sectioning on all headings is an opinionated decision, and we may not want to enforce that decision for helix. |
The HTML implicit sections are different from the explicit sections you'd put in your markdown, this is also why I'm not a fan of #86. |
The implicit sections are a different kind of sections. We are talking mostly about the |
@trieloff I do understand they are different, I'm just trying to understand how they are supposed to work together and how to avoid unexpected behaviors if you mix them.
@koraa Could be indeed, although I've also seen specs in draft for 10+ years at the W3C before they made it into a standard. So you never know. Anyway, I'm just trying to get my head around how an author would really use these and what the expectations would be. I get the easy trivial cases, but I'm more interested in the edge cases and more complex examples and also how they relate to the content structure and accessibility of the document. I can definitely create a markdown like: # Foo
## Bar
Lorem ipsum dolor sit amet
---
### Baz
consectetur adipiscing elit
---
## Qux to get an html similar to: <section>
<h1>Foo</h1>
<h2>Bar</h2>
<p>Lorem ipsum dolor sit amet</p>
</section>
<section>
<h3>Bar</h3>
<p>consectetur adipiscing elit</p>
</section>
<section>
<h2>Qux</h2>
</section> and do a 3 column layout with CSS based on the sections, but it would be incorrect from an accessibility point of view as the sections are exposed in the browser API. The document outline would be off. As a simple author editing that page, I may not be aware of all the WCAG constraints for instance and end up breaking the accessibility of my website's pages just because I'm trying to make the document easier to read on a widescreen. If we are only using thematic breaks for CSS work, then I'd argue that these shouldn't be |
In Helix, we use sections to outline sections of a document. A section is a logically consistent part of a document. Use cases for sections in Helix include:
The use of thematic breaks and in-document YAML blocks is a choice we've made to highlight sections with decent markdown editor support over the introduction of custom HTML elements. The use of the |
I may be misunderstanding something, but that's exactly the point I'm challenging here. My point is the examples I've seen so far are mostly representation decisions rather than actual semantic blocks. The The rule of thumb here is:
Taking the 3 examples you give: content-aware presentation content targeted for specific audiences or use cases Let's take blind vs. color blind vs. person with no disability vs. mobile. The blind person will want a textual voiceover description of the graph, a color blind person will want a grayscale version of the graph (or yellow-based), the non-disabled person will use the default one, and the mobile consumer will want, say, a vertical version of the graph. variations of content for the purpose of A/B testing I feel the fact that it sometimes works out when using I would be careful with this and rather opt-in than opt-out. I'm not fully sure how the YAML blocks are used at the moment, but I could imagine having something like: ---
class: hero
tag: section
---
# Foo
Lorem ipsum dolor sit amet
[CTA](/register) vs. ---
class: list
---
# Foo
Lorem ipsum dolor sit amet
[CTA](/register) That respectively render something like: <section class="hero">
<h1>Foo</h1>
<p>Lorem ipsum dolor sit amet</p>
<p><a href="/register">CTA</a></p>
</section> (rendered as block elements centered) vs. <div class="list">
<h1>Foo</h1>
<p>Lorem ipsum dolor sit amet</p>
<p><a href="/register">CTA</a></p>
</div> (rendered as inline-blocks floated left) The former being a conscious decision to add semantic meaning to the section, while the later is just used for styling purposes |
It seems that you are arguing using a couple of assumptions that don't reflect how Helix works or is designed, so I'm trying my best to clarify. content-aware presentation
In Helix, the content is driving the presentation. The content, not metadata, not templates or other rules. This means that just by having lots of images in a section, Helix can identify that this section is a gallery. Just by having a singular image, a headline and a short text with a link at the beginning of the document, Helix can identify that this section is a hero, and so on. Helix is able to look into the content of a section to determine what kind of section it is. Right now, we do this by adding However, in order to get there, we need to give the author the ability to explicitly structure their document, which we do with content targeted for specific audiences or use cases
Not a good example, because this is the same content, just presented differently. Additionally, there are plenty of technologies available to support this already ( A better example would be this page: https://www.adobe.com/products/photoshop.html#! What would it look like if we could differentiate between:
As an author, you'd want to treat this as a consistent whole, but have special sections for different users. The first-timer would get an introduction what Photoshop is, the hesitant buyer would get arguments to close the purchase, the new subscriber would get getting started guides and tutorials, the active user would get links to related products that work great with Photoshop. Each of these sections has dramatically different content, each of these sections works on it's own and is a real variations of content for the purpose of A/B testingAgain, semantics will be the same for each version, just the content would be different. The fact that you render What you are testing in your example is not content variations, but style variations. A good use case for content-based variations is the first section ("Get Photoshop as part of Adobe Creative Cloud for just US$20.99/mo"). Variations to test could include:
Again, you have a logical section of the document that should get rendered as a You are right, this is absolutely an opinionated choice on behalf of the framework. If your Markdown sections don't translate well to HTML |
Definitely! Still new to the project and trying to catch up on all the concept and assumptions. So I really do appreciate you taking the time to clarify these concepts here. I understand that structuring purely based on headings may not be a good call:
Agreed, great example. As I pointed out, I'm missing the initial use cases that we want to cover. That clarifies it, and I can clearly see a completely different structure needed for each. I can also see the need to use 1 or more I completely agree on the need to section the content, and with the examples you give, I have now a better understanding of the use cases we want to cover. Assuming the author does not need to know about the differences between
Just trying to point out that using the actual |
I think @ramboz is correct on the potential abuse" of I can totally get behind using |
Include proper sections in the HTML pipeline instead of plain <hr/> sectioning BREAKING CHANGE: Remove `context.content.sections` and move the sections directly under `context.content.mdast`; move the section types to the mdast `<node>.data.types`; move the section yaml meta info to `<node>.data.meta` fix #279
Include proper sections in the HTML pipeline instead of plain <hr/> sectioning fix #279
refactor existing tests and adjust code to properly support the new sections in the mdast fix #279
Include proper sections in the HTML pipeline instead of plain <hr/> sectioning BREAKING CHANGE: Remove `context.content.sections` and move the sections directly under `context.content.mdast`; move the section types to the mdast `<node>.data.types`; move the section yaml meta info to `<node>.data.meta` fix #279
Include proper sections in the HTML pipeline instead of plain <hr/> sectioning fix #279
refactor existing tests and adjust code to properly support the new sections in the mdast fix #279
BREAKING CHANGE: section types are moved to the sectio's meta object fix #279
Include proper sections in the HTML pipeline instead of plain `<hr>` sectioning BREAKING CHANGE: - Remove `context.content.sections` and move the sections directly under `context.content.mdast` - Adjust json schemas accordingly - Move the section yaml meta info to `<node>.meta` - Move the section types to the mdast `<node>.meta.types` Is dependent on adobe/helix-cli#1037 fix #279
# [4.0.0](v3.7.4...v4.0.0) (2019-07-05) ### Features * **html pipe:** Default pipeline should include <section/>s ([#379](#379)) ([27ad875](27ad875)), closes [adobe/helix-cli#1037](adobe/helix-cli#1037) [#279](#279) ### BREAKING CHANGES * **html pipe:** - Remove `context.content.sections` and move the sections directly under `context.content.mdast` - Adjust json schemas accordingly - Move the section yaml meta info to `<node>.meta` - Move the section types to the mdast `<node>.meta.types`
🎉 This issue has been resolved in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…he meta JSON attributes Fix integration tests for new sections model, by adding the newly exposed types array on the meta object. fix adobe/helix-pipeline#279
currently the default pipeline renders thematic breaks (
---
) in markdown to<hr>
and while it is a departure from githubs rendering they probably should correctly translate to<section> ... </section>
which definitely is a lot more useful for DOM query selectors.The text was updated successfully, but these errors were encountered: