Open adamkiss opened 3 years ago
This needs to be fixed in the source code inline docs
Should we move this to the kirby repo?
I wonder if the docs are really incorrect. I don't fully understand the internal writer setup, but as far as I can tell, these are all the supported node types:
But here 6 are imported: https://github.com/getkirby/kirby/blob/79bce56a34a188ceaafb0a5179215fb55dca8bc5/panel/src/components/Writer/Writer.vue#L46
And here it mentions the paragraph node: https://github.com/getkirby/kirby/blob/79bce56a34a188ceaafb0a5179215fb55dca8bc5/panel/src/components/Writer/Writer.vue#L153
And to me it makes sense to be able to limit the writer field to paragraphs only.
But if we filter the nodes
prop to the five (+ HardBreak
, which is always forced to be contained in the list), I don't think it's possible to configure other node types.
@distantnative @bastianallgeier?
You are probably right. Setting nodes: false
always leaves you with the paragraph "node", even though it doesn't seem to count as node.
If that's the case, we should however mention that somehow in the docs as it's obviously confusing.
The paragraph
node is a tricky and confusing one. So ideally we would not mention it to users. How could we phrase it clearer that one should use nodes: false
if only paragraph if the intention?
Today, as I was implementing Writer, I've looked up docs, specifically regarding limiting content;
This is what the docs state:
Looking at the panel source code, I also see following:
Some of those seem obvious (text =
inline: true
write fields?), but some of those (specificallyparagraph
, in my case) are probably missing in the docs.Additionally, I was able to limit my nodes to paragraphs only by setting the field option to:
which is consistent with other kirby panel options, but not mentioned in the docs.