mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-05 00:29:48 +03:00
Collapsible Content Blocks #72
Closed
opened 2026-02-04 16:30:57 +03:00 by OVERLORD
·
20 comments
No Branch/Tag Specified
development
l10n_development
further_theme_development
release
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#72
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cpressland on GitHub (Mar 10, 2016).
Originally assigned to: @ssddanbrown on GitHub.
It'd be awesome to be able to create FAQ's within Bookstack with Expandable and Collapsible text. For example: http://www.w3schools.com/jquerymobile/jquerymobile_collapsibles.asp
@Di2g10 commented on GitHub (Jun 13, 2016):
i would also want to be able to colapse Images / Code Snippets
@ghost commented on GitHub (Sep 13, 2017):
If I could add to this, what I think would work well would be if you added into the rich editor Panels that could be collapsible. Would also be nice to have panels as they could be colored.
@ssddanbrown commented on GitHub (Jun 18, 2018):
Just to add, Would be ideal to use the proper browser-native tags for this:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
Not supported by IE/Edge but it's being worked on for edge. Will need some simple IE/edge only JS for now to support functionality on those.
@aljawaid commented on GitHub (Aug 21, 2018):
This would be excellent
@Valiantiam commented on GitHub (Dec 29, 2018):
I have to say this would be huge. The ability to expand / collapse large codeblock even, would be enormously helpful regarding documentation relating to IT especially.
@drmax24 commented on GitHub (Jun 27, 2019):
Any news on this?
Can I use some plugin to have this feature already?
Without this feature wiki is unusable for us.
@ssddanbrown commented on GitHub (Jun 27, 2019):
@drmax24 Nope nothing at this time. An editor review is on the road-map, at which point features like this may be considered. The transition of edge browser to chromium will probably make this a little easier.
@X-15 commented on GitHub (Jan 20, 2020):
@ssddanbrown Hey, I was fighting myself through the issues and pull requests and either I am blind or I actually couldn't find any info on this? Spoilers actually are a very needed feature for MSP documentation purposes and am actually very surprised to find out it's not implemented. Would be amazing if it was in 0.28.0! Pretty pretty please???
@haripako commented on GitHub (Apr 23, 2020):
This would be great if it comes in any of the next upcoming updates.
@Science4583 commented on GitHub (Aug 8, 2020):
I ended up writing a hack to get this done. I put this in the Custom HTML Header section and added jquery and a png to
/uploads. To use it I addclass="collapse"orclass="collapsible"to an H2 or H3 tag on a page using the Source Editor. It looks a bit funky in action but it's close enough.Ends up looking like

@kirillnad commented on GitHub (Nov 12, 2020):
Markdown:
Custom HTML:
Based on JQuery Accordion
@technerdist commented on GitHub (Apr 27, 2021):
I tried to use mbazdell's solution above, but I'm missing something. I am a total beginner and do not know HTML. This is why I use Bookstack, because it's easy to use. Is there any way to simplify this or build it in to the platform? It does not seem like a complicated solution. Nested comment blocks are absolutely necessary to a wiki. Please help out those of use who use the WYSIWYG editor exclusively.
@FingerlessGlov3s commented on GitHub (Aug 7, 2021):
+1 on adding this, ideal for code blocks.
@afbpinheiro commented on GitHub (Aug 8, 2021):
@ssddanbrown I wonder if this couldn't be implemented with the HTML tags "details" and "summary".
Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary
To anyone else in this thread, maybe something like this works for you:
Demo:
Click to expand
Hidden text@ssddanbrown commented on GitHub (Aug 8, 2021):
@afbpinheiro Yeah, That was my suggestion above back in 2018. We now wouldn't be held back by IE/Edge. This this can already be used by Markdown editor users on BookStack, I'm planning on reworking the editors as part of #2738 so I don't really feel like it's worth adding to the WYSIWYG editor at this time.
@geefix commented on GitHub (Sep 15, 2021):
I faced this issue too. While @kirillnad 's approach was not that bad, i decided to make my own while reworking on the editor is done. I think this is a lot more appealing.
Add following to your custom html:
jquery is required for this:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>Inside the <script> tag:
A bit styling (inside <style> tag):
When this is added to custom html, all you need to do is assign a class "collapsible" to any element.
When you add "collapsed", the content block is collapsed initially.
Garnished with a neat arrow.
A little presentation how this works and looks like.
@topa-LE commented on GitHub (Dec 5, 2021):
I need for my bookstack now the spoiler in the edit of the posts Is this now current? Thanks
@ssddanbrown commented on GitHub (Dec 6, 2021):
@topa-LE This is not yet a built-in feature in the WYSIWYG editor. My last comment above is still the current status: https://github.com/BookStackApp/BookStack/issues/78#issuecomment-894786260
@finzzz commented on GitHub (Jan 23, 2022):
Is this going to be implemented at all? I feel like this is very much needed when reading a long wiki. It would be awesome if every headers and code blocks are automatically collapsible.
@ssddanbrown commented on GitHub (Feb 9, 2022):
Collapsible sections, backed by native details blocks has now been added to the editor via work in #3260.
These can be used to wrap pretty much any other block type (Code, Callouts, Headers, Text, Images) and the label displayed will be editable. Note, this does not use headers as collapse boundaries as per some of the custom implementations above.
This will be part of the next feature release, roughly planned for later this month. Since the work has been merged, I'll close off this issue.