Skip to content
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

Writer docs: paragraph node undocumented #1397

Open
adamkiss opened this issue Jun 19, 2021 · 7 comments
Open

Writer docs: paragraph node undocumented #1397

adamkiss opened this issue Jun 19, 2021 · 7 comments
Labels
needs: decision 🗳 Requires a decision to proceed type: content 📝 Is content-related

Comments

@adamkiss
Copy link
Contributor

Today, as I was implementing Writer, I've looked up docs, specifically regarding limiting content;

This is what the docs state:

Sets the allowed nodes. Available nodes: bulletList, orderedList, heading, horizontalRule, listItem. Activate/deactivate them all by passing true/false. Default nodes are heading, bulletList, orderedList.

Looking at the panel source code, I also see following:

  • HardBreak
  • Doc
  • Paragraph
  • Text

Some of those seem obvious (text = inline: true write fields?), but some of those (specifically paragraph, 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:

        nodes:
          - paragraph

which is consistent with other kirby panel options, but not mentioned in the docs.

@distantnative distantnative added the type: content 📝 Is content-related label Jul 17, 2021
@texnixe
Copy link
Member

texnixe commented Aug 7, 2021

This needs to be fixed in the source code inline docs

@texnixe
Copy link
Member

texnixe commented Aug 7, 2021

Should we move this to the kirby repo?

@lukasbestle
Copy link
Member

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:

https://github.com/getkirby/kirby/blob/79bce56a34a188ceaafb0a5179215fb55dca8bc5/panel/src/components/Writer/Writer.vue#L227-L231

@texnixe
Copy link
Member

texnixe commented Aug 7, 2021

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.

@lukasbestle
Copy link
Member

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?

@texnixe
Copy link
Member

texnixe commented Aug 8, 2021

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.

@distantnative
Copy link
Member

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?

@distantnative distantnative changed the title Writer docs are wrong (or incomplete?) Writer docs: paragraph node undocumented May 25, 2024
@distantnative distantnative added the needs: decision 🗳 Requires a decision to proceed label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: decision 🗳 Requires a decision to proceed type: content 📝 Is content-related
Projects
None yet
Development

No branches or pull requests

4 participants