Add "collapsible" (true/false) attribute to section config
Problem description
Section config in docs.yml currently supports the collapsed attribute which is very useful to manage large TOCs.
It would be great to also have the collapsible attribute so that we could create collapsible sections that are expanded by default.
Why would it be useful?
- More consistent UX for sections - even if some sections are expanded by default, they can still be collapsed.
- Feature parity with other documentation tools (e.g. Docusaurus).
Describe the solution (optional)
- Sections have a boolean
collapsibleattribute. - Default value can be
falseto keep the current default UX.
Additional context
We've added support for this!
Here's the schema: https://github.com/fern-api/fern/blob/537bc7609f04730962c02c733889cd25ff821e2c/fern/apis/docs-yml/definition/docs.yml#L584
Example: https://github.com/octoml/fern-config/blob/df167d25518348e615c4f6b821ad0f3c75214616/fern/docs.yml#L216-L217
We've added support for this!
Here's the schema:
fern/fern/apis/docs-yml/definition/docs.yml
Line 584 in 537bc76
collapsed: optional
Example: https://github.com/octoml/fern-config/blob/df167d25518348e615c4f6b821ad0f3c75214616/fern/docs.yml#L216-L217
@dannysheridan this request is slightly different. It's about having top-level sections that are both A) collapsible/expandable and B) expanded by default.
Something like:
- section: Introduction
collapsible: true # new config to be added, controls whether this section
# is rendered with the ">" (expand) / "^" (collapse) buttons
collapsed: false
Currently top-level sections can be either
- non-collapsible, always expanded
- collapsible and collapsed by default
but not
- collapsible and expanded by default <-- what we need
does collapsed: false work even on the subsections like you've said @dannysheridan ? Our impression is that this does not work.
@abvthecity has someone tested that his works?? This feels like a really simple fix, that really effects the docs quality
Since this now works, closing!