1) render-mode
doesn’t support a collection like [document, numbered-list], right? A block’s children might need to be displayed in both document
mode and numbered list
mode.
I don’t think there’s a need to support a collection. Instead, it would work sort of like CSS specificity. The render mode set by render-mode-children::
would be overridden by children who themselves have a render-mode::
defined on themselves. For example:
- my children will be shown in `Numbered List Mode`
render-mode-children:: numbered-list
- I will be rendered as a numbered list, as defined on my parent
- I will be rendered as a document, because my render mode overrides the mode defined on my parent
render-mode:: document
Note – I’m not 100% sure I understood what you meant by “collection”, so please let me know if this doesn’t answer your question!
2) Is there a strong need for specifying the render mode for the block itself instead of its children?
That would definitely be more elegant. I’m imagining your proposal would look something like this:
---
render-children-as:: document // this sets the mode for the top-level bullets
---
- I'll be shown in `Doc Mode`, as defined on the page property
render-children-as:: numbered-list
- I'll be shown in `Numbered List Mode`, as defined on parent property
- I'll be shown in `Numbered List Mode`, as defined on parent property
- I'll be shown in `Doc Mode`, as defined on the page property
- I'll be shown in `Doc Mode`, inherit from parent's mode since it's not defined
- I'll be shown in `Doc Mode`, inherit from parent's mode since it's not defined
The problem I see with this is that children would have to have the same mode as their siblings, i.e. you can’t specify a different mode just for one child.
One alternative could be to have the property be render-as::
rather than render-children-as::
and have it apply to the parent AND children, like this:
---
render-children-as:: document // this sets the mode for the top-level bullets
---
- I'll be shown in `Numbered List Mode`, as defined on myself
render-as:: numbered-list
- I'll be shown in `Numbered List Mode`, as defined on parent property
- I'll be shown in `Numbered List Mode`, as defined on parent property
- I'll be shown in `Lowercase Lettered Mode`, as defined on myself
render-as:: lowercase-lettered-list
- I'll be shown in `Doc Mode`, as defined on the page property
- I'll be shown in `Doc Mode`, inherit from parent's mode since it's not defined
- I'll be shown in `Doc Mode`, inherit from parent's mode since it's not defined
But that feels odd to me, because I rarely want a parent and its children to have the same mode. It does have the benefit of being more flexible—in theory you could go in and add a different render-as::
to each child to override the parents’ mode, but that ends up being messy.
If we don’t care about being able to set different modes for siblings, then your proposal to just do render-children-as::
works well. It also leaves room to add render-self-as::
in the future.