Wrapping document sections in <section> tags (code available)

I’ve come up with a way to do sticky headings in pure CSS. In order to create a theme with this technique, I need some control over how Zola renders page.content.

I don’t think the templating engine would make this possible.

I went to make a pull request, but the message on github indicated that I should discuss it here first. To prove to myself that it could be done, I put together an implementation on my own fork:

I thought about how this could be made more generic – maybe some people would want to use a tag other than <section>.

I think the ideal would have been to be able to bundle some code for post-processing as part of the theme (so that the needs of each theme don’t have to spill into the main rendering code), but for now that doesn’t seem as feasible.

Open to feedback.

That’s extremely unlikely to be merged as it’s essentially creating a custom output of CommonMark (never seen before afaik?) for one very very specific use-case.

I think semantically it makes sense to group everything under a specific heading in a <section>, so it’s not entirely without reason. Could you clarify what you mean by “custom output of CommonMark”? I see that the spec uses HTML as an example, but I didn’t think that meant there was only one way to convert from CM to HTML.

More generally, would you say that having control over rendering (i.e. page.content) is out-of-scope for Zola? What I’m really hoping for is a way to give themes more flexibility by letting them influence the rendering process.

Most people (including me) would assume that the output matches the spec.

More generally, would you say that having control over rendering (i.e. page.content ) is out-of-scope for Zola?

I would say it’s out-of-scope yes